Interactive Python project scaffolding CLI tool
Project description
bootpy ๐
Interactive multi-framework Python scaffolding CLI โ scaffold a production-ready FastAPI or Django 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
Follow the interactive prompts:
๐ง Project Configuration
Enter project name: my-api
Choose Python framework [FastAPI/Django]: 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!
โ๏ธ Configuration Options
Universal (all frameworks)
| Option | Choices | Default |
|---|---|---|
| Project name | Any alphanumeric + -_ |
my-project |
| Framework | FastAPI, Django |
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 |
๐ 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
๐ ๏ธ 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 as the first two frameworks?
FastAPI and Django represent the most contrasting 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
Supporting both frameworks in one CLI requires understanding that their project structures are fundamentally different โ not just in syntax but in philosophy. This was intentional: it tells a stronger architecture story than a single-framework tool would.
Flask was skipped for v1 because its minimalism means the scaffold would be nearly identical to a FastAPI base structure with fewer features. It's a natural v2 candidate.
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bootpy_cli-0.1.3.tar.gz.
File metadata
- Download URL: bootpy_cli-0.1.3.tar.gz
- Upload date:
- Size: 22.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee6ba77b06a9d1e896395b18e5f159ecd51b80819301ef6eaa2b4f98e8e967ae
|
|
| MD5 |
4e9ed9855168280d96637e7243b67a25
|
|
| BLAKE2b-256 |
b000893c20d034978ebf2b1a176e929c67d2593c512dcc81541db918bd246ccd
|
File details
Details for the file bootpy_cli-0.1.3-py3-none-any.whl.
File metadata
- Download URL: bootpy_cli-0.1.3-py3-none-any.whl
- Upload date:
- Size: 29.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2dd9d06c70dd5a4a23509d6377307e5a9e6ae45c8082444139ed5f07504b5d71
|
|
| MD5 |
11e14ce856f8a64cab84213646088cfa
|
|
| BLAKE2b-256 |
629368986e5eae3b44321eb144aab66b0eb73dab8ccd0019e38d1c78f5968566
|