Skip to main content

FastAPI Cookiecutter

⚡ A Powerhouse Template for FastAPI Projects ⚡

FastAPI Cookiecutter is a highly customizable Python template designed to kickstart your FastAPI applications with a production-ready structure. Perfect for developers who want a scalable, modular foundation without the setup grind.


Key Features

  • Flexible Setup: Choose between PostgreSQL or SQLite databases.
  • Optional Add-Ons: Enable Docker, Redis, or GitHub Actions CI/CD with a single prompt.
  • Modular Design: Prebuilt structure with routers, models, schemas, and services.
  • Testing Ready: Built-in Pytest support for async testing.
  • Database Migrations: Seamless integration with Alembic for schema management.
  • Health Checks: Monitor your app’s status with a dedicated endpoint.

Installation

Install FastAPI Cookiecutter via PyPI (assuming you publish it):

pip install fastapi-cookiecutter

Requirements

  • Python 3.11+
  • Dependencies: cookiecutter (automatically installed via pip)

Quick Start

After installation, generate a new FastAPI project:

fastapi-cookiecutter

Or use it directly from GitHub:

cookiecutter gh:Mohammad222PR/fastapi-cookiecutters

Answer the prompts to customize your project, and you’re good to go!


Usage Examples

Here’s how to wield FastAPI Cookiecutter:

Basic Project

Generate a simple FastAPI app with SQLite:

cookiecutter gh:Mohammad222PR/fastapi-cookiecutters
# Enter project_name="MyAPI", database="sqlite", use_docker="no", use_ci_cd="no"

Full-Stack Setup

Create a loaded project with Postgres, Docker, and CI/CD:

cookiecutter gh:Mohammad222PR/fastapi-cookiecutters --no-input \
  project_name="MyAPI" database="postgres" use_redis="yes" use_docker="yes" use_ci_cd="yes"

Check the generated README.md for next steps!


Configuration Options

When running the template, you’ll be prompted for:

Option Description Choices/Default
project_name Name of your project e.g., "MyAPI"
project_slug Auto-generated project directory name Auto-filled
author Your name e.g., "Your Name"
version Project version "0.1.0"
description Short project description e.g., "A FastAPI app"
database Database type "postgres" / "sqlite"
use_redis Include Redis support "yes" / "no"
use_docker Include Docker and Compose files "yes" / "no"
use_ci_cd Include GitHub Actions CI/CD pipeline "yes" / "no"

Why FastAPI Cookiecutter?

  • Speedy Setup: From template to running app in under 5 minutes.
  • Custom Power: Tailor your project with zero bloat.
  • Scalable Base: Ready for small scripts or massive APIs.
  • Pro Features: Everything you need, nothing you don’t.

License

FastAPI Cookiecutter is licensed under the MIT License. Use it, tweak it, share it—responsibly.


Notes

  • Responsible Customization: Only include what your project needs—keep it lean!
  • Feedback: Got ideas? Open an issue on GitHub!

Metadata

Release files for fastapi-cookiecutters 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 fastapi-cookiecutters 0.2.1
File Size Uploaded Provenance Actions
fastapi_cookiecutters-0.2.1.tar.gz 7.5 kB Without provenance Details for fastapi_cookiecutters-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fastapi-cookiecutters 0.2.1
File Interpreter ABI Platform Actions
fastapi_cookiecutters-0.2.1-py3-none-any.whl Python 3 none any Details for fastapi_cookiecutters-0.2.1-py3-none-any.whl

Total release size: 17.0 kB

Release files / fastapi_cookiecutters-0.2.1.tar.gz

Download URL fastapi_cookiecutters-0.2.1.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f1c8a2b21996d0146f2933f8dca016280b76e194c45829aef885fc40e081ef53
BLAKE2b-256 checksum
How to use checksums
ccae612fe54908f77a2ac08c5abf8c86cda28ab28ed7930dfea1f923278688b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.0

Release files / fastapi_cookiecutters-0.2.1-py3-none-any.whl

Download URL fastapi_cookiecutters-0.2.1-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
867806290f38b7f69588591e1f4064fa3d4c0bef8e33de9ea1ccd820fbd18efe
BLAKE2b-256 checksum
How to use checksums
0f340f8082345a874c5ea98b71ac5a63030de45d2d383d36d4b49f5c822843e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.0

Security for fastapi-cookiecutters 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