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.2.2.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.2.2-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

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

Hashes for fastapi_openapi_cli-0.2.2.tar.gz
Algorithm Hash digest
SHA256 24e00d3123669742051712546ad01ba7264925ef74ab16e04ffdfd155f2bdfc8
MD5 3dec4d465fa3a68f984edfdeb198c7ca
BLAKE2b-256 9ec58f9ce1e101cdb63eacbba27a12b57afab416decb0e80da256918ad4e579d

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_openapi_cli-0.2.2.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.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_openapi_cli-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b6a92fdd78780ded627b6f5d480dda7b2f613c93bea7d45ec62b3d79afd8414a
MD5 7cc2724f682bf6a6b7ae50a8a9c621bf
BLAKE2b-256 5a8ba5f5a9d1c026634e77d9735f84377ef777688ca3cae9eaea53c0fd06e343

See more details on using hashes here.

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

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