CLI tool to export FastAPI OpenAPI specifications
Project description
fastapi-openapi-cli
A command-line tool to export OpenAPI specifications from FastAPI applications.
Installation
uv add fastapi-openapi-cli
Usage
Basic Usage
Export OpenAPI spec to stdout:
fastapi-openapi --app myapp.main:app
Export to JSON File:
fastapi-openapi --app myapp.main:app -o openapi.json
Export to YAML File:
fastapi-openapi --app myapp.main:app -o openapi.yaml
Development
Setup
This project uses uv for dependency management:
# Clone the repository
git clone https://github.com/hectcastro/fastapi-openapi-cli.git
cd fastapi-openapi-cli
# Install dependencies
uv sync
Running Tests
# Run all tests with coverage
make test
# Run specific test file
uv run pytest tests/test_cli.py
# Run without coverage
uv run pytest --no-cov
Linting and Formatting
# Check code with ruff
make lint
# Format code
make format
Type Checking
# Run type checking with ty
make types
Dependency Analysis
# Check for dependency issues with deptry
make deps
CI Pipeline
# Run all checks (lint, types, tests) - same as CI
make ci
Running the CLI Locally
# Run the CLI in development
uv run fastapi-openapi --app tests.fixtures.sample_app:app
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 fastapi_openapi_cli-0.2.2.tar.gz.
File metadata
- Download URL: fastapi_openapi_cli-0.2.2.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24e00d3123669742051712546ad01ba7264925ef74ab16e04ffdfd155f2bdfc8
|
|
| MD5 |
3dec4d465fa3a68f984edfdeb198c7ca
|
|
| BLAKE2b-256 |
9ec58f9ce1e101cdb63eacbba27a12b57afab416decb0e80da256918ad4e579d
|
Provenance
The following attestation bundles were made for fastapi_openapi_cli-0.2.2.tar.gz:
Publisher:
publish.yml on hectcastro/fastapi-openapi-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fastapi_openapi_cli-0.2.2.tar.gz -
Subject digest:
24e00d3123669742051712546ad01ba7264925ef74ab16e04ffdfd155f2bdfc8 - Sigstore transparency entry: 984520406
- Sigstore integration time:
-
Permalink:
hectcastro/fastapi-openapi-cli@7f5467100a8de0132c713a525cc90f22695ed205 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/hectcastro
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7f5467100a8de0132c713a525cc90f22695ed205 -
Trigger Event:
release
-
Statement type:
File details
Details for the file fastapi_openapi_cli-0.2.2-py3-none-any.whl.
File metadata
- Download URL: fastapi_openapi_cli-0.2.2-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6a92fdd78780ded627b6f5d480dda7b2f613c93bea7d45ec62b3d79afd8414a
|
|
| MD5 |
7cc2724f682bf6a6b7ae50a8a9c621bf
|
|
| BLAKE2b-256 |
5a8ba5f5a9d1c026634e77d9735f84377ef777688ca3cae9eaea53c0fd06e343
|
Provenance
The following attestation bundles were made for fastapi_openapi_cli-0.2.2-py3-none-any.whl:
Publisher:
publish.yml on hectcastro/fastapi-openapi-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fastapi_openapi_cli-0.2.2-py3-none-any.whl -
Subject digest:
b6a92fdd78780ded627b6f5d480dda7b2f613c93bea7d45ec62b3d79afd8414a - Sigstore transparency entry: 984520408
- Sigstore integration time:
-
Permalink:
hectcastro/fastapi-openapi-cli@7f5467100a8de0132c713a525cc90f22695ed205 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/hectcastro
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7f5467100a8de0132c713a525cc90f22695ed205 -
Trigger Event:
release
-
Statement type: