Skip to main content

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.

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bootpy_cli-0.1.3.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bootpy_cli-0.1.3-py3-none-any.whl (29.4 kB view details)

Uploaded Python 3

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

Hashes for bootpy_cli-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ee6ba77b06a9d1e896395b18e5f159ecd51b80819301ef6eaa2b4f98e8e967ae
MD5 4e9ed9855168280d96637e7243b67a25
BLAKE2b-256 b000893c20d034978ebf2b1a176e929c67d2593c512dcc81541db918bd246ccd

See more details on using hashes here.

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

Hashes for bootpy_cli-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2dd9d06c70dd5a4a23509d6377307e5a9e6ae45c8082444139ed5f07504b5d71
MD5 11e14ce856f8a64cab84213646088cfa
BLAKE2b-256 629368986e5eae3b44321eb144aab66b0eb73dab8ccd0019e38d1c78f5968566

See more details on using hashes here.

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