# rsb-23/yuhi architecture

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

- Interactive diagram: https://gitdiagram.com/rsb-23/yuhi
- Repository: https://github.com/rsb-23/yuhi

## Overview

Yuhi is a Python CLI for enhancing a project with configuration and repository files, plus scanning requirements for problematic PyPI packages. The main workflow is CLI command dispatch into add/create facets, which inspect or write project files using shared helpers; separate commands can create samples or run the package scan. The graph also preserves code-quality, repository, and project facets, and the PyPI lookup path. Some facet implementations and service details are not excerpted, so their internal links are omitted where the supplied evidence does not show them.

Main entry points: [`src/facets/repository.py`](https://github.com/rsb-23/yuhi/blob/main/src/facets/repository.py) (Repository files), [`src/helper/file_handler.py`](https://github.com/rsb-23/yuhi/blob/main/src/helper/file_handler.py) (Project file I/O), [`src/cli.py`](https://github.com/rsb-23/yuhi/blob/main/src/cli.py) (CLI entry), [`src/commands.py`](https://github.com/rsb-23/yuhi/blob/main/src/commands.py) (Command groups)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI"]
  node_cli["CLI entry<br/>[cli.py]"]
  node_commands["Command groups<br/>[commands.py]"]
  node_glossary["Help formatting<br/>[glossary.py]"]
  node_version["Version metadata<br/>[__about__.py]"]
end

subgraph group_facets["Project facets"]
  node_facet_registry["Facet registry<br/>[__init__.py]"]
  node_code_quality["Code quality<br/>[code_quality.py]"]
  node_pylint["Pylint setup<br/>[pylint_handler.py]"]
  node_pkg_install["Package installation<br/>[pkg_install.py]"]
  node_repository["Repository files<br/>[repository.py]"]
  node_project["Project setup<br/>[project.py]"]
end

subgraph group_scan["Package scanning"]
  node_scanner["Dependency scanner<br/>[scanner.py]"]
  node_package_service["Package HTTP client<br/>[package.py]"]
end

subgraph group_core["Shared services"]
  node_file_handler["Project file I/O<br/>[file_handler.py]"]
  node_path_helper["Colored paths<br/>[color_path.py]"]
  node_constants["File constants<br/>[constants.py]"]
  node_utils["Shared utilities<br/>[utils.py]"]
  node_github_service["GitHub licenses<br/>[github.py]"]
  node_local_info["Local Git info<br/>[local_info.py]"]
end

node_user(("CLI user"))
node_pypi(("PyPI"))
node_github(("GitHub API"))
node_filesystem[("Project filesystem")]

node_user -->|"invokes"| node_cli
node_cli -->|"registers"| node_commands
node_cli -->|"formats help"| node_glossary
node_cli -->|"reads version"| node_version
node_commands -->|"registers facets"| node_facet_registry
node_commands -->|"runs scan"| node_scanner
node_commands -->|"creates samples"| node_file_handler
node_facet_registry -->|"exports"| node_code_quality
node_facet_registry -->|"exports"| node_repository
node_facet_registry -->|"exports"| node_project
node_code_quality -->|"reads and writes"| node_file_handler
node_code_quality -->|"generates config"| node_pylint
node_pylint -->|"runs in venv"| node_pkg_install
node_repository -->|"creates files"| node_file_handler
node_repository -->|"uses file paths"| node_constants
node_repository -->|"fetches licenses"| node_github_service
node_repository -->|"gets Git user"| node_local_info
node_github_service -->|"requests licenses"| node_github
node_scanner -->|"fetches package data"| node_package_service
node_package_service -->|"requests metadata"| node_pypi
node_file_handler -->|"uses paths"| node_path_helper
node_file_handler -->|"reads and writes"| node_filesystem
node_code_quality -->|"uses templates"| node_constants

click node_cli "https://github.com/rsb-23/yuhi/blob/main/src/cli.py"
click node_commands "https://github.com/rsb-23/yuhi/blob/main/src/commands.py"
click node_glossary "https://github.com/rsb-23/yuhi/blob/main/src/glossary.py"
click node_version "https://github.com/rsb-23/yuhi/blob/main/src/__about__.py"
click node_facet_registry "https://github.com/rsb-23/yuhi/blob/main/src/facets/__init__.py"
click node_code_quality "https://github.com/rsb-23/yuhi/blob/main/src/facets/code_quality.py"
click node_pylint "https://github.com/rsb-23/yuhi/blob/main/src/facets/pylint_handler.py"
click node_pkg_install "https://github.com/rsb-23/yuhi/blob/main/src/facets/pkg_install.py"
click node_repository "https://github.com/rsb-23/yuhi/blob/main/src/facets/repository.py"
click node_project "https://github.com/rsb-23/yuhi/blob/main/src/facets/project.py"
click node_scanner "https://github.com/rsb-23/yuhi/blob/main/src/facets/scanner.py"
click node_package_service "https://github.com/rsb-23/yuhi/blob/main/src/services/package.py"
click node_file_handler "https://github.com/rsb-23/yuhi/blob/main/src/helper/file_handler.py"
click node_path_helper "https://github.com/rsb-23/yuhi/blob/main/src/helper/color_path.py"
click node_constants "https://github.com/rsb-23/yuhi/blob/main/src/helper/constants.py"
click node_utils "https://github.com/rsb-23/yuhi/blob/main/src/helper/utils.py"
click node_github_service "https://github.com/rsb-23/yuhi/blob/main/src/services/github.py"
click node_local_info "https://github.com/rsb-23/yuhi/blob/main/src/services/local_info.py"

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_cli,node_commands,node_glossary,node_version,node_user toneBlue
class node_facet_registry,node_code_quality,node_pylint,node_pkg_install,node_repository,node_project,node_filesystem toneAmber
class node_scanner,node_package_service,node_github toneMint
class node_file_handler,node_path_helper,node_constants,node_utils,node_github_service,node_local_info toneRose
class node_pypi toneIndigo
```

## Components

### CLI

- [CLI entry](https://github.com/rsb-23/yuhi/blob/main/src/cli.py): `src/cli.py`
- [Command groups](https://github.com/rsb-23/yuhi/blob/main/src/commands.py): `src/commands.py`
- [Help formatting](https://github.com/rsb-23/yuhi/blob/main/src/glossary.py): `src/glossary.py`
- [Version metadata](https://github.com/rsb-23/yuhi/blob/main/src/__about__.py): `src/__about__.py`

### Project facets

- [Facet registry](https://github.com/rsb-23/yuhi/blob/main/src/facets/__init__.py): `src/facets/__init__.py`
- [Code quality](https://github.com/rsb-23/yuhi/blob/main/src/facets/code_quality.py): `src/facets/code_quality.py`
- [Pylint setup](https://github.com/rsb-23/yuhi/blob/main/src/facets/pylint_handler.py): `src/facets/pylint_handler.py`
- [Package installation](https://github.com/rsb-23/yuhi/blob/main/src/facets/pkg_install.py): `src/facets/pkg_install.py`
- [Repository files](https://github.com/rsb-23/yuhi/blob/main/src/facets/repository.py): `src/facets/repository.py`
- [Project setup](https://github.com/rsb-23/yuhi/blob/main/src/facets/project.py): `src/facets/project.py`

### Package scanning

- [Dependency scanner](https://github.com/rsb-23/yuhi/blob/main/src/facets/scanner.py): `src/facets/scanner.py`
- [Package HTTP client](https://github.com/rsb-23/yuhi/blob/main/src/services/package.py): `src/services/package.py`

### Shared services

- [Project file I/O](https://github.com/rsb-23/yuhi/blob/main/src/helper/file_handler.py): `src/helper/file_handler.py`
- [Colored paths](https://github.com/rsb-23/yuhi/blob/main/src/helper/color_path.py): `src/helper/color_path.py`
- [File constants](https://github.com/rsb-23/yuhi/blob/main/src/helper/constants.py): `src/helper/constants.py`
- [Shared utilities](https://github.com/rsb-23/yuhi/blob/main/src/helper/utils.py): `src/helper/utils.py`
- [GitHub licenses](https://github.com/rsb-23/yuhi/blob/main/src/services/github.py): `src/services/github.py`
- [Local Git info](https://github.com/rsb-23/yuhi/blob/main/src/services/local_info.py): `src/services/local_info.py`

### Other components

- **CLI user**
- **PyPI**
- **GitHub API**
- **Project filesystem**

## Connections

- CLI user → CLI entry: invokes (evidence: `src/cli.py`)
- CLI entry → Command groups: registers (evidence: `src/cli.py`)
- CLI entry → Help formatting: formats help (evidence: `src/cli.py`)
- CLI entry → Version metadata: reads version (evidence: `src/cli.py`)
- Command groups → Facet registry: registers facets (evidence: `src/commands.py`)
- Command groups → Dependency scanner: runs scan (evidence: `src/commands.py`)
- Command groups → Project file I/O: creates samples (evidence: `src/commands.py`)
- Facet registry → Code quality: exports (evidence: `src/facets/__init__.py`)
- Facet registry → Repository files: exports (evidence: `src/facets/__init__.py`)
- Facet registry → Project setup: exports (evidence: `src/facets/__init__.py`)
- Code quality → Project file I/O: reads and writes (evidence: `src/facets/code_quality.py`)
- Code quality → Pylint setup: generates config (evidence: `src/facets/code_quality.py`)
- Pylint setup → Package installation: runs in venv (evidence: `src/facets/pylint_handler.py`)
- Repository files → Project file I/O: creates files (evidence: `src/facets/repository.py`)
- Repository files → File constants: uses file paths (evidence: `src/facets/repository.py`)
- Repository files → GitHub licenses: fetches licenses (evidence: `src/facets/repository.py`)
- Repository files → Local Git info: gets Git user (evidence: `src/facets/repository.py`)
- GitHub licenses → GitHub API: requests licenses (evidence: `src/services/github.py`)
- Dependency scanner → Package HTTP client: fetches package data (evidence: `src/facets/scanner.py`)
- Package HTTP client → PyPI: requests metadata
- Project file I/O → Colored paths: uses paths (evidence: `src/helper/file_handler.py`)
- Project file I/O → Project filesystem: reads and writes (evidence: `src/helper/file_handler.py`)
- Code quality → File constants: uses templates (evidence: `src/facets/code_quality.py`)
