fastapi-cli-generator


Namefastapi-cli-generator JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryA command-line tool for generating FastAPI projects with different architectural patterns
upload_time2025-07-11 10:24:12
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords fastapi cli generator scaffold template
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # FastAPI CLI Generator

๐Ÿš€ A command-line tool for quickly creating FastAPI projects with different architectural patterns.

[ไธญๆ–‡ๆ–‡ๆกฃ](README_CN.md)

## Features

- ๐Ÿ—๏ธ **Two Architecture Patterns**: Functional layered vs Modular architecture
- ๐ŸŽฏ **Interactive CLI**: User-friendly Chinese interface
- ๐Ÿ“ **Complete Project Structure**: Templates based on best practices
- โšก **Ready to Use**: Generated projects can run immediately

## Installation

```bash
pip install fastapi-cli-generator
```

Or install from source:

```bash
git clone https://github.com/your-username/fastapi-cli-generator.git
cd fastapi-cli-generator
pip install -e .
```

## Usage

### Basic Usage

```bash
# Create project (interactive mode)
fastapi-create my-project

# Specify template type
fastapi-create my-project --template module
fastapi-create my-project --template function
```

### List Available Templates

```bash
fastapi-create list-templates
```

## Architecture Patterns

### 1. Modular Architecture (module)
Organize code by business domains, each module contains complete MVC structure:

```
my-project/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ core/                 # ๆ ธๅฟƒ้…็ฝฎ
โ”‚   โ”œโ”€โ”€ modules/              # ไธšๅŠกๆจกๅ—
โ”‚   โ”‚   โ”œโ”€โ”€ auth/             # ่ฎค่ฏๆจกๅ—
โ”‚   โ”‚   โ”œโ”€โ”€ users/            # ็”จๆˆท็ฎก็†
โ”‚   โ”‚   โ””โ”€โ”€ items/            # ้กน็›ฎ็ฎก็†
โ”‚   โ””โ”€โ”€ shared/               # ๅ…ฑไบซๅทฅๅ…ท
โ”œโ”€โ”€ tests/                    # ๆต‹่ฏ•ๆ–‡ไปถ
โ””โ”€โ”€ requirements.txt
```

### 2. Functional Layered Architecture (function)
Organize code by technical layers:

```
my-project/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ api/v1/endpoints/     # API็ซฏ็‚น
โ”‚   โ”œโ”€โ”€ core/                 # ๆ ธๅฟƒ้…็ฝฎ
โ”‚   โ”œโ”€โ”€ db/repositories/      # ๆ•ฐๆฎๅบ“ๆ“ไฝœ
โ”‚   โ”œโ”€โ”€ models/               # ๆ•ฐๆฎๆจกๅž‹
โ”‚   โ”œโ”€โ”€ services/             # ไธšๅŠก้€ป่พ‘
โ”‚   โ””โ”€โ”€ utils/                # ๅทฅๅ…ทๅ‡ฝๆ•ฐ
โ”œโ”€โ”€ tests/                    # ๆต‹่ฏ•ๆ–‡ไปถ
โ””โ”€โ”€ requirements.txt
```

## ๅผ€ๅ‘

```bash
# ๅ…‹้š†้กน็›ฎ
git clone <repository-url>
cd fastapi_proj_template

# ๅฎ‰่ฃ…ๅผ€ๅ‘ไพ่ต–
pip install -r requirements-dev.txt

# ๅฎ‰่ฃ…ไธบๅฏ็ผ–่พ‘ๅŒ…
pip install -e .

# ่ฟ่กŒๆต‹่ฏ•
python test_generation.py
```

## ่ฎธๅฏ่ฏ

MIT License

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "fastapi-cli-generator",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "fastapi, cli, generator, scaffold, template",
    "author": null,
    "author_email": "xukache <2416695482@qq.com>",
    "download_url": "https://files.pythonhosted.org/packages/b8/bd/b9c3e8cfccb0afaed1a2f900b2e760a745005f95c972f6ca55c7bc37bd5d/fastapi_cli_generator-0.1.0.tar.gz",
    "platform": null,
    "description": "# FastAPI CLI Generator\r\n\r\n\ud83d\ude80 A command-line tool for quickly creating FastAPI projects with different architectural patterns.\r\n\r\n[\u4e2d\u6587\u6587\u6863](README_CN.md)\r\n\r\n## Features\r\n\r\n- \ud83c\udfd7\ufe0f **Two Architecture Patterns**: Functional layered vs Modular architecture\r\n- \ud83c\udfaf **Interactive CLI**: User-friendly Chinese interface\r\n- \ud83d\udcc1 **Complete Project Structure**: Templates based on best practices\r\n- \u26a1 **Ready to Use**: Generated projects can run immediately\r\n\r\n## Installation\r\n\r\n```bash\r\npip install fastapi-cli-generator\r\n```\r\n\r\nOr install from source:\r\n\r\n```bash\r\ngit clone https://github.com/your-username/fastapi-cli-generator.git\r\ncd fastapi-cli-generator\r\npip install -e .\r\n```\r\n\r\n## Usage\r\n\r\n### Basic Usage\r\n\r\n```bash\r\n# Create project (interactive mode)\r\nfastapi-create my-project\r\n\r\n# Specify template type\r\nfastapi-create my-project --template module\r\nfastapi-create my-project --template function\r\n```\r\n\r\n### List Available Templates\r\n\r\n```bash\r\nfastapi-create list-templates\r\n```\r\n\r\n## Architecture Patterns\r\n\r\n### 1. Modular Architecture (module)\r\nOrganize code by business domains, each module contains complete MVC structure:\r\n\r\n```\r\nmy-project/\r\n\u251c\u2500\u2500 src/\r\n\u2502   \u251c\u2500\u2500 core/                 # \u6838\u5fc3\u914d\u7f6e\r\n\u2502   \u251c\u2500\u2500 modules/              # \u4e1a\u52a1\u6a21\u5757\r\n\u2502   \u2502   \u251c\u2500\u2500 auth/             # \u8ba4\u8bc1\u6a21\u5757\r\n\u2502   \u2502   \u251c\u2500\u2500 users/            # \u7528\u6237\u7ba1\u7406\r\n\u2502   \u2502   \u2514\u2500\u2500 items/            # \u9879\u76ee\u7ba1\u7406\r\n\u2502   \u2514\u2500\u2500 shared/               # \u5171\u4eab\u5de5\u5177\r\n\u251c\u2500\u2500 tests/                    # \u6d4b\u8bd5\u6587\u4ef6\r\n\u2514\u2500\u2500 requirements.txt\r\n```\r\n\r\n### 2. Functional Layered Architecture (function)\r\nOrganize code by technical layers:\r\n\r\n```\r\nmy-project/\r\n\u251c\u2500\u2500 src/\r\n\u2502   \u251c\u2500\u2500 api/v1/endpoints/     # API\u7aef\u70b9\r\n\u2502   \u251c\u2500\u2500 core/                 # \u6838\u5fc3\u914d\u7f6e\r\n\u2502   \u251c\u2500\u2500 db/repositories/      # \u6570\u636e\u5e93\u64cd\u4f5c\r\n\u2502   \u251c\u2500\u2500 models/               # \u6570\u636e\u6a21\u578b\r\n\u2502   \u251c\u2500\u2500 services/             # \u4e1a\u52a1\u903b\u8f91\r\n\u2502   \u2514\u2500\u2500 utils/                # \u5de5\u5177\u51fd\u6570\r\n\u251c\u2500\u2500 tests/                    # \u6d4b\u8bd5\u6587\u4ef6\r\n\u2514\u2500\u2500 requirements.txt\r\n```\r\n\r\n## \u5f00\u53d1\r\n\r\n```bash\r\n# \u514b\u9686\u9879\u76ee\r\ngit clone <repository-url>\r\ncd fastapi_proj_template\r\n\r\n# \u5b89\u88c5\u5f00\u53d1\u4f9d\u8d56\r\npip install -r requirements-dev.txt\r\n\r\n# \u5b89\u88c5\u4e3a\u53ef\u7f16\u8f91\u5305\r\npip install -e .\r\n\r\n# \u8fd0\u884c\u6d4b\u8bd5\r\npython test_generation.py\r\n```\r\n\r\n## \u8bb8\u53ef\u8bc1\r\n\r\nMIT License\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A command-line tool for generating FastAPI projects with different architectural patterns",
    "version": "0.1.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/xukache/fastapi-cli-generator/issues",
        "Documentation": "https://github.com/xukache/fastapi-cli-generator#readme",
        "Homepage": "https://github.com/xukache/fastapi-cli-generator",
        "Repository": "https://github.com/xukache/fastapi-cli-generator"
    },
    "split_keywords": [
        "fastapi",
        " cli",
        " generator",
        " scaffold",
        " template"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5dcf1b9c9a858f7c6865f73f8e6b97fdb07e6e0e6889aa30d6fbbd1d420894d7",
                "md5": "4c0fb1180ce5a3541ce012774cc1d6c8",
                "sha256": "db0057e091d1f2b56fe2c4d1ef6459137dee5e5e4ec1ac407f8a0fe7e626572b"
            },
            "downloads": -1,
            "filename": "fastapi_cli_generator-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4c0fb1180ce5a3541ce012774cc1d6c8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 21658,
            "upload_time": "2025-07-11T10:24:10",
            "upload_time_iso_8601": "2025-07-11T10:24:10.785018Z",
            "url": "https://files.pythonhosted.org/packages/5d/cf/1b9c9a858f7c6865f73f8e6b97fdb07e6e0e6889aa30d6fbbd1d420894d7/fastapi_cli_generator-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b8bdb9c3e8cfccb0afaed1a2f900b2e760a745005f95c972f6ca55c7bc37bd5d",
                "md5": "81443b5aef93cf1384b5baf7e0c9f837",
                "sha256": "7a81341cb89f4321c2aaf9a2f6f237ef3d65f82e47013472a8655c539ddab7be"
            },
            "downloads": -1,
            "filename": "fastapi_cli_generator-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "81443b5aef93cf1384b5baf7e0c9f837",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 14825,
            "upload_time": "2025-07-11T10:24:12",
            "upload_time_iso_8601": "2025-07-11T10:24:12.143725Z",
            "url": "https://files.pythonhosted.org/packages/b8/bd/b9c3e8cfccb0afaed1a2f900b2e760a745005f95c972f6ca55c7bc37bd5d/fastapi_cli_generator-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-11 10:24:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "xukache",
    "github_project": "fastapi-cli-generator",
    "github_not_found": true,
    "lcname": "fastapi-cli-generator"
}
        
Elapsed time: 0.90162s