{"id":13494441,"url":"https://github.com/prkumar/uplink","last_synced_at":"2025-05-12T13:33:15.230Z","repository":{"id":24623704,"uuid":"104703235","full_name":"prkumar/uplink","owner":"prkumar","description":"A Declarative HTTP Client for Python","archived":false,"fork":false,"pushed_at":"2025-05-04T10:56:55.000Z","size":2478,"stargazers_count":1088,"open_issues_count":74,"forks_count":63,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-05-04T11:31:16.848Z","etag":null,"topics":["aiohttp","api-client","http","http-client","python","requests","rest-api","retrofit"],"latest_commit_sha":null,"homepage":"https://uplink.prkumar.dev","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prkumar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-25T04:27:45.000Z","updated_at":"2025-05-04T10:56:59.000Z","dependencies_parsed_at":"2023-01-14T07:46:12.231Z","dependency_job_id":"f181e621-c1ed-43cc-b7a4-daa874de5da4","html_url":"https://github.com/prkumar/uplink","commit_stats":{"total_commits":811,"total_committers":25,"mean_commits":32.44,"dds":0.06905055487053025,"last_synced_commit":"ae76b984eabc2de2c3174596965283787b49cf55"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prkumar%2Fuplink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prkumar%2Fuplink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prkumar%2Fuplink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prkumar%2Fuplink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prkumar","download_url":"https://codeload.github.com/prkumar/uplink/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253748176,"owners_count":21957879,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aiohttp","api-client","http","http-client","python","requests","rest-api","retrofit"],"created_at":"2024-07-31T19:01:25.095Z","updated_at":"2025-05-12T13:33:15.175Z","avatar_url":"https://github.com/prkumar.png","language":"Python","readme":"# Uplink\n\n[![PyPI Version](https://img.shields.io/pypi/v/uplink.svg)](https://pypi.python.org/pypi/uplink)\n[![CI](https://img.shields.io/github/actions/workflow/status/prkumar/uplink/ci.yml?branch=master\u0026logo=github\u0026label=CI)](https://github.com/prkumar/uplink/actions?query=event%3Apush+branch%master+workflow%3ACI)\n[![Coverage Status](https://img.shields.io/codecov/c/github/prkumar/uplink.svg)](https://codecov.io/gh/prkumar/uplink)\n[![Code Climate](https://api.codeclimate.com/v1/badges/d5c5666134763ff1d6c0/maintainability)](https://codeclimate.com/github/prkumar/uplink/maintainability)\n[![Documentation Status](https://readthedocs.org/projects/uplink/badge/?version=latest)](http://uplink.readthedocs.io/en/latest/?badge=latest)\n[![GitHub Discussions](https://img.shields.io/github/discussions/prkumar/uplink.png)](https://github.com/prkumar/uplink/discussions)\n[![Gitter](https://badges.gitter.im/python-uplink/Lobby.svg)](https://gitter.im/python-uplink/Lobby?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n\n- Builds Reusable Objects for Consuming Web APIs.\n- Works with **Requests**, **aiohttp**, and **Twisted**.\n- Inspired by [Retrofit](http://square.github.io/retrofit/).\n\n## A Quick Walkthrough, with GitHub API v3\n\nUplink turns your HTTP API into a Python class.\n\n```python\nfrom uplink import Consumer, get, Path, Query\n\n\nclass GitHub(Consumer):\n    \"\"\"A Python Client for the GitHub API.\"\"\"\n\n    @get(\"users/{user}/repos\")\n    def get_repos(self, user: Path, sort_by: Query(\"sort\")):\n        \"\"\"Retrieves the user's public repositories.\"\"\"\n```\n\nBuild an instance to interact with the webservice.\n\n```python\ngithub = GitHub(base_url=\"https://api.github.com/\")\n```\n\nThen, executing an HTTP request is as simply as invoking a method.\n\n```python\nrepos = github.get_repos(user=\"octocat\", sort_by=\"created\")\n```\n\nThe returned object is a friendly [`requests.Response`](http://docs.python-requests.org/en/master/api/#requests.Response):\n\n```python\nprint(repos.json())\n# Output: [{'id': 64778136, 'name': 'linguist', ...\n```\n\nFor sending non-blocking requests, Uplink comes with support for [`aiohttp` and `twisted`](https://github.com/prkumar/uplink/tree/master/examples/async-requests).\n\nReady to launch your first API client with Uplink? Start with this [quick tutorial](https://uplink.readthedocs.io/en/latest/user/quickstart.html)!\n\n## Features\n\n- **Quickly Define Structured API Clients**\n  - Use decorators and type hints to describe each HTTP request\n  - JSON, URL-encoded, and multipart request body and file upload\n  - URL parameter replacement, request headers, and query parameter support\n\n- **Bring Your Own HTTP Library**\n  - [Non-blocking I/O support](https://github.com/prkumar/uplink/tree/master/examples/async-requests) for Aiohttp and Twisted\n  - [Supply your own session](https://uplink.readthedocs.io/en/latest/user/clients.html#swapping-out-the-default-http-session) (e.g., `requests.Session`) for greater control\n\n- **Easy and Transparent Deserialization/Serialization**\n  - Define [custom converters](https://uplink.readthedocs.io/en/latest/user/serialization.html#custom-json-deserialization) for your own objects\n  - Support for [`marshmallow`](https://github.com/prkumar/uplink/tree/master/examples/marshmallow) schemas, [`pydantic`](https://pydantic-docs.helpmanual.io/) models, and [handling collections](https://uplink.readthedocs.io/en/latest/user/serialization.html#converting-collections) (e.g., list of Users)\n\n- **Extendable**\n  - Install optional plugins for additional features (e.g., [protobuf support](https://github.com/prkumar/uplink-protobuf))\n  - Compose [custom response and error handling](https://uplink.readthedocs.io/en/latest/user/quickstart.html#response-and-error-handling) functions as middleware\n\n- **Authentication**\n  - Built-in support for [Basic Authentication](https://uplink.readthedocs.io/en/latest/user/auth.html#basic-authentication)\n  - Use existing auth libraries for supported clients (e.g., [`requests-oauthlib`](https://github.com/requests/requests-oauthlib))\n\nUplink officially supports Python 3.10+.\n\n## Installation\n\nTo install the latest stable release, you can use `pip` (or `uv`):\n\n```bash\npip install -U uplink\n```\n\nIf you are interested in the cutting-edge, preview the upcoming release with:\n\n```bash\npip install https://github.com/prkumar/uplink/archive/master.zip\n```\n\n### Extra! Extra\n\nFurther, uplink has optional integrations and features. You can view a full list of available extras [here](https://uplink.readthedocs.io/en/latest/user/install.html#extras).\n\nWhen installing Uplink with `pip`, you can select extras using the format:\n\n```bash\npip install -U uplink[extra1, extra2, ..., extraN]\n```\n\nFor instance, to install `aiohttp` and `marshmallow` support:\n\n```bash\npip install -U uplink[aiohttp, marshmallow]\n```\n\n## User Testimonials\n\n**Michael Kennedy** ([@mkennedy](https://twitter.com/mkennedy)), host of [Talk Python](https://twitter.com/TalkPython) and [Python Bytes](https://twitter.com/pythonbytes) podcasts-\n\n\u003e 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.\n\n**Or Carmi** ([@liiight](https://github.com/liiight)), [notifiers](https://github.com/notifiers/notifiers) maintainer-\n\n\u003e 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.\n\n## Documentation\n\nCheck out the library's documentation at \u003chttps://uplink.readthedocs.io/\u003e.\n\nFor new users, a good place to start is this [quick tutorial](https://uplink.readthedocs.io/en/latest/user/quickstart.html).\n\n## Community\n\nUse the [Discussions](https://github.com/prkumar/uplink/discussions) tab on GitHub to join the conversation! Ask questions, provide feedback, and meet other users!\n\nWe're migrating our community from [Gitter](https://gitter.im/python-uplink/Lobby) to GitHub [Discussions](https://github.com/prkumar/uplink/discussions). Feel free to search our Gitter lobby for past questions and answers. However, to help us transition, please start new threads/posts in GitHub Discussions instead of Gitter.\n\n## Contributing\n\nWant to report a bug, request a feature, or contribute code to Uplink? Checkout the [Contribution Guide](https://github.com/prkumar/uplink/blob/master/CONTRIBUTING.md) for where to start.\nThank you for taking the time to improve an open source project 💜\n\n","funding_links":[],"categories":["Python","Programming Languages"],"sub_categories":["Python"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprkumar%2Fuplink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprkumar%2Fuplink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprkumar%2Fuplink/lists"}