{"id":22527,"library":"uplink","title":"Uplink","description":"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.","status":"active","version":"0.10.0","language":"python","source_language":"en","source_url":"https://github.com/prkumar/uplink","tags":["http-client","declarative","api","rest","pydantic","async"],"install":[{"cmd":"pip install uplink","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Default HTTP client backend.","package":"requests","optional":true},{"reason":"Async HTTP client backend.","package":"aiohttp","optional":true},{"reason":"Required for model serialization/deserialization (v2+).","package":"pydantic","optional":true},{"reason":"Alternative serialization backend.","package":"marshmallow","optional":true}],"imports":[{"note":"Uplink does not export any 'Uplink' class; the base class is 'Consumer'.","wrong":"from uplink import Uplink","symbol":"Consumer","correct":"from uplink import Consumer"},{"note":"All decorators are available directly from the 'uplink' package, not from a submodule.","wrong":"from uplink.decorators import get","symbol":"get, post, put, patch, delete, returns, json, headers, response_handler","correct":"from uplink import get, post, put, patch, delete, returns, json, headers, response_handler"},{"note":"The 'retry' decorator is in the 'upload.retry' submodule, not top-level.","wrong":"from uplink import retry","symbol":"retry","correct":"from uplink.retry import retry"}],"quickstart":{"code":"from uplink import Consumer, get, returns\n\nclass GitHub(Consumer):\n    base_url = \"https://api.github.com/\"\n\n    @returns.json\n    @get(\"users/{user}\")\n    def get_user(self, user):\n        pass\n\nif __name__ == \"__main__\":\n    github = GitHub()\n    response = github.get_user(\"prkumar\")\n    print(response.json())","lang":"python","description":"Define a GitHub API client that fetches a user by username."},"warnings":[{"fix":"Upgrade pydantic to v2 and update your models accordingly, or pin uplink<0.10.0 if you must keep pydantic v1.","message":"Pydantic 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').","severity":"breaking","affected_versions":"<0.10.0"},{"fix":"Upgrade to Python 3.10+ or use uplink==0.9.7 (last supporting Python 3.7+).","message":"Python 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.","severity":"breaking","affected_versions":"<0.10.0"},{"fix":"Install aiohttp (pip install uplink[aiohttp]) and configure the client with 'client=aiohttp.ClientSession()'.","message":"Async requires aiohttp: Uplink's async support works only with the 'aiohttp' client. Using 'requests' with async methods will raise a NotImplementedError.","severity":"gotcha","affected_versions":"all"},{"fix":"Pass timeout via the Consumer's 'timeout' argument or the 'request_timeout' parameter in method calls.","message":"The 'timeout' argument in decorators is deprecated as of 0.9.x; use 'timeout' parameter in Consumer constructor or per-request.","severity":"deprecated","affected_versions":">=0.9.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use: from uplink.retry import retry","cause":"'retry' is in the 'uplink.retry' submodule, not top-level.","error":"ImportError: cannot import name 'retry' from 'uplink'"},{"fix":"Upgrade to uplink>=0.10.0 or revert to pydantic v1 with 'class Config'.","cause":"Using pydantic v2 model syntax (e.g., 'model_config') with uplink <0.10.0 that expects pydantic v1.","error":"TypeError: __init__() got an unexpected keyword argument 'model_config'"},{"fix":"Ensure you instantiate the consumer correctly: github = GitHub()","cause":"The Consumer subclass was not instantiated correctly; the 'session' property is available only after calling the parent __init__.","error":"AttributeError: 'GitHub' object has no attribute 'session'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}