A simple CLI tool to generate FastAPI starter projects with a modular structure.
Project description
mkf
A simple CLI tool to generate FastAPI starter projects with a modular structure.
Installation
Install via pip:
pip install mkf
Or install from source:
-
Clone this repository:
git clone <repo_url> cd mkf
-
Install the package:
pip install .
Usage
mkf <project_name>
Replace <project_name> with the name of your new FastAPI project.
What it does
- Creates a directory with the project name
- Generates a modular folder structure for FastAPI
- Adds base files including main.py, models, schemas, etc.
- Sets up a Python virtual environment
- Installs FastAPI and Uvicorn
- Generates requirements.txt
- Initializes a Git repository with an initial commit
Requirements
- Python 3.x
- pip
- git
Example
./mkf my_fastapi_app
cd my_fastapi_app
source .venv/bin/activate
uvicorn app.main:app --reload
Visit http://localhost:8000/docs to see the interactive API documentation.
Project Structure
The generated project has the following structure:
project_name/
├── app/
│ ├── api/
│ │ ├── __init__.py
│ │ └── routes.py
│ ├── core/
│ │ ├── __init__.py
│ │ └── config.py
│ ├── db/
│ │ ├── __init__.py
│ │ └── database.py
│ ├── models/
│ │ ├── __init__.py
│ │ └── user.py
│ ├── schemas/
│ │ ├── __init__.py
│ │ └── user.py
│ └── main.py
├── tests/
│ └── test_main.py
├── .venv/ # Virtual environment
├── requirements.txt
├── README.md
└── .git/ # Git repository
License
MIT
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 mkf-0.3.0.tar.gz.
File metadata
- Download URL: mkf-0.3.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53b3931378b6480dee52196bd069c9835b50338e9486a74cf9d2611c0448fc86
|
|
| MD5 |
63efebc565592994833fa06e112648fb
|
|
| BLAKE2b-256 |
e920c3ba9ae3ef7a83690467a0570963b6b11e91e04880246709705f8019381a
|
File details
Details for the file mkf-0.3.0-py3-none-any.whl.
File metadata
- Download URL: mkf-0.3.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64ee318a473b8ece84c6360e70a2eef5e9f3f0e905f84b275623d0e780818930
|
|
| MD5 |
b4acab3953160d12c22a88b15b273535
|
|
| BLAKE2b-256 |
894001148deb3b169fd70ab6200878ef6172f6ca01527c3f88b06014f8f335c2
|