Skip to main content

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

Metadata

Release files for openapi-transmog 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openapi-transmog 0.1.0
File Size Uploaded
openapi_transmog-0.1.0.tar.gz 5.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openapi-transmog 0.1.0
File Interpreter ABI Platform
openapi_transmog-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.6 kB

Release files / openapi_transmog-0.1.0.tar.gz

Download URL openapi_transmog-0.1.0.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9a2d75df9709b8a16a500ca04dad9ce1415e56841578bc8b34e31df406d82d4f
BLAKE2b-256 checksum
How to use checksums
94d4b8c891a0c0a2674bd8670acb88a2c514d71533b24e64f5896caf8970291d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.0 CPython/3.12.7 Darwin/24.3.0

Release files / openapi_transmog-0.1.0-py3-none-any.whl

Download URL openapi_transmog-0.1.0-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
161c2513ca753b5c826159fd38607861b203019ecf390988df504e6fec85e5af
BLAKE2b-256 checksum
How to use checksums
a9df390f875c6e43c3c178f70e29b5ca983add4a02061edb2ec19229e9435126
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.0 CPython/3.12.7 Darwin/24.3.0

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page