Skip to content

yunruse/openapi-transmog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pip install openapi-transmog

PyPI - Version Python - 3.8+ PyPI - Downloads License - MIT

A simple development tool (not a dependency!) that transforms an OpenAPI specification into a single .py file that encapsulates its function calls and return types (as TypedDicts).

The .py file outputted requires Python 3.8 or later, requests, and python-dotenv.

Be aware this tool is early in development: it will make a lot of assumptions that likely will not hold for your particular API spec!

Usage

While the header must be passed along, it doesn't specify where you are getting certain variables. As such, you can pass various properties along. Make sure to wrap environmental variables in '' so they are interpreted at runtime, rather than hardcoding a secret token into your code!

python -m openapi-transmog spec.json --header X-Api-Token '$token' > api.py

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages