uplink
A Declarative HTTP Client for Python.
What it is and what it does
Uplink is a declarative HTTP client library that lets you define REST API clients as Python classes using decorators and type hints, inspired by Retrofit. Instead of writing ad-hoc requests calls, you annotate methods with @get, @post, etc., and specify path parameters, query strings, and request bodies through function arguments. It handles URL construction, parameter serialization, and response parsing automatically.
The library works with requests by default and supports async I/O through aiohttp and twisted. It can deserialize responses into custom Python objects, with optional integrations for marshmallow and pydantic schemas. You bring your own HTTP session for control over connection pooling, authentication, and other session-level concerns.
Use it for:
- Building a reusable Python client for a third-party REST API without writing repetitive request boilerplate.
- Creating internal API abstraction layers so application code calls clean Python methods instead of raw HTTP calls.
- Implementing async API clients with aiohttp or twisted when you need non-blocking I/O.
- Defining strongly-typed API contracts with decorators and type hints to catch errors early.
- Integrating with marshmallow or pydantic to automatically serialize and deserialize JSON responses.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Uplink turns HTTP APIs into declarative Python classes using decorators and type hints, letting you build reusable API clients with minimal boilerplate.
Yes, with conditions. Uplink is a solid choice for building structured REST clients in modern Python and has no known vulnerabilities. The low install friction and permissive MIT license make it safe to adopt. However, the aging maintenance status means you should verify that async support and optional integrations match your needs before committing to it for a new project.
Install
uplink on PyPI
pip
pip install uplinkuv
uv add uplinkpoetry
poetry add uplinkInstalling uplink
Before you install
Low friction install with three lightweight runtime dependencies (requests, six, uritemplate). Maintenance status is aging—last release was 426 days ago—but the repository remains active with 1140 stars.
License in practice
MIT License permits unrestricted use, modification, and distribution with minimal obligations, making it safe for commercial and proprietary projects.
Quickstart
pip install uplink
from uplink import Consumer, get, Path, Query
class GitHub(Consumer):
@get("users/{user}/repos")
def get_repos(self, user: Path, sort_by: Query("sort")):
pass
github = GitHub(base_url="https://api.github.com/")
repos = github.get_repos(user="octocat", sort_by="created")
Requires Python 3.10 or later.
Verify before relying
- Whether aiohttp and twisted async support are production-ready given the aging maintenance status
- Current state of optional marshmallow and pydantic integrations and their maintenance
Package facts
| License | MIT License Copyright (c) 2018 P. Raj Kumar Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — requests, six, uritemplate |
| Maintenance | aging — 426 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 190,687/month — #9,901 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: uplink-0.10.0-py3-none-any.whl
Keywords: api, client, http, rest, retrofit
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
oauthlibOAuthLib implements OAuth 1.0 and OAuth 2.0…
permissive · top 1,000 on PyPI
conjure-python-clientA lightweight HTTP client library built on…
permissive · top 15,000 on PyPI
agithubA lightweight REST API client with transparent…
permissive · top 15,000 on PyPI
pookpook intercepts and mocks HTTP traffic for…
permissive · top 15,000 on PyPI
hammockHammock wraps the requests library to let you…
unclear · top 15,000 on PyPI
marshmallow-jsonapiProduces JSON API 1.0-compliant output from…
permissive · top 15,000 on PyPI
botoinatorBotoinator lets you attach decorators to boto3…
permissive · top 15,000 on PyPI
opencode-aiProvides a Python client library for the…
permissive · top 15,000 on PyPI
requests-oauthlibAdds OAuth 1 and OAuth 2 authentication support…
permissive · top 1,000 on PyPI
PyGithubPyGithub provides Python access to the GitHub…
copyleft · top 1,000 on PyPI