Skip to main content

FastAPI project scaffold generator

Project description

Templum

PyPI version PyPI downloads

CLI scaffold generator for FastAPI microservices with clean layered architecture and explicit dependency injection. Install the package — one command creates a ready project with dependencies.

Every generated project ships with a CLAUDE.md that encodes all architectural rules so Claude Code works within the project's patterns from the first message.

Usage

uvx templum my-service

Or install globally and use as a persistent command:

uv tool install templum
templum my-service

With options:

templum my-service --output-dir ~/projects --python 3.12
Flag Default Description
--output-dir, -o . Parent directory for the new project
--python, -p 3.13 Minimum Python version

The command runs:

  1. uv init --bare — initializes the project
  2. Copies the scaffold (app/, Dockerfile, CLAUDE.md, .gitignore)
  3. uv add — installs base dependencies

What you get

my-service/
├── app/
│   ├── main.py          # FastAPI app, lifespan, router registration
│   ├── config.py        # Configuration via pydantic-settings
│   ├── auth.py          # Bearer token auth factory (do not modify)
│   ├── deps.py          # DI engine (do not modify)
│   └── setups/
│       ├── base.py      # Abstract setup (do not modify)
│       └── local.py     # Default setup — wire new services here
├── Dockerfile            # Multi-stage build with uv
├── CLAUDE.md             # Architectural rules for Claude Code
└── pyproject.toml        # Created by uv init

No domains or infrastructure implementations are included — the scaffold defines the shape; you fill it in.

Running the generated project

cd my-service
uv run fastapi dev app/main.py

Server at http://localhost:8000, docs at /docs.

Docker

docker build -t my-service .
docker run -p 8000:8000 my-service

Architecture

router → service → infrastructure

Each layer has one job and depends only on the layer below it via abstract interfaces. The full dependency graph is assembled in a single setup file — swapping infrastructure means creating a new setup, not touching any service.

The full spec lives in the generated project's CLAUDE.md: layer rules, DI patterns, naming conventions, and async guidelines.

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

templum-0.1.3.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

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

templum-0.1.3-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file templum-0.1.3.tar.gz.

File metadata

  • Download URL: templum-0.1.3.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.10","id":"questing","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for templum-0.1.3.tar.gz
Algorithm Hash digest
SHA256 73e4a465be990296d5e8e682d93ceca4d930a61765430336d356ad0c46a677dc
MD5 80ce6a366cf6effb3f562a80a42abd00
BLAKE2b-256 92bf7a038c96b81d5e5bd65d50fcf4a72473ed13809530243fe99b0fe65f5b03

See more details on using hashes here.

File details

Details for the file templum-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: templum-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.10","id":"questing","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for templum-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 dd6bb276c5c2ac55bd12688a651a1822c4e55db4f0cfc6015a3ded242f7546b5
MD5 b11642efac7bc66ce44e5c6424591b3c
BLAKE2b-256 430846280afe1698ba8e4f9c3a627f00e2acc54d45987ba2d240c9b123498724

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