Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sonic182 committed Aug 21, 2019
1 parent abb8e2e commit 0da03e6
Show file tree
Hide file tree
Showing 20 changed files with 772 additions and 177 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,9 @@ async def run():
print('success')


def start():
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(run())


if __name__ == '__main__':
start()
```

# TODO
Expand Down
Binary file modified docs/doctrees/environment.pickle
Binary file not shown.
Binary file added docs/doctrees/examples.doctree
Binary file not shown.
Binary file modified docs/doctrees/index.doctree
Binary file not shown.
Binary file added docs/doctrees/reference.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: f2a20f460c0f382e61c6b8c9754fc4f6
config: 071a03a732b85484c3582c35c938c1b0
tags: 645f666f9bcd5a90fca523b33c5a78b7
6 changes: 6 additions & 0 deletions docs/html/_sources/examples.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

========
Examples
========

TODO
126 changes: 102 additions & 24 deletions docs/html/_sources/index.rst.txt
Original file line number Diff line number Diff line change
@@ -1,38 +1,108 @@
.. aiosonic documentation master file, created by
sphinx-quickstart on Sun Aug 4 20:11:31 2019.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

Welcome to aiosonic's documentation!
====================================
===================
Welcome to aiosonic
===================

.. .. toctree::
.. :maxdepth: 2
.. :caption: Contents:
Really Fast asynchronus HTTP 1.1 client, Support for http 2.0 is planned.

Current version is |release|.

Methods
Repo is hosted at Github_.

.. _GitHub: https://github.com/sonic182/aiosonic


Features
========

- Keepalive and Smart Pool of Connections
- Multipart File Uploads
- Chunked responses handling
- Chunked requests
- Fully type annotated.
- Connection Timeouts
- Automatic Decompression
- Follow Redirects
- 100% test coverage.



Requirements
============

- Python>=3.6

Install
=======

.. autofunction:: aiosonic.get
.. autofunction:: aiosonic.post
.. autofunction:: aiosonic.put
.. autofunction:: aiosonic.patch
.. autofunction:: aiosonic.delete
.. autofunction:: aiosonic.request
.. code-block:: bash
$ pip install aiosonic
.. You may want to install *optional* :term:`cchardet` library as faster
replacement for :term:`chardet`:
.. autoclass:: aiosonic.HttpHeaders
:members:
.. autoclass:: aiosonic.HttpResponse
:members:
Getting Started
===============

.. code-block::
Types
=====
import asyncio
import aiosonic
import json
async def run():
"""Start."""
response = await aiosonic.get('https://www.google.com/')
assert response.status_code == 200
assert b'Google' in (await response.content())
url = "https://postman-echo.com/post"
posted_data = {'foo': 'bar'}
response = await aiosonic.post(url, data=posted_data)
assert response.status_code == 200
data = json.loads(await response.content())
assert data['form'] == posted_data
print('success')
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(run())
.. autodata:: aiosonic.DataType
.. autodata:: aiosonic.HeadersType
Benchmarks
==========

The numbers speak for themselves

.. code-block:: bash
$ python tests/performance.py
doing tests...
{
"aiohttp": "1000 requests in 247.47 ms",
"requests": "1000 requests in 3625.10 ms",
"aiosonic": "1000 requests in 80.09 ms",
"aiosonic cyclic": "1000 requests in 128.71 ms",
"httpx": "1000 requests in 528.73 ms"
}
aiosonic is 209.00% faster than aiohttp
aiosonic is 4426.34% faster than requests
aiosonic is 60.70% faster than aiosonic cyclic
aiosonic is 560.17% faster than httpx
Contributing
============

1. Fork
2. create a branch `feature/your_feature`
3. commit - push - pull request

Thanks :)


Indices and tables
Expand All @@ -41,3 +111,11 @@ Indices and tables
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


.. toctree::
:maxdepth: 2

index
examples
reference
30 changes: 30 additions & 0 deletions docs/html/_sources/reference.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

=========
Reference
=========

TODO: get better this page

Methods
=======

.. autofunction:: aiosonic.get
.. autofunction:: aiosonic.post
.. autofunction:: aiosonic.put
.. autofunction:: aiosonic.patch
.. autofunction:: aiosonic.delete
.. autofunction:: aiosonic.request

.. autoclass:: aiosonic.HttpHeaders
:members:

.. autoclass:: aiosonic.HttpResponse
:members:


Types
=====

.. autodata:: aiosonic.DataType
.. autodata:: aiosonic.HeadersType

2 changes: 1 addition & 1 deletion docs/html/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '0.2.0',
VERSION: '0.2.1',
LANGUAGE: 'None',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
Expand Down
118 changes: 118 additions & 0 deletions docs/html/examples.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>Examples &#8212; aiosonic 0.2.1 documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Reference" href="reference.html" />
<link rel="prev" title="Welcome to aiosonic" href="index.html" />

<link rel="stylesheet" href="_static/custom.css" type="text/css" />


<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

</head><body>


<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">


<div class="body" role="main">

<div class="section" id="examples">
<h1>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h1>
<p>TODO</p>
</div>


</div>

</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">aiosonic</a></h1>








<h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Welcome to aiosonic</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="index.html#features">Features</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#install">Install</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#getting-started">Getting Started</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#methods">Methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#types">Types</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="index.html#indices-and-tables">Indices and tables</a></li>
</ul>
</li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Examples</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">Reference</a></li>
</ul>

<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li>Previous: <a href="index.html" title="previous chapter">Welcome to aiosonic</a></li>
<li>Next: <a href="reference.html" title="next chapter">Reference</a></li>
</ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>








</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2019, Johanderson Mogollon.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 2.1.2</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>

|
<a href="_sources/examples.rst.txt"
rel="nofollow">Page source</a>
</div>




</body>
</html>
Loading

0 comments on commit 0da03e6

Please sign in to comment.