$ show tedivm/robs_awesome_python_template
This is a comprehensive Cookiecutter template for generating production-ready Python projects. It is not a running application itself but a project generator that produces applications, libraries, or services based on user-selected features. The template includes sophisticated post-generation hooks that surgically remove unused files and configure dependencies, Docker Compose services, CI/CD workflows, and documentation based on the chosen options. It enforces modern Python practices: uv for package management, Ruff for linting/formatting, mypy for type checking, pytest for testing, and Pydantic Settings for configuration. The generated projects can include FastAPI, Celery, SQLAlchemy, QuasiQueue, aiocache, Jinja2, Typer CLI, Docker, and GitHub Actions. The template itself demonstrates high craftsmanship with clean Jinja2 templating, conditional logic, and a well-organized file structure. It is actively maintained and uses current tooling (uv, Ruff, etc.), indicating low technical drift.
The LLM identified 5 files worth highlighting for reuse:
A sophisticated post-generation hook that conditionally removes files and directories based on user-selected features. It uses sets of paths to delete, checks for empty directories, and runs make commands to set up the environment. This pattern is reusable for any Cookiecutter template that needs to clean up unused boilerplate and run setup commands after generation.
Implements a NoOpCache class that extends aiocache's BaseCache to provide a transparent no-operation cache backend. When caching is disabled, all cache operations (get, set, delete, clear) become no-ops without requiring conditional logic in application code. This is a clean implementation of the Null Object pattern and is reusable in any async Python project that needs a graceful cache disable mechanism.
Provides a `syncify` decorator that converts async functions to synchronous ones, enabling Typer CLI commands to use async/await internally. The decorator uses `asyncio.run()` and preserves function metadata via `functools.wraps`. This is a simple, reusable pattern for any CLI framework that doesn't natively support async, allowing developers to write async CLI commands without boilerplate.
Contains reusable pytest fixtures for database testing (in-memory SQLite with async engine) and FastAPI test client setup with dependency overrides. The `db_session_maker` fixture creates a fresh database per test, and `fastapi_client` wires in the test database via FastAPI's dependency override system. This pattern is directly reusable in any async SQLAlchemy + FastAPI project for isolated, fast tests.
Dynamically constructs the Settings class base classes based on enabled features (QuasiQueue, SQLAlchemy, aiocache). Uses Jinja2 to conditionally import and inherit from feature-specific settings classes. This pattern allows clean composition of configuration from multiple sources and is reusable in any project that needs to conditionally include settings from optional dependencies.