New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pythogen

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pythogen

Generator of python HTTP-clients from OpenApi specification.

  • 0.2.41
  • PyPI
  • Socket score

Maintainers
1

pythogen
Generator of python HTTP-clients from OpenApi specification based on httpx and pydantic

tests coverage pypi python


Documentation: https://artsmolin.github.io/pythogen

Source Code: https://github.com/artsmolin/pythogen

Examples: sync and async clients for Petstore OpenAPI


Installation

You can install the library

pip install pythogen

or use Docker

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

pythogen path/to/input/openapi.yaml path/to/output/client.py

or via Docker

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

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"),
)

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc