Metadata-Version: 2.4
Name: api-project-starter-kit
Version: 1.0.0
Summary: Interactive Python CLI that generates production-ready backend boilerplates (FastAPI, Flask, Django).
Author-email: 0x1vasu <0x1vasu@users.noreply.github.com>
Maintainer-email: 0x1vasu <0x1vasu@users.noreply.github.com>
License: MIT License
        
        Copyright (c) 2026 0x1vasu
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/0x1vasu/api-project-starter-kit
Project-URL: Repository, https://github.com/0x1vasu/api-project-starter-kit
Project-URL: Issues, https://github.com/0x1vasu/api-project-starter-kit/issues
Project-URL: Changelog, https://github.com/0x1vasu/api-project-starter-kit/releases
Keywords: fastapi,flask,django,boilerplate,scaffold,generator,cli,starter-kit
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer>=0.12.5
Requires-Dist: rich>=13.9.0
Requires-Dist: questionary>=2.0.1
Requires-Dist: Jinja2>=3.1.4
Requires-Dist: PyYAML>=6.0.2
Provides-Extra: dev
Requires-Dist: pytest>=8.3.0; extra == "dev"
Requires-Dist: ruff>=0.8.0; extra == "dev"
Requires-Dist: build>=1.2.0; extra == "dev"
Requires-Dist: twine>=5.1.0; extra == "dev"
Dynamic: license-file

# API Project Starter Kit

Interactive **Python CLI** that generates production-ready backend boilerplates for **FastAPI**, **Flask**, and **Django**.

Templates are written in **Jinja2** — extend them without touching generator logic.

## Features

- One-question-at-a-time interactive flow (Questionary + Rich)
- Frameworks: FastAPI · Flask · Django
- Databases: PostgreSQL · MySQL · SQLite · MongoDB · None
- ORMs filtered by framework
- Background jobs: Celery · RQ · Dramatiq · APScheduler (+ Redis / RabbitMQ / Kafka)
- Auth: JWT · OAuth · API Key
- REST or GraphQL
- Docker + docker-compose
- Pytest / Unittest samples
- Ruff · Black · Mypy · pre-commit
- GitHub Actions CI
- Structlog / Loguru / stdlib logging
- CRUD module scaffolding (Users, Products, Orders, …)

## Install

```bash
pip install api-project-starter-kit
```

From source (editable):

```bash
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
```

## Usage

```bash
api-starter

# Or as a module
python -m api_starter

# Custom output directory
api-starter --output ~/projects
```

Answer the prompts, confirm the summary, and a complete project is written to disk.

## Layout

```
api_starter/
├── cli.py                 # Typer entry point
├── generator.py           # Façade
├── prompts.py             # Interactive questions
├── config.py              # Dataclasses & enums
├── validators.py          # Input validation
├── template_engine.py     # Jinja2 wrapper
├── template_registry.py   # Config → template map
├── project_builder.py     # Render + write files
├── filesystem.py          # Path helpers
├── utils/
└── templates/
    ├── fastapi/
    ├── flask/
    ├── django/
    └── shared/            # Docker, CI, jobs, modules, quality
```

## Extending templates

1. Add a `.j2` file under `api_starter/templates/<framework>/` or `shared/`.
2. Register it in `template_registry.py` (`TemplateMapping`).
3. Use context keys from `ProjectConfig.to_template_context()` (`project_name`, `package_name`, `has_database`, `modules_meta`, …).

## Programmatic use

```python
from api_starter.config import (
    Framework, Database, ORM, BackgroundJobs, Authentication,
    APIType, TestingFramework, LoggingLibrary, ProjectConfig,
)
from api_starter.generator import Generator

config = ProjectConfig(
    project_name="demo-api",
    framework=Framework.FASTAPI,
    database=Database.SQLITE,
    orm=ORM.SQLALCHEMY,
    background_jobs=BackgroundJobs.NO,
    authentication=Authentication.JWT,
    api_type=APIType.REST,
    docker=True,
    testing=TestingFramework.PYTEST,
    logging=LoggingLibrary.STRUCTLOG,
    github_actions=True,
    output_dir=".",
)

Generator().generate(config)
```

## Publishing to PyPI

```bash
pip install -e ".[dev]"
python -m build
twine check dist/*
# TestPyPI first (recommended)
twine upload --repository testpypi dist/*
# Then production PyPI
twine upload dist/*
```

Create an API token at https://pypi.org/manage/account/token/ and use:
- Username: `__token__`
- Password: `pypi-...` (your token)
