bootpy 🐍
Interactive multi-framework Python scaffolding CLI — scaffold a production-ready FastAPI, Django, Flask, or Litestar project in under 60 seconds.
✨ Why bootpy?
Every Python scaffolding tool I found was single-framework — either FastAPI-only or Django-only. bootpy is the first CLI that lets you pick your framework interactively, while generating a fully opinionated, production-ready structure with your exact configuration.
Think create-react-app, but for Python backend projects.
🚀 Quick Start
pip install bootpy-cli
bootpy
Interactive Mode
Follow the prompts:
🔧 Project Configuration
Enter project name: my-api
Choose Python framework [FastAPI/Django/Flask/Litestar]: FastAPI
Choose database [SQLite/PostgreSQL]: PostgreSQL
Include Docker & Docker Compose setup? [y/n]: y
Include Pytest testing setup? [y/n]: y
⚡ FastAPI Specific Options
Include Async ORM (SQLAlchemy async)? [y/n]: y
Include JWT Authentication boilerplate? [y/n]: y
Generating project in /path/to/my-api...
✓ Created app/main.py
✓ Created app/core/config.py
✓ Created app/core/security.py
✓ Created app/db/session.py
... (19 files total)
🚀 Project scaffolded successfully!
Non-interactive Mode
For CI/CD and automation:
# FastAPI with PostgreSQL, Docker, JWT
bootpy create my-api --framework fastapi --database postgres --jwt
# Flask without Docker
bootpy create my-app --framework flask --no-docker
# Litestar with custom template
bootpy create my-api --template ./my-company-template
# List available templates
bootpy list
⚙️ Configuration Options
Universal (all frameworks)
| Option | Choices | Default |
|---|---|---|
| Project name | Any alphanumeric + -_ |
my-project |
| Framework | FastAPI, Django, Flask, Litestar |
FastAPI |
| Database | SQLite, PostgreSQL |
SQLite |
| Docker & Docker Compose | y/n |
y |
| Pytest setup | y/n |
y |
FastAPI-specific
| Option | Choices | Default |
|---|---|---|
| Async ORM (SQLAlchemy 2.0) | y/n |
y |
| JWT Authentication | y/n |
y |
Django-specific
| Option | Choices | Default |
|---|---|---|
| Django Admin panel | y/n |
y |
| Django REST Framework | y/n |
y |
Flask-specific
| Option | Choices | Default |
|---|---|---|
| JWT Authentication | y/n |
y |
Litestar-specific
| Option | Choices | Default |
|---|---|---|
| Async ORM (SQLAlchemy 2.0) | y/n |
y |
| JWT Authentication | y/n |
y |
📁 Generated Project Structure
FastAPI (full options)
my-api/
├── app/
│ ├── main.py # FastAPI app + startup events
│ ├── api/
│ │ ├── router.py # Central API router
│ │ └── endpoints/
│ │ ├── auth.py # JWT login endpoint
│ │ └── users.py # User CRUD with auth
│ ├── core/
│ │ ├── config.py # Pydantic settings
│ │ └── security.py # JWT + bcrypt utilities
│ ├── db/
│ │ ├── session.py # Async SQLAlchemy engine
│ │ └── base.py # Declarative Base
│ ├── models/
│ │ └── user.py # SQLAlchemy User model
│ └── schemas/
│ ├── user.py # Pydantic User schemas
│ └── token.py # Token schemas
├── tests/
│ ├── conftest.py # Pytest fixtures + AsyncClient
│ ├── test_main.py
│ └── test_auth.py
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
├── README.md
└── .gitignore
Django (full options)
my-django-project/
├── my_django_project/ # Django project package
│ ├── settings.py # django-environ based settings
│ ├── urls.py # Root URL config (admin + API)
│ ├── wsgi.py
│ └── asgi.py
├── core/ # Core Django app
│ ├── models.py # Item model
│ ├── views.py # Health check + DRF ViewSet
│ ├── serializers.py # DRF ModelSerializer
│ ├── urls.py # App URL config
│ └── apps.py
├── tests/
│ ├── test_models.py
│ └── test_views.py
├── manage.py
├── pytest.ini
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
└── .gitignore
Flask (full options)
my-flask-app/
├── app/
│ ├── __init__.py # App factory
│ ├── core/
│ │ └── config.py # Configuration classes
│ ├── models/
│ │ └── user.py # SQLAlchemy User model
│ ├── routes/
│ │ ├── main.py # Main routes
│ │ └── auth.py # JWT login endpoint
│ └── services/
│ └── user_service.py # Business logic
├── tests/
│ ├── conftest.py # Pytest fixtures
│ └── test_main.py
├── .env
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
├── README.md
└── .gitignore
Litestar (full options)
my-litestar-app/
├── app/
│ ├── __init__.py # App factory
│ ├── core/
│ │ └── __init__.py # Configuration
│ ├── controllers/
│ │ └── __init__.py # Route handlers
│ ├── dto/
│ │ └── __init__.py # Data transfer objects
│ ├── models/
│ │ └── __init__.py # SQLAlchemy models
│ └── services/
│ └── __init__.py # Business logic
├── tests/
│ ├── conftest.py # Pytest fixtures + AsyncClient
│ └── test_main.py
├── .env
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
├── README.md
└── .gitignore
🎨 Custom Templates
Use your own templates with the --template flag:
bootpy create my-api --template ./my-company-template
Template Structure
Your custom template directory must contain:
manifest.json(optional) — skip rules for files*.jinjafiles — Jinja2 templates
Example:
my-template/
├── manifest.json
├── README.md.jinja
├── requirements.txt.jinja
├── app/
│ ├── __init__.py.jinja
│ └── main.py.jinja
└── tests/
└── test_main.py.jinja
Manifest Format
{
"skip_files": {
"Dockerfile": "not docker",
"auth.py": "not auth_jwt"
}
}
🛠️ Tech Stack
| Purpose | Library |
|---|---|
| CLI framework | Typer |
| Terminal UI | Rich |
| Template rendering | Jinja2 |
| Distribution | PyPI |
🔧 Development Setup
git clone https://github.com/galanjabal3/bootpy
cd bootpy
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install -e .
# Run tests
pytest
# Run CLI from source
bootpy
🧠 Design Decisions
Why FastAPI + Django + Flask + Litestar?
These four frameworks represent the most popular philosophies in Python backend development:
- FastAPI: async-first, type-hint driven, OpenAPI auto-generation, minimal structure
- Django: synchronous ORM, batteries-included, admin panel, opinionated structure
- Flask: minimalist, flexible, extensions-based, lightweight
- Litestar: high-performance, type-safe, advanced DI, modern Python
Supporting all four frameworks in one CLI requires understanding that their project structures are fundamentally different — not just in syntax but in philosophy.
Why Jinja2 for templating instead of string interpolation?
Conditional file generation (e.g., skip session.py if no ORM, skip security.py if no JWT) requires a proper templating engine. Jinja2 allows both conditional blocks within files and conditional inclusion of entire files — which plain string interpolation can't do cleanly.
Why the conditional file-skip logic in generator.py instead of the templates?
Keeping the skip logic in Python (generator.py) rather than spreading guards across every template keeps templates clean and readable, easier to extend, and decoupled from generation logic.
📄 License
MIT — see LICENSE
Metadata
Release files for bootpy-cli 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bootpy_cli-0.3.0.tar.gz | 31.1 kB | Without provenance | Details for bootpy_cli-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bootpy_cli-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for bootpy_cli-0.3.0-py3-none-any.whl |
Total release size: 74.8 kB
Release files / bootpy_cli-0.3.0.tar.gz
| Download URL | bootpy_cli-0.3.0.tar.gz |
|---|---|
| Size | 31.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0962451934d6eb4624e91a087f2812b0d3556c4365b451255c765744a484a5b5
|
|
BLAKE2b-256 checksum How to use checksums |
bf49b2ae034177ec3031d14eb4dad46a0b3c586b4c46cd0c2cb6ea58ce34371f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / bootpy_cli-0.3.0-py3-none-any.whl
| Download URL | bootpy_cli-0.3.0-py3-none-any.whl |
|---|---|
| Size | 43.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
73340e5d9c6e3ef6115271add781bd7542fa1f378173a5e2be85253ce424a971
|
|
BLAKE2b-256 checksum How to use checksums |
872cdb67d2116679ea500aba3ff1d371e6932e54cc9db7fddcbd92b02c8a806f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Security for bootpy-cli 0.3.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.