Skip to content

Python FastAPI generator #36

@mathieusouflis

Description

@mathieusouflis

Problem statement

Python developers using FastAPI have no dot support. Setting up a FastAPI project with the right structure, typing, linting (ruff), and architecture pattern is repetitive work.

Proposed solution

Implement PythonFastAPIGenerator in generators/python/fastapi.go.

  • Name(): "python-fastapi"
  • Language(): "python"
  • Modules(): ["fastapi"]

Apply() generates:

  • pyproject.toml (or requirements.txt) with FastAPI + uvicorn
  • main.py — FastAPI app entry point
  • File structure varies by spec.Config.Architecture
  • .python-version for pyenv users

Commands: new route <name>, new schema <name>, new dependency <name>

Alternatives considered

Use cookiecutter templates. Rejected — same reason as NestJS: dot generates from code, not external tools.

Area

Core

Additional context

Uses static composition with Python architecture generators. Depends on: Python architecture generators.
Note: this is dot's first Python generator. It establishes the generators/python/ package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions