Registry / http-networking / uplink

uplink

JSON →
library0.10.0pypypi✓ verified 86d ago

A declarative HTTP client for Python that uses decorators and type hints to define API endpoints. Version 0.10.0, released in 2024, modernises to Pydantic v2 and requires Python 3.10+. Development is active but low velocity.

pip install uplink
INSTALL
IMPORT
SIG · UPLINK
U
uplink
http-networkingpythonv0.10.0
Install
2.2s avg
Import
1026ms
Disk
20MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.10.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 1.084s · 21.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.2s · import 0.968s · 22MB
20MB installed
● package 20MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Consumer
from uplink import Consumer
from uplink import Uplink
Uplink does not export any 'Uplink' class; the base class is 'Consumer'.
get, post, put, patch, delete, returns, json, headers, response_handler
from uplink import get, post, put, patch, delete, returns, json, headers, response_handler
from uplink.decorators import get
All decorators are available directly from the 'uplink' package, not from a submodule.
retry
from uplink.retry import retry
from uplink import retry
The 'retry' decorator is in the 'upload.retry' submodule, not top-level.

Define a GitHub API client that fetches a user by username.

from uplink import Consumer, get, returns class GitHub(Consumer): base_url = "https://api.github.com/" @returns.json @get("users/{user}") def get_user(self, user): pass if __name__ == "__main__": github = GitHub() response = github.get_user("prkumar") print(response.json())
Debug
Known issues
breakingPydantic v2 migration: Uplink 0.10.0 requires pydantic>=2.0. Code using pydantic v1 models will break unless models are updated to v2 syntax (e.g., 'class Config' -> 'model_config').
fix
Upgrade pydantic to v2 and update your models accordingly, or pin uplink<0.10.0 if you must keep pydantic v1.
affects: <0.10.0
breakingPython 3.10 minimum: Uplink 0.10.0 dropped support for Python <3.10. Running on older versions will fail with import errors or syntax errors.
fix
Upgrade to Python 3.10+ or use uplink==0.9.7 (last supporting Python 3.7+).
affects: <0.10.0
gotchaAsync requires aiohttp: Uplink's async support works only with the 'aiohttp' client. Using 'requests' with async methods will raise a NotImplementedError.
fix
Install aiohttp (pip install uplink[aiohttp]) and configure the client with 'client=aiohttp.ClientSession()'.
affects: all
deprecatedThe 'timeout' argument in decorators is deprecated as of 0.9.x; use 'timeout' parameter in Consumer constructor or per-request.
fix
Pass timeout via the Consumer's 'timeout' argument or the 'request_timeout' parameter in method calls.
affects: >=0.9.0
Errors
Common errors & fixes
ImportError: cannot import name 'retry' from 'uplink'
'retry' is in the 'uplink.retry' submodule, not top-level.
fix
Use: from uplink.retry import retry
TypeError: __init__() got an unexpected keyword argument 'model_config'
Using pydantic v2 model syntax (e.g., 'model_config') with uplink <0.10.0 that expects pydantic v1.
fix
Upgrade to uplink>=0.10.0 or revert to pydantic v1 with 'class Config'.
AttributeError: 'GitHub' object has no attribute 'session'
The Consumer subclass was not instantiated correctly; the 'session' property is available only after calling the parent __init__.
fix
Ensure you instantiate the consumer correctly: github = GitHub()
Upgrade
Version history
0.10.0latest on PyPI · released Jun 14, 2025
Audit
Dependencies
requestsoptionalDefault HTTP client backend.
aiohttpoptionalAsync HTTP client backend.
pydanticoptionalRequired for model serialization/deserialization (v2+).
marshmallowoptionalAlternative serialization backend.
Agent activity
16 hits · last 30 days
node
14
OpenAI (training)
1
Resources
uplink — pip install uplink · libregistry