Skip to main content

fastapi-scaffold

PyPI Version Python Version License

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

  1. Navigate to the project directory:
    cd my_project
    
  2. Install dependencies:
    pip install -r requirements.txt
    
  3. 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)

Source distribution for fastapi-scaffold 0.2.1
File Size Uploaded
fastapi_scaffold-0.2.1.tar.gz 11.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fastapi-scaffold 0.2.1
File Interpreter ABI Platform
fastapi_scaffold-0.2.1-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page