Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pymyway

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.

Install

uvx pymyway
# or
pipx run pymyway

Usage

uv run pymyway

That starts the interactive flow:

  1. What type of service? — CLI tool | Web service / API
  2. Project name?
  3. Branch into the matching pipeline:
    • CLI → complexity / audience / dev style / distribution → argparse | Click | Typer
    • Web → shape / scale / async / admin → FastAPI | Django | Flask | Litestar
  4. Tooling toggles — Dockerfile + GitHub Actions CI
  5. AI packages (optional) — pick LangChain, LangGraph, LiteLLM (or skip); a rationale panel is shown for each selection

Non-interactive / CI mode

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 yes

With 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,litellm

Choose Litestar by picking microservice + async → yes:

uvx pymyway --ci --service web --project-name svc --shape microservice \
  --scale production --async-need yes --admin-need no

Flag reference: pymyway --help.

What gets scaffolded

Every generated project:

  • pyproject.toml (PEP 621, uv-managed)
  • ruff lint + format config
  • pytest with a working example test
  • .gitignore, README.md with setup instructions
  • Optional Dockerfile (multi-stage, uv-based)
  • Optional .github/workflows/ci.yml (uv + ruff + pytest)

CLI scaffolds

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.

Web scaffolds

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.

AI packages (optional)

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.

Tech stack (the tool itself)

  • 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

Development

uv sync
uv run pytest
uv run ruff check

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages