Skip to main content

Boltra

A Python development toolkit for FastAPI.

Boltra is a Python development toolkit that creates small, readable FastAPI projects and runs them with one command. Boltra is designed specifically for FastAPI applications. Generated applications use ordinary FastAPI() code, so you can extend them with the FastAPI APIs you already know.

The current source version is 0.5.0. Boltra is in early development and ships as a pure Python package. Its CLI uses the standard library; installing Boltra does not require a compiler or native build toolchain.

📖 Contents

🧩 Implemented features

Feature What it does
boltra new <name> Creates a direct FastAPI app, settings, dependencies, and .env.example
boltra dev Discovers the project, launches Uvicorn, and reloads Python changes
boltra add app <name> Creates an app package and registers a working FastAPI router
Typed settings Reads environment variables and .env with Pydantic settings
Project validation Rejects invalid names and existing destinations; reports write failures
Configurable server Reads app target, host, and port from [tool.boltra]
Windows reload support Uses a Python compatibility runner for reliable worker restart
Help and version Supports --help, --version, and python -m boltra

App removal, router discovery, ORM, admin, authentication, workers, and AI are planned. They are not available commands yet. See the roadmap.

🚀 Quick start

Requirements: Python 3.12+ and uv. Install Boltra from PyPI as a separate CLI tool, keeping Boltra independent of your generated app's environment.

uv tool install boltra==0.5.0

boltra new school_api
cd school_api
uv sync
cp .env.example .env
boltra dev

On PowerShell, Copy-Item .env.example .env also copies the environment example. Set your own SECRET_KEY in .env. The generated default triggers a warning.

You can also install with python -m pip install boltra==0.5.0 inside a Python environment. Run python -m boltra --help if the console script is not on your PATH.

Open the app at localhost:8000 and interactive API docs at localhost:8000/docs.

The home endpoint returns:

{"message": "Hello from FastAPI + Boltra Kit"}

For other installation options and troubleshooting, read the installation guide.

📁 Project layout and configuration

school_api/
├── main.py          # Your ordinary FastAPI application
├── settings.py      # Typed settings and environment loading
├── pyproject.toml   # App dependencies and development-server configuration
└── .env.example     # Example local environment variables

The app depends on FastAPI, Pydantic settings, and Uvicorn. Boltra itself is a CLI tool and is not added as an app runtime dependency.

For example, add this route to main.py while boltra dev is running:

@app.get("/health")
async def health() -> dict[str, str]:
    return {"status": "ok"}

The server reloads the change. Open /health or try it from /docs.

For routes grouped into their own package:

boltra add app students

This creates apps/students/router.py and registers its APIRouter in the configured FastAPI application. Open /students/ to receive {"app": "students", "status": "ok"}. Add more routes to that router as your app grows. See the modular apps guide for examples, supported project layouts, and recovery behavior.

Change the server port in the generated pyproject.toml:

[tool.boltra]
mode = "fastapi-kit"
app = "main:app"
settings = "settings.py"
host = "127.0.0.1"
port = 8080

Restart boltra dev after changing .env or server configuration. Automatic reload watches Python source files, not environment/configuration changes.

📚 Documentation

Audience Guide
Getting started Complete quickstart
CLI users Commands, options, errors, and examples
Modular API routes App creation and registration
App developers Settings reference
Contributors Developer guide
Understanding the code Detailed file-by-file reference
Understanding the layout Repository structure
Validation results Verification report
Future work Python-first roadmap

🛠️ Develop Boltra

uv sync --locked --group dev
uv run ruff check .
uv run ruff format --check .
uv run mypy src
uv run pytest
uv run pytest --cov=boltra --cov-report=term-missing
uv build

Source code is organized by responsibility:

src/boltra/
├── cli/             # cli.py: entry point and command routing; parser.py: arguments
├── project/         # Generator, shared validation, and readable template assets
├── apps/            # App packages, name validation, and AST-based registration
└── dev/             # Project configuration, server launcher, and Windows runner

See CONTRIBUTING.md for checks and commit conventions. Windows development reload terminates the old worker; application shutdown hooks are not guaranteed during these restarts. Use normal Uvicorn without reload for production serving.

License

MIT — Boltra Contributors.

Metadata

Release files for boltra 0.5.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 boltra 0.5.0
File Size Uploaded Provenance Actions
boltra-0.5.0.tar.gz 119.1 kB Without provenance Details for boltra-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for boltra 0.5.0
File Interpreter ABI Platform Actions
boltra-0.5.0-py3-none-any.whl Python 3 none any Details for boltra-0.5.0-py3-none-any.whl

Total release size: 143.3 kB

Release files / boltra-0.5.0.tar.gz

Download URL boltra-0.5.0.tar.gz
Size 119.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c8e9ebf45bf9b41748b59584d25cf3b9ea1b50e8ae0374b0f40be94723a0cb15
BLAKE2b-256 checksum
How to use checksums
43fbbb5603a13c81114afc6871136a6618f2e7e31decb780aa9fa08f7fcba042
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / boltra-0.5.0-py3-none-any.whl

Download URL boltra-0.5.0-py3-none-any.whl
Size 24.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
decda51e12045656becb1b3d231a689a75ab7ef9f09b3f69d2c0864343d29d4c
BLAKE2b-256 checksum
How to use checksums
684f4100ef6593bf002fc9e3c3c162100b1e8944dfcef30fb3dadd72b67d4ffc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for boltra 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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