Metadata-Version: 2.3
Name: openapi-transmog
Version: 0.1.0
Summary: Simple OpenAPI transmogrifier that produces Python code
License: MIT
Author: Mia yun Ruse
Author-email: mia@yunru.se
Requires-Python: >=3.8
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Description-Content-Type: text/markdown

# openapi-transmog

A simple development tool (not a dependency!) that transforms an [OpenAPI specification](https://spec.openapis.org/oas/latest.html) into a single `.py` file that encapsulates its function calls and return types (as `TypedDict`s).

The `.py` file outputted requires Python 3.8 or later, [`requests`](https://pypi.org/project/requests/), and (optionally) [`python-dotenv`](https://pypi.org/project/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!

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