Skip to main content

A reusable FastAPI project initializer with production-oriented templates.

Project description

inifastapi

inifastapi is a reusable FastAPI project initializer. It generates a stronger personal FastAPI engineering template around a fixed layout: app/, app/api/v1/, app/config/, app/schemas/, app/services/, app/utils/, plus top-level dockers/, scripts/, tests/, logs/, and optional alembic/.

Requirements

uv must be installed on the machine. The scaffold uses uv both to run the CLI and to bootstrap the generated FastAPI project.

Usage

You do not need to install inifastapi first if it has been published. The recommended one-off command is:

uvx inifastapi init
uvx inifastapi init my-service

More examples:

uvx inifastapi init my-service --with-database --with-auth
uvx inifastapi init my-service --with-task-queue --with-ci --ci-provider github

init runs as an interactive wizard. If you pass my-service, it is used as the prefilled project name; the wizard still lets you confirm the project name, target directory, application title, description, and feature flags. The generated package is always app, and the project always uses the fixed non-src layout above. Database, auth, cache, task queue, Docker, and CI are all selectable in the wizard, and the generated project bootstraps the matching dependencies with uv.

Published Package

If inifastapi is available on PyPI, prefer uvx for one-off usage:

uvx inifastapi init
uvx inifastapi init my-service

This downloads and runs the scaffold temporarily. It does not add inifastapi to the generated project's dependencies.

Local Development

If you are working from this repository before publishing, use the local environment:

uv sync --group dev
uv run inifastapi init
uv run inifastapi init my-service

You can also run the local source tree without installing it globally:

uvx --from . inifastapi init
uvx --from . inifastapi init my-service

Install

If you want a persistent local development environment for the scaffold itself:

uv sync --group dev

Features

  • Auto-registered routers from app/api/v1/
  • pydantic-settings configuration
  • Lifespan-aware app factory in app/utils/build_app.py
  • Request logging and security middleware
  • File + console logging with noise control in app/utils/logging.py
  • Service-oriented layout under app/services/
  • Root run.py, dockers/, scripts/, tests/, and logs/
  • Optional PostgreSQL + SQLAlchemy + Alembic
  • Optional JWT auth service with password hashing and demo user bootstrap
  • Optional Redis cache skeleton
  • Optional Celery + RabbitMQ skeleton
  • Optional Docker and CI templates
  • uv-managed pyproject.toml, uv.lock, and .venv

Development

uv run python -m pytest

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

inifastapi-0.1.1.tar.gz (27.2 kB view details)

Uploaded Source

Built Distribution

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

inifastapi-0.1.1-py3-none-any.whl (36.0 kB view details)

Uploaded Python 3

File details

Details for the file inifastapi-0.1.1.tar.gz.

File metadata

  • Download URL: inifastapi-0.1.1.tar.gz
  • Upload date:
  • Size: 27.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for inifastapi-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f701cc35cf3c68e7975fb1c0745ebf3fa46b25b571f858b709bd6a688a07c6d6
MD5 bac90c57cb903587642aae60dab422b8
BLAKE2b-256 279e14dcef818dbb5aeb75f4116426c99cd80735b588703c2fa79861b0f07c1c

See more details on using hashes here.

File details

Details for the file inifastapi-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for inifastapi-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b21abc143399f45d2098198fa34a129c3cf1a0cc453cfc2f7314f075b0e8ce7d
MD5 a7ea25c9c02e24c1761169f828254de8
BLAKE2b-256 9e58cac6fc9f630cf391c86212aa91c07bffea2500084ccfc942dfde23e5eac5

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