Skip to main content

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:

  1. Clone this repository:

    git clone <repo_url>
    cd mkf
    
  2. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkf-0.1.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkf-0.1.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file mkf-0.1.0.tar.gz.

File metadata

  • Download URL: mkf-0.1.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for mkf-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d33eb6a0380ddc32b62fe488f3f9c3a697f3d353fd57d8ce3c632c9a57fd8bd3
MD5 d61d7955f7d48b7580c1dede40ff09bb
BLAKE2b-256 a33a70522bcf3dfdb7c9502e0f61bb7383afe327a294b9d174eb4b45bc668674

See more details on using hashes here.

File details

Details for the file mkf-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mkf-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for mkf-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec3e6a4ac359cf7396e8f57ad5d80ae6f2249fe7dc5f7f7628e94d6dce853785
MD5 31daa0a570a4366c6221a00916f39c9b
BLAKE2b-256 6bbc2845f89ff45f2bbb2089508e289f318940ec012551a2475f571214ff16d5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page