Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi_openapi_cli-0.1.0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_openapi_cli-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_openapi_cli-0.1.0.tar.gz.

File metadata

  • Download URL: fastapi_openapi_cli-0.1.0.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

Hashes for fastapi_openapi_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d2b778c43cda0a2a881c5410afa9c60dcf4812a0fb0bd678bbcb813cc878126e
MD5 f7448e41816cb3d2577d905f7f61cbc2
BLAKE2b-256 af3821df821d3dd86c34953a5651076462b62308cecf13329a4851eaefe4aa52

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_openapi_cli-0.1.0.tar.gz:

Publisher: publish.yml on hectcastro/fastapi-openapi-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastapi_openapi_cli-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_openapi_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 92860f5d793123355d9b1a04887b182eaaccf0a909a3dfde103998fc1bc2796f
MD5 da2dc91ae80d826c0885bb95493aeaed
BLAKE2b-256 55f0902e93cfe03a60d86845ba173d44c9ae372cf0dcb4c234b346e2a20d28f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_openapi_cli-0.1.0-py3-none-any.whl:

Publisher: publish.yml on hectcastro/fastapi-openapi-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page