{"id":49488298,"url":"https://github.com/openapi/openapi-python-sdk","last_synced_at":"2026-05-01T03:02:39.658Z","repository":{"id":345265187,"uuid":"627960794","full_name":"openapi/openapi-python-sdk","owner":"openapi","description":"🐍 A fully-featured and blazing-fast Python API client to interact with Openapi®","archived":false,"fork":false,"pushed_at":"2026-04-14T10:03:57.000Z","size":155,"stargazers_count":4,"open_issues_count":10,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-14T12:08:35.855Z","etag":null,"topics":["api-client","api-marketplace","certified-api","django","flask","http","openapi","pypi-package","python","python-sdk","rest-api"],"latest_commit_sha":null,"homepage":"https://console.openapi.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openapi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing.md","funding":null,"license":null,"code_of_conduct":"docs/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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-04-14T15:25:32.000Z","updated_at":"2026-04-14T10:04:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/openapi/openapi-python-sdk","commit_stats":null,"previous_names":["openapi/openapi-python-sdk"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/openapi/openapi-python-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openapi%2Fopenapi-python-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openapi%2Fopenapi-python-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openapi%2Fopenapi-python-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openapi%2Fopenapi-python-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openapi","download_url":"https://codeload.github.com/openapi/openapi-python-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openapi%2Fopenapi-python-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32483406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api-client","api-marketplace","certified-api","django","flask","http","openapi","pypi-package","python","python-sdk","rest-api"],"created_at":"2026-05-01T03:02:37.428Z","updated_at":"2026-05-01T03:02:39.647Z","avatar_url":"https://github.com/openapi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://openapi.com/\"\u003e\n    \u003cimg alt=\"Openapi SDK for Python\" src=\".github/assets/repo-header-a3.png\" \u003e\n  \u003c/a\u003e\n\n  \u003ch1\u003eOpenapi® client for Python\u003c/h1\u003e\n  \u003ch4\u003eThe perfect starting point to integrate \u003ca href=\"https://openapi.com/\"\u003eOpenapi®\u003c/a\u003e within your Python project\u003c/h4\u003e\n\n[![Build](https://github.com/openapi/openapi-python-sdk/actions/workflows/python.yml/badge.svg)](https://github.com/openapi/openapi-python-sdk/actions/workflows/python.yml)\n[![PyPI Version](https://img.shields.io/pypi/v/openapi-python-sdk)](https://pypi.org/project/openapi-python-sdk/)\n[![Python Versions](https://img.shields.io/badge/python-%3E%3D3.10-blue)](https://pypi.org/project/openapi-python-sdk/)\n[![License](https://img.shields.io/github/license/openapi/openapi-python-sdk)](LICENSE)\n[![Downloads](https://img.shields.io/pypi/dm/openapi-python-sdk)](https://pypi.org/project/openapi-python-sdk/)\n\u003cbr\u003e\n[![Linux Foundation Member](https://img.shields.io/badge/Linux%20Foundation-Silver%20Member-003778?logo=linux-foundation\u0026logoColor=white)](https://www.linuxfoundation.org/about/members)\n\u003c/div\u003e\n\n## Overview\n\nA minimal and agnostic Python SDK for Openapi, inspired by a clean client implementation. This SDK provides only the core HTTP primitives needed to interact with any Openapi service.\n\n## Pre-requisites\n\nBefore using the Openapi Python Client, you will need an account at [Openapi](https://console.openapi.com/) and an API key to the sandbox and/or production environment\n\n## Features\n\n- **Agnostic Design**: No API-specific classes, works with any OpenAPI service\n- **Minimal Dependencies**: Only requires Python 3.8+ and `httpx`\n- **OAuth Support**: Built-in OAuth client for token management\n- **HTTP Primitives**: GET, POST, PUT, DELETE, PATCH methods\n- **Async Support**: Fully compatible with async frameworks like FastAPI and aiohttp\n- **Clean Interface**: Similar to the Rust SDK design\n\n## What you can do\n\nWith the Openapi Python Client, you can easily interact with a variety of services in the Openapi Marketplace. For example, you can:\n\n- 📩 **Send SMS messages** with delivery reports and custom sender IDs\n- 💸 **Process bills and payments** in real time via API\n- 🧾 **Send electronic invoices** securely to the Italian Revenue Agency\n- 📄 **Generate PDFs** from HTML content, including JavaScript rendering\n- ✉️ **Manage certified emails** and legal communications via Italian Legalmail\n\nFor a complete list of all available services, check out the [Openapi Marketplace](https://console.openapi.com/) 🌐\n\n\n## Installation\n\nThe package is available on [PyPI](https://pypi.org/project/openapi-python-sdk/) and supports Python 3.10 and above.\nInstall it with pip:\n\n```bash\npip install openapi-python-sdk\n```\n\nIf you are using Poetry:\n\n```bash\npoetry add openapi-python-sdk\n```\n\nNo additional configuration is needed. The only runtime dependency is [`httpx`](https://www.python-httpx.org/).\n\n## Usage\n\nInteraction with the Openapi platform happens in two distinct steps.\n\n### Step 1 — Generate a token\n\nAuthenticate with your credentials and obtain a short-lived bearer token scoped to the endpoints you need.\n\n```python\nfrom openapi_python_sdk import OauthClient\n\noauth = OauthClient(username=\"\u003cyour_username\u003e\", apikey=\"\u003cyour_apikey\u003e\", test=True)\n\nresp = oauth.create_token(\n    scopes=[\n        \"GET:test.imprese.openapi.it/advance\",\n        \"POST:test.postontarget.com/fields/country\",\n    ],\n    ttl=3600,\n)\ntoken = resp[\"token\"]\n\n# Revoke the token when done\noauth.delete_token(id=token)\n```\n\n### Step 2 — Call an API endpoint\n\nUse the token to make authenticated requests to any Openapi service.\n\n```python\nfrom openapi_python_sdk import Client\n\nclient = Client(token=token)\n\n# GET with query params\nresp = client.request(\n    method=\"GET\",\n    url=\"https://test.imprese.openapi.it/advance\",\n    params={\"denominazione\": \"altravia\", \"provincia\": \"RM\", \"codice_ateco\": \"6201\"},\n)\n\n# POST with a JSON payload\nresp = client.request(\n    method=\"POST\",\n    url=\"https://test.postontarget.com/fields/country\",\n    payload={\"limit\": 0, \"query\": {\"country_code\": \"IT\"}},\n)\n```\n\n### Customizing the Transport Layer\n\nIf you need to configure custom retry logic, proxies, or use a different HTTP client (such as passing a `requests.Session` with a custom urllib3 `Retry`), you can inject it directly using the `client` parameter on any SDK class:\n\n```python\nfrom requests.adapters import HTTPAdapter\nfrom urllib3.util.retry import Retry\nfrom openapi_python_sdk import Client\nimport requests\n\nretry = Retry(total=3)\nadapter = HTTPAdapter(max_retries=retry)\n\nsession = requests.Session()\nsession.mount(\"https://\", adapter)\n\n# Pass the custom session to the Client explicitly\nclient = Client(\"token\", client=session)\n```\n\n### Configuring Network Timeouts\n\nBy default, the SDK uses a 30-second timeout for all network requests to avoid hanging on slow network connections or heavy API operations. \n\nYou can easily override it passing a `timeout` explicitly during initialization to all client variants:\n\n```python\nfrom openapi_python_sdk import Client\n\nclient = Client(token=\"token\", timeout=60.0) # 60 seconds\n```\n\n## Async Usage\n\nThe SDK provides `AsyncClient` and `AsyncOauthClient` for use with asynchronous frameworks like FastAPI or `aiohttp`.\n\n### Async Authentication\n\n```python\nfrom openapi_python_sdk import AsyncOauthClient\n\nasync with AsyncOauthClient(username=\"\u003cyour_username\u003e\", apikey=\"\u003cyour_apikey\u003e\", test=True) as oauth:\n    resp = await oauth.create_token(\n        scopes=[\"GET:test.imprese.openapi.it/advance\"],\n        ttl=3600,\n    )\n    token = resp[\"token\"]\n```\n\n### Async Requests\n\n```python\nfrom openapi_python_sdk import AsyncClient\n\nasync with AsyncClient(token=token) as client:\n    resp = await client.request(\n        method=\"GET\",\n        url=\"https://test.imprese.openapi.it/advance\",\n        params={\"denominazione\": \"altravia\"},\n    )\n```\n\n\n## Testing\n\nInstall dev dependencies and run the test suite:\n\n```bash\npip install pytest\npytest\n```\n\nOr with Poetry:\n\n```bash\npoetry install\npoetry run pytest\n```\n\n\n\n\n## Contributing\n\nContributions are always welcome! Whether you want to report bugs, suggest new features, improve documentation, or contribute code, your help is appreciated.\n\nSee [docs/contributing.md](docs/contributing.md) for detailed instructions on how to get started. Please make sure to follow this project's [docs/code-of-conduct.md](docs/code-of-conduct.md) to help maintain a welcoming and collaborative environment.\n\n## Authors\n\nMeet the project authors:\n\n- Michael Cuffaro ([@maiku1008](https://www.github.com/maiku1008))\n- Openapi Team ([@openapi-it](https://github.com/openapi-it))\n\n## Partners\n\nMeet our partners using Openapi or contributing to this SDK:\n\n- [Blank](https://www.blank.app/)\n- [Credit Safe](https://www.creditsafe.com/)\n- [Deliveroo](https://deliveroo.it/)\n- [Gruppo MOL](https://molgroupitaly.it/it/)\n- [Jakala](https://www.jakala.com/)\n- [Octotelematics](https://www.octotelematics.com/)\n- [OTOQI](https://otoqi.com/)\n- [PWC](https://www.pwc.com/)\n- [QOMODO S.R.L.](https://www.qomodo.me/)\n- [SOUNDREEF S.P.A.](https://www.soundreef.com/)\n\n## Our Commitments\n\nWe believe in open source and we act on that belief. We became Silver Members\nof the Linux Foundation because we wanted to formally support the ecosystem\nwe build on every day. Open standards, open collaboration, and open governance\nare part of how we work and how we think about software.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\nThe MIT License is a permissive open-source license that allows you to freely use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, provided that the original copyright notice and this permission notice are included in all copies or substantial portions of the software.\n\nIn short, you are free to use this SDK in your personal, academic, or commercial projects, with minimal restrictions. The project is provided \"as-is\", without any warranty of any kind, either expressed or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement.\n\nFor more details, see the full license text at the [MIT License page](https://choosealicense.com/licenses/mit/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenapi%2Fopenapi-python-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenapi%2Fopenapi-python-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenapi%2Fopenapi-python-sdk/lists"}