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.2.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.2.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mkf-0.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 210eab2deb1c81d7a226f289c4d09b378ad96b9bcc80eb05ffeae87e3d0c3087
MD5 2799879906bf0332f8baaf111986d4bd
BLAKE2b-256 79b99c7b57a6cc1304912a54eb3b207ef915e4cccf9ed6cf2d9af8b0920a2855

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mkf-0.2.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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 332a1861d9bd8be91d50cefc49b7106af475b50a58f67958cf8ccf13f9199ed8
MD5 60571148c434a8f12d802703d6fafaa2
BLAKE2b-256 5adeadfefb20d602bf516a599ec40107fd5a11e2d7d02b9d9913fb04e14c68ac

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