Skip to main content

bootpy 🐍

Interactive multi-framework Python scaffolding CLI — scaffold a production-ready FastAPI, Django, or Flask project in under 60 seconds.

CI Python License: MIT PyPI version


✨ 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]: 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

# List available templates
bootpy list

⚙️ Configuration Options

Universal (all frameworks)

Option Choices Default
Project name Any alphanumeric + -_ my-project
Framework FastAPI, Django, Flask 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

📁 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

🛠️ 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?

FastAPI, Django, and Flask 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

Supporting all three 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.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bootpy-cli 0.2.1
File Size Uploaded Provenance Actions
bootpy_cli-0.2.1.tar.gz 26.7 kB Without provenance Details for bootpy_cli-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bootpy-cli 0.2.1
File Interpreter ABI Platform Actions
bootpy_cli-0.2.1-py3-none-any.whl Python 3 none any Details for bootpy_cli-0.2.1-py3-none-any.whl

Total release size: 64.1 kB

Release files / bootpy_cli-0.2.1.tar.gz

Download URL bootpy_cli-0.2.1.tar.gz
Size 26.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0693b095a2f7728b8e1552ce5b1f3406d8a10c3d02c6cd9a81588f191a22ec8e
BLAKE2b-256 checksum
How to use checksums
4eca9180c0392115c02509bac2ec2dfe2e8077ebfb3bbe3afe9aa0002ecf854b
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.2.1-py3-none-any.whl

Download URL bootpy_cli-0.2.1-py3-none-any.whl
Size 37.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7b0d92c473cae8f6711252e6613de58a89b515220fc37a34e8842f7f4a639de7
BLAKE2b-256 checksum
How to use checksums
2df26b4485fdeda6fda925d84f9483401d4842825472ce40db15a496babf47aa
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.2.1

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