Skip to main content

A Declarative HTTP Client for Python.

Project description

PyPI Version Build Status Codecov Maintainability Documentation Status Join the chat at Code style: black

  • Builds Reusable Objects for Consuming Web APIs.
  • Works with Requests, aiohttp, and Twisted.
  • Inspired by Retrofit.

A Quick Walkthrough, with GitHub API v3

Uplink turns your HTTP API into a Python class.

from uplink import Consumer, get, Path, Query

class GitHub(Consumer):
    """A Python Client for the GitHub API."""

    def get_repos(self, user: Path, sort_by: Query("sort")):
        """Retrieves the user's public repositories."""

Build an instance to interact with the webservice.

github = GitHub(base_url="")

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

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

The returned object is a friendly requests.Response:

# Output: [{'id': 64778136, 'name': 'linguist', ...

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

Ready to launch your first API client with Uplink? Start with this quick tutorial!


Uplink officially 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

Extra! Extra!

Further, uplink has optional integrations and features. You can view a full list of available extras here.

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

Michael Kennedy (@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.

Or Carmi (@liiight), notifiers maintainer-

Uplink’s intelligent usage of decorators and typing leverages the most pythonic features in an elegant and dynamic way. If you need to create an API abstraction layer, there is really no reason to look elsewhere.


Check out the library’s documentation at

For new users, a good place to start is this quick tutorial.


Join the conversation on Gitter to ask questions, provide feedback, and meet other users!


Want to report a bug, request a feature, or contribute code to Uplink? Checkout the Contribution Guide for where to start. Thank you for taking the time to improve an open source project :purple_heart:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for uplink, version 0.9.3
Filename, size File type Python version Upload date Hashes
Filename, size uplink-0.9.3-py2.py3-none-any.whl (68.2 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size uplink-0.9.3.tar.gz (77.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page