# jvalenzuela/l5x architecture

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

- Interactive diagram: https://gitdiagram.com/jvalenzuela/l5x
- Repository: https://github.com/jvalenzuela/l5x

## Overview

l5x is a Python interface for reading and modifying RSLogix .L5X project files without requiring callers to manipulate raw XML. The main workflow is to construct a Project from a file, access controller, program, module, or tag data through Python objects, then write the modified project. Its domain surface includes typed tags (including arrays, structures, aliases, consumed tags, and message tags), controller communication settings, programs, and I/O modules. The excerpts show project parsing/writing, module access, tag access, and XML helpers; other tag details are documented in the README.

Main entry points: [`l5x/project.py`](https://github.com/jvalenzuela/l5x/blob/master/l5x/project.py) (Project API), [`l5x/tag.py`](https://github.com/jvalenzuela/l5x/blob/master/l5x/tag.py) (Tag properties), [`l5x/dom.py`](https://github.com/jvalenzuela/l5x/blob/master/l5x/dom.py) (XML helpers), [`l5x/module.py`](https://github.com/jvalenzuela/l5x/blob/master/l5x/module.py) (Module access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_project["Project files"]
  node_project_api["Project API<br/>[project.py]"]
  node_xml_tree["XML project tree<br/>[project.py]"]
end

subgraph group_scopes["Project scopes"]
  node_controller["Controller settings<br/>[project.py]"]
  node_program_scopes["Program scopes<br/>[project.py]"]
  node_module_access["Module access<br/>[module.py]"]
  node_tag_scopes["Tag scopes<br/>[tag.py]"]
end

subgraph group_tagdata["Tag data"]
  node_tag_access["Tag properties<br/>[tag.py]"]
  node_scalar_tags["Scalar tags<br/>[tag.py]"]
  node_structured_tags["Structures<br/>[tag.py]"]
  node_array_tags["Array tags<br/>[tag.py]"]
  node_special_tags["Special tags<br/>[tag.py]"]
end

subgraph group_xml["XML support"]
  node_dom_helpers["XML helpers<br/>[dom.py]"]
end

node_user(("Python caller"))
node_input["L5X input"]
node_output["L5X output"]

node_user -->|"opens project"| node_project_api
node_input -->|"reads file"| node_project_api
node_project_api -->|"parses and serializes"| node_xml_tree
node_project_api -->|"creates"| node_controller
node_project_api -->|"creates"| node_program_scopes
node_project_api -->|"creates"| node_module_access
node_project_api -->|"writes project"| node_output
node_controller -->|"exposes tags"| node_tag_scopes
node_program_scopes -->|"exposes tags"| node_tag_scopes
node_tag_scopes -->|"returns tag"| node_tag_access
node_tag_access -->|"dispatches data"| node_scalar_tags
node_tag_access -->|"dispatches data"| node_structured_tags
node_tag_access -->|"supports indexing"| node_array_tags
node_tag_access -->|"supports variants"| node_special_tags
node_tag_scopes -->|"uses element maps"| node_dom_helpers
node_tag_access -->|"uses XML helpers"| node_dom_helpers
node_module_access -->|"uses element maps"| node_dom_helpers

click node_project_api "https://github.com/jvalenzuela/l5x/blob/master/l5x/project.py"
click node_xml_tree "https://github.com/jvalenzuela/l5x/blob/master/l5x/project.py"
click node_controller "https://github.com/jvalenzuela/l5x/blob/master/l5x/project.py"
click node_program_scopes "https://github.com/jvalenzuela/l5x/blob/master/l5x/project.py"
click node_module_access "https://github.com/jvalenzuela/l5x/blob/master/l5x/module.py"
click node_tag_scopes "https://github.com/jvalenzuela/l5x/blob/master/l5x/tag.py"
click node_tag_access "https://github.com/jvalenzuela/l5x/blob/master/l5x/tag.py"
click node_scalar_tags "https://github.com/jvalenzuela/l5x/blob/master/l5x/tag.py"
click node_structured_tags "https://github.com/jvalenzuela/l5x/blob/master/l5x/tag.py"
click node_array_tags "https://github.com/jvalenzuela/l5x/blob/master/l5x/tag.py"
click node_special_tags "https://github.com/jvalenzuela/l5x/blob/master/l5x/tag.py"
click node_dom_helpers "https://github.com/jvalenzuela/l5x/blob/master/l5x/dom.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_project_api,node_xml_tree toneBlue
class node_controller,node_program_scopes,node_module_access,node_tag_scopes toneAmber
class node_tag_access,node_scalar_tags,node_structured_tags,node_array_tags,node_special_tags toneMint
class node_dom_helpers toneRose
class node_user,node_input,node_output toneIndigo
```

## Components

### Project files

- [Project API](https://github.com/jvalenzuela/l5x/blob/master/l5x/project.py): `l5x/project.py`
- [XML project tree](https://github.com/jvalenzuela/l5x/blob/master/l5x/project.py): `l5x/project.py`

### Project scopes

- [Controller settings](https://github.com/jvalenzuela/l5x/blob/master/l5x/project.py): `l5x/project.py`
- [Program scopes](https://github.com/jvalenzuela/l5x/blob/master/l5x/project.py): `l5x/project.py`
- [Module access](https://github.com/jvalenzuela/l5x/blob/master/l5x/module.py): `l5x/module.py`
- [Tag scopes](https://github.com/jvalenzuela/l5x/blob/master/l5x/tag.py): `l5x/tag.py`

### Tag data

- [Tag properties](https://github.com/jvalenzuela/l5x/blob/master/l5x/tag.py): `l5x/tag.py`
- [Scalar tags](https://github.com/jvalenzuela/l5x/blob/master/l5x/tag.py): `l5x/tag.py`
- [Structures](https://github.com/jvalenzuela/l5x/blob/master/l5x/tag.py): `l5x/tag.py`
- [Array tags](https://github.com/jvalenzuela/l5x/blob/master/l5x/tag.py): `l5x/tag.py`
- [Special tags](https://github.com/jvalenzuela/l5x/blob/master/l5x/tag.py): `l5x/tag.py`

### XML support

- [XML helpers](https://github.com/jvalenzuela/l5x/blob/master/l5x/dom.py): `l5x/dom.py`

### Other components

- **Python caller**
- **L5X input**
- **L5X output**

## Connections

- Python caller → Project API: opens project (evidence: `README.rst`)
- L5X input → Project API: reads file (evidence: `README.rst`)
- Project API → XML project tree: parses and serializes (evidence: `l5x/project.py`)
- Project API → Controller settings: creates (evidence: `l5x/project.py`)
- Project API → Program scopes: creates (evidence: `l5x/project.py`)
- Project API → Module access: creates (evidence: `l5x/project.py`)
- Project API → L5X output: writes project (evidence: `README.rst`)
- Controller settings → Tag scopes: exposes tags (evidence: `README.rst`)
- Program scopes → Tag scopes: exposes tags (evidence: `README.rst`)
- Tag scopes → Tag properties: returns tag (evidence: `l5x/tag.py`)
- Tag properties → Scalar tags: dispatches data (evidence: `l5x/tag.py`)
- Tag properties → Structures: dispatches data (evidence: `l5x/tag.py`)
- Tag properties → Array tags: supports indexing (evidence: `README.rst`)
- Tag properties → Special tags: supports variants (evidence: `README.rst`)
- Tag scopes → XML helpers: uses element maps (evidence: `l5x/tag.py`)
- Tag properties → XML helpers: uses XML helpers (evidence: `l5x/tag.py`)
- Module access → XML helpers: uses element maps (evidence: `l5x/module.py`)
