Simple OpenAPI transmogrifier that produces Python code
Project description
openapi-transmog
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 (optionally) 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openapi_transmog-0.1.0.tar.gz.
File metadata
- Download URL: openapi_transmog-0.1.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.0 CPython/3.12.7 Darwin/24.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a2d75df9709b8a16a500ca04dad9ce1415e56841578bc8b34e31df406d82d4f
|
|
| MD5 |
f15408e9f3316545236c5acaf84b9899
|
|
| BLAKE2b-256 |
94d4b8c891a0c0a2674bd8670acb88a2c514d71533b24e64f5896caf8970291d
|
File details
Details for the file openapi_transmog-0.1.0-py3-none-any.whl.
File metadata
- Download URL: openapi_transmog-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.0 CPython/3.12.7 Darwin/24.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
161c2513ca753b5c826159fd38607861b203019ecf390988df504e6fec85e5af
|
|
| MD5 |
e47deccbe6fd26627dfa3b5dd0f7e7a8
|
|
| BLAKE2b-256 |
a9df390f875c6e43c3c178f70e29b5ca983add4a02061edb2ec19229e9435126
|