Decision-guided scaffolding for Python backends and CLI tools.
pymyway asks a few questions, recommends a framework with a visible reason, and generates a runnable, production-grade project — uv-managed, ruff-linted, pytest-tested, with optional Docker and GitHub Actions CI.
The "create-t3-app for Python" — the recommendation is traceable, not a black box.
uvx pymyway
# or
pipx run pymywayuv run pymywayThat starts the interactive flow:
- What type of service? — CLI tool | Web service / API
- Project name?
- Branch into the matching pipeline:
- CLI → complexity / audience / dev style / distribution → argparse | Click | Typer
- Web → shape / scale / async / admin → FastAPI | Django | Flask | Litestar
- Tooling toggles — Dockerfile + GitHub Actions CI
- AI packages (optional) — pick LangChain, LangGraph, LiteLLM (or skip); a rationale panel is shown for each selection
Drive everything from flags (no prompts):
# CLI -> Typer, with CI on, Docker off
uvx pymyway --ci --service cli --project-name my-tool \
--complexity subcommands --audience public --dev-style type_hints --distribution has_python
# Web -> FastAPI, production, Postgres, Docker + CI
uvx pymyway --ci --service web --project-name my-api \
--shape pure_api --scale production --async-need yes --admin-need no \
--docker yes --ci-toggle yesWith AI packages (rationale shown on stdout):
uvx pymyway --ci --service cli --project-name ai-tool \
--complexity subcommands --audience public --dev-style type_hints --distribution has_python \
--ai-packages langchain,langgraph,litellmChoose Litestar by picking microservice + async → yes:
uvx pymyway --ci --service web --project-name svc --shape microservice \
--scale production --async-need yes --admin-need noFlag reference: pymyway --help.
Every generated project:
pyproject.toml(PEP 621,uv-managed)rufflint + format configpytestwith a working example test.gitignore,README.mdwith setup instructions- Optional
Dockerfile(multi-stage, uv-based) - Optional
.github/workflows/ci.yml(uv + ruff + pytest)
| Framework | Why it gets recommended |
|---|---|
argparse |
Single-command, just-me, zero-dep script |
Click |
Nested commands / public distribution; polished help pages |
Typer |
Type-hint-driven, modern DX, minimal boilerplate |
Optional: rich for output, PyInstaller for standalone binary distribution.
| Framework | Why it gets recommended |
|---|---|
FastAPI |
Async-first, auto OpenAPI docs, high-concurrency APIs |
Django |
Full-stack + admin panel; batteries-included ORM/auth/migrations |
Flask |
Minimal, flexible, low ceremony — hobby/small pure-API |
Litestar |
Async microservice with strong DI and strict typing — structured service boundaries |
Each web scaffold auto-derives a sensible supporting stack (DB, ORM, migrations, auth), and adds a docker-compose.yml when Postgres is selected.
When selected, an ai_pkg/ subpackage is added under src/<package>/. Three options:
| Package | When to pick |
|---|---|
langchain |
LLM chains, RAG, tool-using agents — the composable building blocks |
langgraph |
Fine-grained stateful agent graphs: cycles, branches, human-in-the-loop |
litellm |
One unified complete(...) across 100+ providers — when you want provider switching without the LangChain abstractions |
All AI tests are monkeypatched — they run offline without API keys. The generated ai_pkg/__init__.py exposed one function per selected package (langchain_ask, langgraph_run, litellm_complete) so the rest of the codebase talks to one small replaceable surface.
- uv — packaging, env, distribution
- Typer — CLI (dogfooding)
- Questionary — interactive prompts
- Rich — terminal output
- Jinja2 — templating (templates ship in
src/pymyway/templates/) - Ruff + pytest — lint and tests
uv sync
uv run pytest
uv run ruff checkMIT