<commit_before>.. aiohttp documentation master file, created by
   sphinx-quickstart on Wed Mar  5 12:35:35 2014.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

aiohttp
=======

http client/server for asyncio (:pep:`3156`).

.. _GitHub: https://github.com/KeepSafe/aiohttp


Features
--------

- Supports both :ref:`aiohttp-client` and :ref:`aiohttp-web`.
- Supports :ref:`aiohttp-web-websockets` out-of-the-box.
- Web-server has :ref:`aiohttp-web-middlewares` and pluggable routing.

Library Installation
--------------------

::

   pip3 install aiohttp

For smart detection of *Content-Type* by client API you would like to
install *chardet* also::

   pip install chardet


Getting Started
---------------

Client example::

    import asyncio
    import aiohttp

    @asyncio.coroutine
    def fetch_page(url):
        response = yield from aiohttp.request('GET', url)<commit_msg>Add Cython tip when you install aiohttp<commit_after>.. aiohttp documentation master file, created by
   sphinx-quickstart on Wed Mar  5 12:35:35 2014.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

aiohttp
=======

http client/server for asyncio (:pep:`3156`).

.. _GitHub: https://github.com/KeepSafe/aiohttp


Features
--------

- Supports both :ref:`aiohttp-client` and :ref:`aiohttp-web`.
- Supports :ref:`aiohttp-web-websockets` out-of-the-box.
- Web-server has :ref:`aiohttp-web-middlewares` and pluggable routing.

Library Installation
--------------------

::

   pip3 install aiohttp

For smart detection of *Content-Type* by client API you would like to
install `chardet` also::

   pip3 install chardet

*Optional*: To improve performances, you can install `Cython` **before** `aiohttp`::

   pip3 install cython

Getting Started
---------------

Client example::

    import asyncio
    import aiohttp

    @asyncio.coroutine
    def fetch_page(url):
        response = yield from aiohttp.request('GET', url)
{'fraction_non_alphanumeric': 0.13951219512195123, 'fraction_numerical': 0.016585365853658537, 'mean_word_length': 3.1350806451612905, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7436051', 'n_tokens_mistral': 686, 'n_tokens_neox': 637, 'n_words': 208}