Skip to main content

Interactive Python CLI that generates production-ready backend boilerplates (FastAPI, Flask, Django).

Project description

API Project Starter Kit

Interactive Python CLI that generates production-ready backend boilerplates for FastAPI, Flask, and Django.

Templates are written in Jinja2 — extend them without touching generator logic.

Features

  • One-question-at-a-time interactive flow (Questionary + Rich)
  • Frameworks: FastAPI · Flask · Django
  • Databases: PostgreSQL · MySQL · SQLite · MongoDB · None
  • ORMs filtered by framework
  • Background jobs: Celery · RQ · Dramatiq · APScheduler (+ Redis / RabbitMQ / Kafka)
  • Auth: JWT · OAuth · API Key
  • REST or GraphQL
  • Docker + docker-compose
  • Pytest / Unittest samples
  • Ruff · Black · Mypy · pre-commit
  • GitHub Actions CI
  • Structlog / Loguru / stdlib logging
  • CRUD module scaffolding (Users, Products, Orders, …)

Install

pip install api-project-starter-kit

From source (editable):

python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

Usage

api-starter

# Or as a module
python -m api_starter

# Custom output directory
api-starter --output ~/projects

Answer the prompts, confirm the summary, and a complete project is written to disk.

Layout

api_starter/
├── cli.py                 # Typer entry point
├── generator.py           # Façade
├── prompts.py             # Interactive questions
├── config.py              # Dataclasses & enums
├── validators.py          # Input validation
├── template_engine.py     # Jinja2 wrapper
├── template_registry.py   # Config → template map
├── project_builder.py     # Render + write files
├── filesystem.py          # Path helpers
├── utils/
└── templates/
    ├── fastapi/
    ├── flask/
    ├── django/
    └── shared/            # Docker, CI, jobs, modules, quality

Extending templates

  1. Add a .j2 file under api_starter/templates/<framework>/ or shared/.
  2. Register it in template_registry.py (TemplateMapping).
  3. Use context keys from ProjectConfig.to_template_context() (project_name, package_name, has_database, modules_meta, …).

Programmatic use

from api_starter.config import (
    Framework, Database, ORM, BackgroundJobs, Authentication,
    APIType, TestingFramework, LoggingLibrary, ProjectConfig,
)
from api_starter.generator import Generator

config = ProjectConfig(
    project_name="demo-api",
    framework=Framework.FASTAPI,
    database=Database.SQLITE,
    orm=ORM.SQLALCHEMY,
    background_jobs=BackgroundJobs.NO,
    authentication=Authentication.JWT,
    api_type=APIType.REST,
    docker=True,
    testing=TestingFramework.PYTEST,
    logging=LoggingLibrary.STRUCTLOG,
    github_actions=True,
    output_dir=".",
)

Generator().generate(config)

Publishing to PyPI

pip install -e ".[dev]"
python -m build
twine check dist/*
# TestPyPI first (recommended)
twine upload --repository testpypi dist/*
# Then production PyPI
twine upload dist/*

Create an API token at https://pypi.org/manage/account/token/ and use:

  • Username: __token__
  • Password: pypi-... (your token)

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

api_project_starter_kit-1.0.0.tar.gz (51.1 kB view details)

Uploaded Source

Built Distribution

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

api_project_starter_kit-1.0.0-py3-none-any.whl (84.1 kB view details)

Uploaded Python 3

File details

Details for the file api_project_starter_kit-1.0.0.tar.gz.

File metadata

  • Download URL: api_project_starter_kit-1.0.0.tar.gz
  • Upload date:
  • Size: 51.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.11

File hashes

Hashes for api_project_starter_kit-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a8fdef199f0944a566f42b8b20780b69ba7e9c4cd110ff8977c63f91d15a7083
MD5 324a5ff504d93e3ba0baa2ec2e171d9f
BLAKE2b-256 6b2329d602190698d9ddfd256a58220bc654b47d499c2f90632c5718aea2eeff

See more details on using hashes here.

File details

Details for the file api_project_starter_kit-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for api_project_starter_kit-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 16df082cd33a87958fc2bd43d485d074f08356b4e8aca39581b4e17380db3ef3
MD5 5eb509219872fadadb4863c1799d36ba
BLAKE2b-256 48f20ffd3d5fcdb01bc329a62a9c91475481050805034e8c38052a811dc4e9d3

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