fastapi-scaffold
fastapi-scaffold is a CLI tool that generates a scalable FastAPI project template with advanced features including authentication, machine learning endpoints, background tasks, caching, rate limiting, and more.
Installation
Install the CLI tool via pip:
pip install fastapi-scaffold
Usage
Create a New FastAPI Project
To create a new project, run:
fastapi-scaffold create my_project
This command generates a new project with optional features:
--ml→ Includes machine learning endpoints and model setup.--db→ Adds database configuration and ORM setup.--auth→ Includes authentication endpoints.--docker→ Generates Dockerfile and docker-compose.yml for container support.
Example:
fastapi-scaffold create my_project --ml --db --auth --docker
Install Project Dependencies
After generating your project, navigate into the project directory and install dependencies:
fastapi-scaffold install
Alternatively, run:
pip install -r requirements.txt
Delete an Existing Project
To delete a project directory, use:
fastapi-scaffold delete my_project
Project Structure
A generated project will have the following structure:
my_project/
├── app/
│ ├── api/
│ │ ├── __init__.py
│ │ ├── users.py
│ │ ├── items.py
│ │ ├── admin.py
│ │ ├── ml.py
│ │ └── health.py
│ ├── schemas/
│ │ ├── __init__.py
│ │ ├── user.py
│ │ ├── item.py
│ │ ├── ml.py
│ │ └── stats.py
│ ├── models/
│ │ ├── __init__.py
│ │ ├── user.py
│ │ ├── item.py
│ │ └── ml_model.pkl
│ ├── crud/
│ │ ├── __init__.py
│ │ ├── user.py
│ │ ├── item.py
│ │ └── stats.py
│ ├── services/
│ │ ├── __init__.py
│ │ ├── auth.py
│ │ ├── tasks.py
│ │ └── ml.py
│ ├── utils/
│ │ ├── __init__.py
│ │ ├── dependencies.py
│ │ ├── cache.py
│ │ └── rate_limit.py
│ ├── middleware.py
│ ├── database.py
│ ├── auth.py
│ ├── logger.py
│ ├── config.py
│ └── main.py
├── tests/
│ ├── test_main.py
│ └── test_users.py
├── .env
├── requirements.txt
├── Dockerfile
├── docker-compose.yml
└── README.md
Running the Project
- Navigate to the project directory:
cd my_project
- Install dependencies:
pip install -r requirements.txt
- Start the FastAPI server:
uvicorn app.main:app --reload
The API will be available at http://127.0.0.1:8000.
Contributing
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Metadata
Release files for fastapi-scaffold 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fastapi_scaffold-0.2.1.tar.gz | 11.3 kB | Without provenance | Details for fastapi_scaffold-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fastapi_scaffold-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for fastapi_scaffold-0.2.1-py3-none-any.whl |
Total release size: 22.0 kB
Release files / fastapi_scaffold-0.2.1.tar.gz
| Download URL | fastapi_scaffold-0.2.1.tar.gz |
|---|---|
| Size | 11.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
29029a59f9f855b0bad1761caf82b68e1de2cb312868b14d7fa1a640f093c84f
|
|
BLAKE2b-256 checksum How to use checksums |
064467ca44dfe442fbaff4c649091fc9e9be46395e3bf62153184c6e7c3609b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.10
|
Release files / fastapi_scaffold-0.2.1-py3-none-any.whl
| Download URL | fastapi_scaffold-0.2.1-py3-none-any.whl |
|---|---|
| Size | 10.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d41e5538ffbf5f62d2241e93bff2b555d126f1468b1ce781564e7b0b692503c1
|
|
BLAKE2b-256 checksum How to use checksums |
5b7547fbeafb9c4633f8337c56548984d55b503d7fd57c95d70bab3dc8b69b91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.10
|
Security for fastapi-scaffold 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.