pythogen


Namepythogen JSON
Version 0.2.40 PyPI version JSON
download
home_pagehttps://github.com/artsmolin/pythogen
SummaryGenerator of python HTTP-clients from OpenApi specification.
upload_time2024-03-20 13:49:39
maintainerNone
docs_urlNone
authorArtur Smolin
requires_python<4.0,>=3.10
licenseMIT
keywords openapi openapi-generator swagger http-client generator
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <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/99/95/f370db65eb67672d377adac44ed5bb9885c9839d78cda3c31eea99c94fe7/pythogen-0.2.40.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.40",
    "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": "a844720eea98b5dcc13e5e1dbd527670bb40196eeb59d3261214275ba530823d",
                "md5": "1167ef9eacf62b1f3745988791c9041e",
                "sha256": "b4445bc35428c6bc09ed1f5a1c5c15d380273c2ecf6e3de6911a1738df9b7351"
            },
            "downloads": -1,
            "filename": "pythogen-0.2.40-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1167ef9eacf62b1f3745988791c9041e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 31182,
            "upload_time": "2024-03-20T13:49:37",
            "upload_time_iso_8601": "2024-03-20T13:49:37.162499Z",
            "url": "https://files.pythonhosted.org/packages/a8/44/720eea98b5dcc13e5e1dbd527670bb40196eeb59d3261214275ba530823d/pythogen-0.2.40-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9995f370db65eb67672d377adac44ed5bb9885c9839d78cda3c31eea99c94fe7",
                "md5": "61021c0f488a8a3743ed9f4b000893de",
                "sha256": "aefb8e516e90f5ccb4b905642787d613b81a09824c81170f22c5a12381851e08"
            },
            "downloads": -1,
            "filename": "pythogen-0.2.40.tar.gz",
            "has_sig": false,
            "md5_digest": "61021c0f488a8a3743ed9f4b000893de",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 22590,
            "upload_time": "2024-03-20T13:49:39",
            "upload_time_iso_8601": "2024-03-20T13:49:39.922260Z",
            "url": "https://files.pythonhosted.org/packages/99/95/f370db65eb67672d377adac44ed5bb9885c9839d78cda3c31eea99c94fe7/pythogen-0.2.40.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-20 13:49:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "artsmolin",
    "github_project": "pythogen",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pythogen"
}
        
Elapsed time: 0.22685s