# creeper011/yumly architecture

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

- Interactive diagram: https://gitdiagram.com/creeper011/yumly
- Repository: https://github.com/creeper011/yumly

## Overview

Yumly is a declarative configuration-language implementation and library: callers load text or files, the native engine processes it, and callers receive evaluated configuration data or intermediate tokens/AST. The Python wrapper exposes stage-limited parsing, validation, and dumping; the repository also has Nim, C, and CLI entry points. The README highlights includes, environment variables, optional type hints, and fail-fast validation. Native phase internals and most serializer/API wiring were not excerpted, so those relationships are shown only where documented or marked unverified.

Main entry points: [`src/Yumly/core/pipeline.nim`](https://github.com/creeper011/yumly/blob/main/src/Yumly/core/pipeline.nim) (Pipeline coordinator), [`src/Yumly/libyumly.nim`](https://github.com/creeper011/yumly/blob/main/src/Yumly/libyumly.nim) (Native engine), [`lib/python/yumly/yumly.py`](https://github.com/creeper011/yumly/blob/main/lib/python/yumly/yumly.py) (Python API), [`src/Yumly/phases/includes/loader.nim`](https://github.com/creeper011/yumly/blob/main/src/Yumly/phases/includes/loader.nim) (Include loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["Language interfaces"]
  node_python_api["Python API<br/>[yumly.py]"]
  node_python_bridge["Python AST bridge<br/>[bridge.py]"]
  node_nim_api["Nim API<br/>[api.nim]"]
  node_c_api["C API<br/>[c_api.nim]"]
  node_cli["Yumly CLI<br/>[yumly_cli.nim]"]
end

subgraph group_processing["Configuration processing"]
  node_native["Native engine<br/>[libyumly.nim]"]
  node_pipeline["Pipeline coordinator<br/>[pipeline.nim]"]
  node_tokenizer["Tokenizer<br/>[tokenizer.nim]"]
  node_parser["Parser<br/>[parser.nim]"]
  node_validator["Validation<br/>[validate.nim]"]
  node_evaluator["Evaluator<br/>[evaluator.nim]"]
  node_ast_types["AST and values<br/>[ast.nim]"]
end

subgraph group_resolution["Includes and resolution"]
  node_include_loader["Include loader<br/>[loader.nim]"]
  node_path_resolver["Include paths<br/>[path_resolver.nim]"]
  node_env_loader["Environment loader<br/>[env_loader.nim]"]
  node_resolver["Value resolver<br/>[resolver.nim]"]
end

subgraph group_outputs["Representations and output"]
  node_yumly_encoder["Yumly encoder<br/>[encoder.nim]"]
  node_yumyumy_encoder["Yumyumy encoder"]
  node_json_encoder["JSON encoder<br/>[json_encoder.nim]"]
  node_yaml_encoder["YAML encoder<br/>[yaml_encoder.nim]"]
  node_python_serializer["Python serializer<br/>[parser_python.nim]"]
  node_data_result["Config result"]
end

node_user(("Config author"))

node_user -->|"loads or validates"| node_python_api
node_user -->|"loads config"| node_nim_api
node_python_api -->|"calls native functions"| node_native
node_python_api -->|"maps intermediate results"| node_python_bridge
node_native -.->|"delegates processing"| node_pipeline
node_pipeline -.->|"runs phase"| node_tokenizer
node_pipeline -.->|"runs phase"| node_parser
node_pipeline -.->|"runs phase"| node_validator
node_pipeline -.->|"runs phase"| node_evaluator
node_pipeline -.->|"loads includes"| node_include_loader
node_include_loader -.->|"resolves paths"| node_path_resolver
node_include_loader -.->|"loads environment"| node_env_loader
node_pipeline -.->|"resolves values"| node_resolver
node_parser -.->|"produces syntax tree"| node_ast_types
node_evaluator -.->|"returns evaluated data"| node_data_result
node_nim_api -.->|"runs configuration pipeline"| node_pipeline
node_c_api -.->|"runs configuration pipeline"| node_pipeline
node_cli -.->|"uses language engine"| node_pipeline
node_native -.->|"encodes Yumly"| node_yumly_encoder
node_native -.->|"encodes internal format"| node_yumyumy_encoder
node_native -.->|"encodes JSON"| node_json_encoder
node_native -.->|"encodes YAML"| node_yaml_encoder
node_native -.->|"bridges Python data"| node_python_serializer

click node_python_api "https://github.com/creeper011/yumly/blob/main/lib/python/yumly/yumly.py"
click node_python_bridge "https://github.com/creeper011/yumly/blob/main/lib/python/yumly/bridge.py"
click node_nim_api "https://github.com/creeper011/yumly/blob/main/src/Yumly/api/nim/api.nim"
click node_c_api "https://github.com/creeper011/yumly/blob/main/src/Yumly/api/c/c_api.nim"
click node_cli "https://github.com/creeper011/yumly/blob/main/utils/yumly_cli.nim"
click node_native "https://github.com/creeper011/yumly/blob/main/src/Yumly/libyumly.nim"
click node_pipeline "https://github.com/creeper011/yumly/blob/main/src/Yumly/core/pipeline.nim"
click node_tokenizer "https://github.com/creeper011/yumly/blob/main/src/Yumly/phases/tokenizer/tokenizer.nim"
click node_parser "https://github.com/creeper011/yumly/blob/main/src/Yumly/phases/parser/parser.nim"
click node_validator "https://github.com/creeper011/yumly/blob/main/src/Yumly/phases/validator/validate.nim"
click node_evaluator "https://github.com/creeper011/yumly/blob/main/src/Yumly/phases/evaluator/evaluator.nim"
click node_include_loader "https://github.com/creeper011/yumly/blob/main/src/Yumly/phases/includes/loader.nim"
click node_path_resolver "https://github.com/creeper011/yumly/blob/main/src/Yumly/phases/includes/path_resolver.nim"
click node_env_loader "https://github.com/creeper011/yumly/blob/main/src/Yumly/phases/includes/env_loader.nim"
click node_resolver "https://github.com/creeper011/yumly/blob/main/src/Yumly/phases/resolver/resolver.nim"
click node_ast_types "https://github.com/creeper011/yumly/blob/main/src/Yumly/types/ast.nim"
click node_yumly_encoder "https://github.com/creeper011/yumly/blob/main/src/Yumly/serializers/yumly/encoder.nim"
click node_yumyumy_encoder "https://github.com/creeper011/yumly/blob/main/src/Yumly/serializers/yumyumy/yumyumy_encoder.nim"
click node_json_encoder "https://github.com/creeper011/yumly/blob/main/src/Yumly/serializers/json/json_encoder.nim"
click node_yaml_encoder "https://github.com/creeper011/yumly/blob/main/src/Yumly/serializers/yaml/yaml_encoder.nim"
click node_python_serializer "https://github.com/creeper011/yumly/blob/main/src/Yumly/serializers/python/parser_python.nim"

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_python_api,node_python_bridge,node_nim_api,node_c_api,node_cli toneBlue
class node_native,node_pipeline,node_tokenizer,node_parser,node_validator,node_evaluator,node_ast_types toneAmber
class node_include_loader,node_path_resolver,node_env_loader,node_resolver toneMint
class node_yumly_encoder,node_yumyumy_encoder,node_json_encoder,node_yaml_encoder,node_python_serializer,node_data_result toneRose
class node_user toneIndigo
```

## Components

### Language interfaces

- [Python API](https://github.com/creeper011/yumly/blob/main/lib/python/yumly/yumly.py): `lib/python/yumly/yumly.py`
- [Python AST bridge](https://github.com/creeper011/yumly/blob/main/lib/python/yumly/bridge.py): `lib/python/yumly/bridge.py`
- [Nim API](https://github.com/creeper011/yumly/blob/main/src/Yumly/api/nim/api.nim): `src/Yumly/api/nim/api.nim`
- [C API](https://github.com/creeper011/yumly/blob/main/src/Yumly/api/c/c_api.nim): `src/Yumly/api/c/c_api.nim`
- [Yumly CLI](https://github.com/creeper011/yumly/blob/main/utils/yumly_cli.nim): `utils/yumly_cli.nim`

### Configuration processing

- [Native engine](https://github.com/creeper011/yumly/blob/main/src/Yumly/libyumly.nim): `src/Yumly/libyumly.nim`
- [Pipeline coordinator](https://github.com/creeper011/yumly/blob/main/src/Yumly/core/pipeline.nim): `src/Yumly/core/pipeline.nim`
- [Tokenizer](https://github.com/creeper011/yumly/blob/main/src/Yumly/phases/tokenizer/tokenizer.nim): `src/Yumly/phases/tokenizer/tokenizer.nim`
- [Parser](https://github.com/creeper011/yumly/blob/main/src/Yumly/phases/parser/parser.nim): `src/Yumly/phases/parser/parser.nim`
- [Validation](https://github.com/creeper011/yumly/blob/main/src/Yumly/phases/validator/validate.nim): `src/Yumly/phases/validator/validate.nim`
- [Evaluator](https://github.com/creeper011/yumly/blob/main/src/Yumly/phases/evaluator/evaluator.nim): `src/Yumly/phases/evaluator/evaluator.nim`
- [AST and values](https://github.com/creeper011/yumly/blob/main/src/Yumly/types/ast.nim): `src/Yumly/types/ast.nim`

### Includes and resolution

- [Include loader](https://github.com/creeper011/yumly/blob/main/src/Yumly/phases/includes/loader.nim): `src/Yumly/phases/includes/loader.nim`
- [Include paths](https://github.com/creeper011/yumly/blob/main/src/Yumly/phases/includes/path_resolver.nim): `src/Yumly/phases/includes/path_resolver.nim`
- [Environment loader](https://github.com/creeper011/yumly/blob/main/src/Yumly/phases/includes/env_loader.nim): `src/Yumly/phases/includes/env_loader.nim`
- [Value resolver](https://github.com/creeper011/yumly/blob/main/src/Yumly/phases/resolver/resolver.nim): `src/Yumly/phases/resolver/resolver.nim`

### Representations and output

- [Yumly encoder](https://github.com/creeper011/yumly/blob/main/src/Yumly/serializers/yumly/encoder.nim): `src/Yumly/serializers/yumly/encoder.nim`
- [Yumyumy encoder](https://github.com/creeper011/yumly/blob/main/src/Yumly/serializers/yumyumy/yumyumy_encoder.nim): `src/Yumly/serializers/yumyumy/yumyumy_encoder.nim`
- [JSON encoder](https://github.com/creeper011/yumly/blob/main/src/Yumly/serializers/json/json_encoder.nim): `src/Yumly/serializers/json/json_encoder.nim`
- [YAML encoder](https://github.com/creeper011/yumly/blob/main/src/Yumly/serializers/yaml/yaml_encoder.nim): `src/Yumly/serializers/yaml/yaml_encoder.nim`
- [Python serializer](https://github.com/creeper011/yumly/blob/main/src/Yumly/serializers/python/parser_python.nim): `src/Yumly/serializers/python/parser_python.nim`
- **Config result**

### Other components

- **Config author**

## Connections

- Config author → Python API: loads or validates (evidence: `README.MD`)
- Config author → Nim API: loads config (evidence: `README.MD`)
- Python API → Native engine: calls native functions (evidence: `lib/python/yumly/yumly.py`)
- Python API → Python AST bridge: maps intermediate results (evidence: `lib/python/yumly/yumly.py`)
- Native engine → Pipeline coordinator: delegates processing
- Pipeline coordinator → Tokenizer: runs phase
- Pipeline coordinator → Parser: runs phase
- Pipeline coordinator → Validation: runs phase
- Pipeline coordinator → Evaluator: runs phase
- Pipeline coordinator → Include loader: loads includes
- Include loader → Include paths: resolves paths
- Include loader → Environment loader: loads environment
- Pipeline coordinator → Value resolver: resolves values
- Parser → AST and values: produces syntax tree
- Evaluator → Config result: returns evaluated data
- Nim API → Pipeline coordinator: runs configuration pipeline
- C API → Pipeline coordinator: runs configuration pipeline
- Yumly CLI → Pipeline coordinator: uses language engine
- Native engine → Yumly encoder: encodes Yumly
- Native engine → Yumyumy encoder: encodes internal format
- Native engine → JSON encoder: encodes JSON
- Native engine → YAML encoder: encodes YAML
- Native engine → Python serializer: bridges Python data
