# omardev29/py_template architecture

> Architecture diagram of the GitHub repository omardev29/py_template, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/omardev29/py_template
- Repository: https://github.com/omardev29/py_template

## Overview

py_template is a uv-based Python application template and command runner. Its main workflow is to create a project from a preset, configure its environments and generated files, run or test it on supported backends, and package it with a selected build method. The README documents these capabilities, but most runner implementation was not sampled, so the graph shows documented workflows at subsystem level and omits uncertain internal call wiring.

Main entry points: [`.pytemplate/runner/cli.py`](https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/cli.py) (Command runner), [`.pytemplate/runner/cmd_apply.py`](https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/cmd_apply.py) (Project creation), [`.pytemplate/runner/cmd_env.py`](https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/cmd_env.py) (Environment setup), [`.pytemplate/runner/cmd_build.py`](https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/cmd_build.py) (Build command)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Runner entry"]
  node_pyt["pyt launcher"]
  node_cli["Command runner<br/>[cli.py]"]
end

subgraph group_project["Project setup"]
  node_config["Project config<br/>[config.py]"]
  node_presets["Project presets<br/>[presets.py]"]
  node_apply["Project creation<br/>[cmd_apply.py]"]
  node_render["Generated files<br/>[render.py]"]
  node_template_presets["Preset templates<br/>[presets]"]
end

subgraph group_execution["Backends and builds"]
  node_env["Environment setup<br/>[cmd_env.py]"]
  node_envs["Backend environments<br/>[envs.py]"]
  node_mode["Backend selection<br/>[cmd_mode.py]"]
  node_dev["Run and test<br/>[cmd_dev.py]"]
  node_build["Build command<br/>[cmd_build.py]"]
  node_methods["Packaging methods<br/>[methods]"]
end

subgraph group_integration["Editor integration"]
  node_nvim["Neovim integration<br/>[nvim.py]"]
  node_vscode["VS Code integration<br/>[vscode.py]"]
  node_nvim_plugin["Neovim plugin<br/>[init.lua]"]
end

node_user(("Project user"))
node_uv["uv"]

node_user -->|"invokes"| node_pyt
node_pyt -->|"starts"| node_cli
node_cli -->|"dispatches"| node_apply
node_cli -->|"dispatches"| node_env
node_cli -->|"dispatches"| node_mode
node_cli -->|"dispatches"| node_dev
node_cli -->|"dispatches"| node_build
node_apply -->|"selects"| node_presets
node_apply -->|"copies"| node_template_presets
node_apply -->|"generates"| node_render
node_env -->|"configures"| node_envs
node_env -->|"uses"| node_uv
node_mode -->|"updates"| node_config
node_dev -->|"runs on"| node_envs
node_build -->|"packages with"| node_methods
node_build -->|"uses"| node_envs
node_nvim -->|"reads"| node_config
node_vscode -->|"reads"| node_config
node_nvim_plugin -->|"launches"| node_pyt

click node_cli "https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/cli.py"
click node_config "https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/config.py"
click node_presets "https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/presets.py"
click node_apply "https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/cmd_apply.py"
click node_render "https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/render.py"
click node_env "https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/cmd_env.py"
click node_envs "https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/envs.py"
click node_mode "https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/cmd_mode.py"
click node_dev "https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/cmd_dev.py"
click node_build "https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/cmd_build.py"
click node_methods "https://github.com/omardev29/py_template/tree/main/.pytemplate/runner/methods"
click node_nvim "https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/editors/nvim.py"
click node_vscode "https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/editors/vscode.py"
click node_nvim_plugin "https://github.com/omardev29/py_template/blob/main/.pytemplate/nvim/lua/pytemplate/init.lua"
click node_template_presets "https://github.com/omardev29/py_template/tree/main/.pytemplate/presets"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_pyt,node_cli,node_user toneBlue
class node_config,node_presets,node_apply,node_render,node_template_presets toneAmber
class node_env,node_envs,node_mode,node_dev,node_build,node_methods toneMint
class node_nvim,node_vscode,node_nvim_plugin toneRose
class node_uv toneIndigo
```

## Components

### Runner entry

- **pyt launcher**
- [Command runner](https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/cli.py): `.pytemplate/runner/cli.py`

### Project setup

- [Project config](https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/config.py): `.pytemplate/runner/config.py`
- [Project presets](https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/presets.py): `.pytemplate/runner/presets.py`
- [Project creation](https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/cmd_apply.py): `.pytemplate/runner/cmd_apply.py`
- [Generated files](https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/render.py): `.pytemplate/runner/render.py`
- [Preset templates](https://github.com/omardev29/py_template/tree/main/.pytemplate/presets): `.pytemplate/presets`

### Backends and builds

- [Environment setup](https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/cmd_env.py): `.pytemplate/runner/cmd_env.py`
- [Backend environments](https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/envs.py): `.pytemplate/runner/envs.py`
- [Backend selection](https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/cmd_mode.py): `.pytemplate/runner/cmd_mode.py`
- [Run and test](https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/cmd_dev.py): `.pytemplate/runner/cmd_dev.py`
- [Build command](https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/cmd_build.py): `.pytemplate/runner/cmd_build.py`
- [Packaging methods](https://github.com/omardev29/py_template/tree/main/.pytemplate/runner/methods): `.pytemplate/runner/methods`

### Editor integration

- [Neovim integration](https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/editors/nvim.py): `.pytemplate/runner/editors/nvim.py`
- [VS Code integration](https://github.com/omardev29/py_template/blob/main/.pytemplate/runner/editors/vscode.py): `.pytemplate/runner/editors/vscode.py`
- [Neovim plugin](https://github.com/omardev29/py_template/blob/main/.pytemplate/nvim/lua/pytemplate/init.lua): `.pytemplate/nvim/lua/pytemplate/init.lua`

### Other components

- **Project user**
- **uv**

## Connections

- Project user → pyt launcher: invokes
- pyt launcher → Command runner: starts
- Command runner → Project creation: dispatches
- Command runner → Environment setup: dispatches
- Command runner → Backend selection: dispatches
- Command runner → Run and test: dispatches
- Command runner → Build command: dispatches
- Project creation → Project presets: selects
- Project creation → Preset templates: copies
- Project creation → Generated files: generates
- Environment setup → Backend environments: configures
- Environment setup → uv: uses
- Backend selection → Project config: updates
- Run and test → Backend environments: runs on
- Build command → Packaging methods: packages with
- Build command → Backend environments: uses
- Neovim integration → Project config: reads
- VS Code integration → Project config: reads
- Neovim plugin → pyt launcher: launches
