A CLI tool to scaffold Python API projects following Clean Architecture principles with FastAPI
Project description
API Template PY
A powerful CLI tool to scaffold Python API projects following Clean Architecture principles with FastAPI.
Features
- Clean Architecture: Clear separation of concerns with layered architecture
- FastAPI: Modern, fast, and production-ready web framework
- Complete Project Structure: Pre-configured with all necessary layers
- Interactive CLI: Beautiful terminal UI with prompts and colors
- Dependency Injection: Built-in DI pattern for loose coupling
- Type Hints: Full type safety throughout the codebase
Installation
Using uv (Recommended)
# Install uv if you haven't already
pip install uv
# Run directly with uv (no installation needed)
uv run api-template --version
Using pip
pip install api-template-py
Quick Start
Create a New Project
# Interactive mode
uv run api-template create
# Non-interactive mode
uv run api-template create test-project --non-interactive
Run Your New Project
cd test-project
uv run uvicorn src.main:app --reload
Your API will be available at:
- API: http://localhost:8000
- Interactive Docs: http://localhost:8000/docs
CLI Commands
api-template create
Options:
PROJECT_NAME- Project name (optional, will prompt if not provided)--description, -d- Project description--author, -a- Author name--email, -e- Author email--python-version, -p- Python version (3.10, 3.11, 3.12)--no-git- Skip git initialization--non-interactive- Non-interactive mode
Examples:
# Interactive mode
uv run api-template create
# With project name
uv run api-template create my-api
# Full non-interactive
uv run api-template create my-api \
--description "My API" \
--author "Jane Doe" \
--email "jane@example.com" \
--python-version 3.11 \
--non-interactive
License
MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file api_template_py-0.1.1.post1.tar.gz.
File metadata
- Download URL: api_template_py-0.1.1.post1.tar.gz
- Upload date:
- Size: 18.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10734c46f2ac00c4117357151b5ba27228acad37af235363395051999c8fa30c
|
|
| MD5 |
dbb2257f435bc124816789bb6023e2d2
|
|
| BLAKE2b-256 |
247dd728f14f2d975dcb618d90b80fffad897b0efa01c4c3d3895a4c15a9fcfc
|
Provenance
The following attestation bundles were made for api_template_py-0.1.1.post1.tar.gz:
Publisher:
publish.yml on QuangDiy/api-template-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
api_template_py-0.1.1.post1.tar.gz -
Subject digest:
10734c46f2ac00c4117357151b5ba27228acad37af235363395051999c8fa30c - Sigstore transparency entry: 820903049
- Sigstore integration time:
-
Permalink:
QuangDiy/api-template-py@5976ce5162b6dc11f9cebf50a2e0f7f71faba834 -
Branch / Tag:
refs/tags/v0.1.1.post1 - Owner: https://github.com/QuangDiy
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5976ce5162b6dc11f9cebf50a2e0f7f71faba834 -
Trigger Event:
push
-
Statement type:
File details
Details for the file api_template_py-0.1.1.post1-py3-none-any.whl.
File metadata
- Download URL: api_template_py-0.1.1.post1-py3-none-any.whl
- Upload date:
- Size: 23.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4e867864266c6517427f431eddccecbb2afe3391924c623a09720e75dfd67e0
|
|
| MD5 |
f5d6501704ab1d3d8d6288becee7ff9e
|
|
| BLAKE2b-256 |
c9f386934286aea46f33e9ed9fb0c93af4b9725032c3f6d8b4ce963bb632889b
|
Provenance
The following attestation bundles were made for api_template_py-0.1.1.post1-py3-none-any.whl:
Publisher:
publish.yml on QuangDiy/api-template-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
api_template_py-0.1.1.post1-py3-none-any.whl -
Subject digest:
d4e867864266c6517427f431eddccecbb2afe3391924c623a09720e75dfd67e0 - Sigstore transparency entry: 820903050
- Sigstore integration time:
-
Permalink:
QuangDiy/api-template-py@5976ce5162b6dc11f9cebf50a2e0f7f71faba834 -
Branch / Tag:
refs/tags/v0.1.1.post1 - Owner: https://github.com/QuangDiy
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5976ce5162b6dc11f9cebf50a2e0f7f71faba834 -
Trigger Event:
push
-
Statement type: