<commit_before>Uplink
******
|PyPI Version| |Build Status| |Coverage Status| |Code Climate| |Documentation Status|
|Gitter| |Code Style|

- Builds Reusable Objects for Consuming Web APIs.
- Works with **Requests**, **asyncio**, and **Twisted**.
- Inspired by `Retrofit <http://square.github.io/retrofit/>`__.

A Quick Walkthrough, with GitHub API v3
=======================================
Uplink turns your HTTP API into a Python class.

.. code-block:: python

   from uplink import Consumer, get, headers, Path, Query

   class GitHub(Consumer):

      @get("users/{user}/repos")
      def get_repos(self, user: Path, sort_by: Query("sort")):
         """Retrieves the user's public repositories."""

Build an instance to interact with the webservice.

.. code-block:: python

   github = GitHub(base_url="https://api.github.com/")

Then, executing an HTTP request is as simply as invoking a method.

.. code-block:: python

   repos = github.get_repos("octocat", sort_by="created")

The returned object is a friendly |requests.Response|_:

.. |requests.Response| replace:: ``requests.Response``
.. _requests.Response: http://docs.python-requests.org/en/master/api/#requests.Response

.. code-block:: python

   print(repos.json())
   # Output: [{'id': 64778136, 'name': 'linguist', ...

For sending non-blocking requests, Uplink comes with support for
|aiohttp and twisted|_.

.. |aiohttp and twisted| replace:: ``aiohttp`` and ``twisted``
.. _`aiohttp and twisted`: https://github.com/prkumar/uplink/tree/master/examples/async-requests

Use decorators and function annotations to describe the HTTP request:

* URL parameter replacement and query parameter support
* Convert response bodies into Python objects (e.g., using |marshmallow|_ or
  a `custom converter <http://uplink.readthedocs.io/en/latest/quickstart.html#deserializing-the-response-body>`_)
* JSON, URL-encoded, and multipart request body and file upload
* Inject functions as **middleware** to apply custom response and error handling

.. |marshmallow| replace:: ``marshmallow``
.. _`marshmallow`: https://github.com/prkumar/uplink/tree/master/examples/marshmallow

Installation
============
``uplink`` supports Python 2.7 & 3.3-3.7.

To install the latest stable release, you can use ``pip`` (or ``pipenv``):

::

    $ pip install -U uplink

If you are interested in the cutting-edge, preview the upcoming release with:

::

   $ pip install https://github.com/prkumar/uplink/archive/master.zip

Extra! Extra!
-------------

Further, uplink has optional integrations and features. You can view a full list 
of available extras `here <http://uplink.readthedocs.io/en/latest/install.html#extras>`_.

When installing Uplink with ``pip``, you can select extras using the format:

::

   $ pip install -U uplink[extra1, extra2, ..., extraN]


For instance, to install ``aiohttp`` and ``marshmallow`` support:

::

   $ pip install -U uplink[aiohttp, marshmallow]


User Testimonials
===============

**<NAME>** (`@mkennedy`_), host of `Talk Python`_ and `Python Bytes`_ podcasts-

    Of course our first reaction when consuming HTTP resources in Python is to
    reach for requests. But for *structured* APIs, we often want more than ad-hoc
    calls to requests. We want a client-side API for our apps. Uplink is
    the quickest and simplest way to build just that client-side API.
    Highly recommended.
<commit_msg>Fix capitalization<commit_after>Uplink
******
|PyPI Version| |Build Status| |Coverage Status| |Code Climate| |Documentation Status|
|Gitter| |Code Style|

- Builds Reusable Objects for Consuming Web APIs.
- Works with **Requests**, **asyncio**, and **Twisted**.
- Inspired by `Retrofit <http://square.github.io/retrofit/>`__.

A Quick Walkthrough, with GitHub API v3
=======================================
Uplink turns your HTTP API into a Python class.

.. code-block:: python

   from uplink import Consumer, get, headers, Path, Query

   class GitHub(Consumer):

      @get("users/{user}/repos")
      def get_repos(self, user: Path, sort_by: Query("sort")):
         """Retrieves the user's public repositories."""

Build an instance to interact with the webservice.

.. code-block:: python

   github = GitHub(base_url="https://api.github.com/")

Then, executing an HTTP request is as simply as invoking a method.

.. code-block:: python

   repos = github.get_repos("octocat", sort_by="created")

The returned object is a friendly |requests.Response|_:

.. |requests.Response| replace:: ``requests.Response``
.. _requests.Response: http://docs.python-requests.org/en/master/api/#requests.Response

.. code-block:: python

   print(repos.json())
   # Output: [{'id': 64778136, 'name': 'linguist', ...

For sending non-blocking requests, Uplink comes with support for
|aiohttp and twisted|_.

.. |aiohttp and twisted| replace:: ``aiohttp`` and ``twisted``
.. _`aiohttp and twisted`: https://github.com/prkumar/uplink/tree/master/examples/async-requests

Use decorators and function annotations to describe the HTTP request:

* URL parameter replacement and query parameter support
* Convert response bodies into Python objects (e.g., using |marshmallow|_ or
  a `custom converter <http://uplink.readthedocs.io/en/latest/quickstart.html#deserializing-the-response-body>`_)
* JSON, URL-encoded, and multipart request body and file upload
* Inject functions as **middleware** to apply custom response and error handling

.. |marshmallow| replace:: ``marshmallow``
.. _`marshmallow`: https://github.com/prkumar/uplink/tree/master/examples/marshmallow

Installation
============
``uplink`` supports Python 2.7 & 3.3-3.7.

To install the latest stable release, you can use ``pip`` (or ``pipenv``):

::

    $ pip install -U uplink

If you are interested in the cutting-edge, preview the upcoming release with:

::

   $ pip install https://github.com/prkumar/uplink/archive/master.zip

Extra! Extra!
-------------

Further, uplink has optional integrations and features. You can view a full list 
of available extras `here <http://uplink.readthedocs.io/en/latest/install.html#extras>`_.

When installing Uplink with ``pip``, you can select extras using the format:

::

   $ pip install -U uplink[extra1, extra2, ..., extraN]


For instance, to install ``aiohttp`` and ``marshmallow`` support:

::

   $ pip install -U uplink[aiohttp, marshmallow]


User Testimonials
===============

**<NAME>** (`@mkennedy`_), host of `Talk Python`_ and `Python Bytes`_ podcasts-

    Of course our first reaction when consuming HTTP resources in Python is to
    reach for Requests. But for *structured* APIs, we often want more than ad-hoc
    calls to Requests. We want a client-side API for our apps. Uplink is
    the quickest and simplest way to build just that client-side API.
    Highly recommended.

{'fraction_non_alphanumeric': 0.14393157351423094, 'fraction_numerical': 0.005014009733077717, 'mean_word_length': 4.161339421613394, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 8, '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': '588737', 'n_tokens_mistral': 2171, 'n_tokens_neox': 2004, 'n_words': 703}