<p align="center">
<img src="./docs/img/logo.png" style="width: 100%; max-width: 500px" alt="pythogen">
<br />
Generator of python HTTP-clients from OpenApi specification based on <i>httpx</i> and <i>pydantic</i>
</p>
<p align="center">
<a href="https://github.com/artsmolin/pythogen/actions" target="_blank">
<img src="https://github.com/artsmolin/pythogen/actions/workflows/test.yml/badge.svg" alt="tests">
</a>
<a href="https://codecov.io/gh/artsmolin/pythogen" target="_blank">
<img src="https://codecov.io/gh/artsmolin/pythogen/branch/main/graph/badge.svg?token=6JR6NB8Y9Z" alt="coverage">
</a>
<a href="https://pypi.org/project/pythogen/" target="_blank">
<img src="https://img.shields.io/pypi/v/pythogen.svg?color=%2334D058" alt="pypi">
</a>
<a href="https://pypi.python.org/pypi/pythogen/" target="_blank">
<img src="https://img.shields.io/pypi/pyversions/pythogen.svg?color=%2334D058" alt="python">
</a>
</p>
---
**Documentation**: <a href="https://artsmolin.github.io/pythogen" target="_blank">https://artsmolin.github.io/pythogen</a>
**Source Code**: <a href="https://github.com/artsmolin/pythogen" target="_blank">https://github.com/artsmolin/pythogen</a>
**Examples**: [sync](/examples/petstore/client_sync.py) and [async](/examples/petstore/client_async.py) clients for [Petstore OpenAPI](/examples/petstore/openapi.yaml)
---
## Installation
You can install the library
```shell
pip install pythogen
```
or use Docker
```shell
docker pull artsmolin/pythogen
```
## Generation
- `path/to/input` — path to the directory with openapi.yaml;
- `path/to/output` — the path to the directory where the generated client will be saved;
Generate a client using the installed library
```shell
pythogen path/to/input/openapi.yaml path/to/output/client.py
```
or via Docker
```shell
docker run \
-v ./path/to/input:/opt/path/to/input \
-v ./path/to/output:/opt/path/to/output \
artsmolin/pythogen \
path/to/input/openapi.yaml \
path/to/output/client.py
```
## Usage
```python
from petstore.client_async import Client
from petstore.client_async import Pet
from petstore.client_async import EmptyBody
from petstore.client_async import FindPetsByStatusQueryParams
client = Client(base_url="http://your.base.url")
pets: list[Pet] | EmptyBody = await client.findPetsByStatus(
query_params=FindPetsByStatusQueryParams(status="available"),
)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/artsmolin/pythogen",
"name": "pythogen",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": "openapi, openapi-generator, swagger, http-client, generator",
"author": "Artur Smolin",
"author_email": "artursmolin@outlook.com",
"download_url": "https://files.pythonhosted.org/packages/61/d9/af8a72af6bdc6633a9cd6f28583b74a6dab0474d6f0dfef53aaed42c1a95/pythogen-0.2.41.tar.gz",
"platform": null,
"description": "<p align=\"center\">\n<img src=\"./docs/img/logo.png\" style=\"width: 100%; max-width: 500px\" alt=\"pythogen\">\n<br />\nGenerator of python HTTP-clients from OpenApi specification based on <i>httpx</i> and <i>pydantic</i>\n</p>\n\n<p align=\"center\">\n<a href=\"https://github.com/artsmolin/pythogen/actions\" target=\"_blank\">\n <img src=\"https://github.com/artsmolin/pythogen/actions/workflows/test.yml/badge.svg\" alt=\"tests\">\n</a>\n<a href=\"https://codecov.io/gh/artsmolin/pythogen\" target=\"_blank\">\n <img src=\"https://codecov.io/gh/artsmolin/pythogen/branch/main/graph/badge.svg?token=6JR6NB8Y9Z\" alt=\"coverage\">\n</a>\n<a href=\"https://pypi.org/project/pythogen/\" target=\"_blank\">\n <img src=\"https://img.shields.io/pypi/v/pythogen.svg?color=%2334D058\" alt=\"pypi\">\n</a>\n<a href=\"https://pypi.python.org/pypi/pythogen/\" target=\"_blank\">\n <img src=\"https://img.shields.io/pypi/pyversions/pythogen.svg?color=%2334D058\" alt=\"python\">\n</a>\n</p>\n\n---\n**Documentation**: <a href=\"https://artsmolin.github.io/pythogen\" target=\"_blank\">https://artsmolin.github.io/pythogen</a>\n\n**Source Code**: <a href=\"https://github.com/artsmolin/pythogen\" target=\"_blank\">https://github.com/artsmolin/pythogen</a>\n\n**Examples**: [sync](/examples/petstore/client_sync.py) and [async](/examples/petstore/client_async.py) clients for [Petstore OpenAPI](/examples/petstore/openapi.yaml)\n\n---\n\n## Installation\nYou can install the library\n```shell\npip install pythogen\n```\nor use Docker\n```shell\ndocker pull artsmolin/pythogen\n```\n\n## Generation\n- `path/to/input` \u2014 path to the directory with openapi.yaml;\n- `path/to/output` \u2014 the path to the directory where the generated client will be saved;\n\nGenerate a client using the installed library\n```shell\npythogen path/to/input/openapi.yaml path/to/output/client.py\n```\n\nor via Docker\n```shell\ndocker run \\\n-v ./path/to/input:/opt/path/to/input \\\n-v ./path/to/output:/opt/path/to/output \\\nartsmolin/pythogen \\\npath/to/input/openapi.yaml \\\npath/to/output/client.py\n```\n\n## Usage\n```python\nfrom petstore.client_async import Client\nfrom petstore.client_async import Pet\nfrom petstore.client_async import EmptyBody\nfrom petstore.client_async import FindPetsByStatusQueryParams\n\nclient = Client(base_url=\"http://your.base.url\")\npets: list[Pet] | EmptyBody = await client.findPetsByStatus(\n query_params=FindPetsByStatusQueryParams(status=\"available\"),\n)\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Generator of python HTTP-clients from OpenApi specification.",
"version": "0.2.41",
"project_urls": {
"Homepage": "https://github.com/artsmolin/pythogen",
"Repository": "https://github.com/artsmolin/pythogen"
},
"split_keywords": [
"openapi",
" openapi-generator",
" swagger",
" http-client",
" generator"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "997413f07c6fbc6fea47802a8a725a37f216884cc8cd40c960bc41d71c24ae87",
"md5": "dd679b8c3fe31bf00ffbf7bf863d98bd",
"sha256": "0b58b6bfe93898207c6a75c25a1bb88c8f880cd4691d9c2b8c01659f28e5661c"
},
"downloads": -1,
"filename": "pythogen-0.2.41-py3-none-any.whl",
"has_sig": false,
"md5_digest": "dd679b8c3fe31bf00ffbf7bf863d98bd",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 31198,
"upload_time": "2024-07-29T15:48:28",
"upload_time_iso_8601": "2024-07-29T15:48:28.847226Z",
"url": "https://files.pythonhosted.org/packages/99/74/13f07c6fbc6fea47802a8a725a37f216884cc8cd40c960bc41d71c24ae87/pythogen-0.2.41-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "61d9af8a72af6bdc6633a9cd6f28583b74a6dab0474d6f0dfef53aaed42c1a95",
"md5": "4f3d7090d68cb342090470403eaefa40",
"sha256": "9188ad642c5435a977679db6014e54d2a8f63cb04371c7039ac9811d1801dcb3"
},
"downloads": -1,
"filename": "pythogen-0.2.41.tar.gz",
"has_sig": false,
"md5_digest": "4f3d7090d68cb342090470403eaefa40",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 22618,
"upload_time": "2024-07-29T15:48:30",
"upload_time_iso_8601": "2024-07-29T15:48:30.729082Z",
"url": "https://files.pythonhosted.org/packages/61/d9/af8a72af6bdc6633a9cd6f28583b74a6dab0474d6f0dfef53aaed42c1a95/pythogen-0.2.41.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-29 15:48:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "artsmolin",
"github_project": "pythogen",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pythogen"
}