# north-road/slyr architecture

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

- Interactive diagram: https://gitdiagram.com/north-road/slyr
- Repository: https://github.com/north-road/slyr

## Overview

SLYR Community is a QGIS plugin and Python toolkit for parsing ESRI binary layer/style data and converting supported vector .lyr files and .style databases into QGIS representations. The main workflow runs from a QGIS Processing user through a conversion algorithm, binary extraction/parsing, and conversion into QGIS layers or style XML; command-line utilities also inspect or export style contents. The graph includes documented converter capabilities, but sampled excerpts are incomplete, so links to unsampled subsystems are omitted unless documented or indexed.

Main entry points: [`slyr_community/qgis_plugin/algorithms/style_to_xml.py`](https://github.com/north-road/slyr/blob/master/slyr_community/qgis_plugin/algorithms/style_to_xml.py) (Style conversion), [`slyr_community/converters/symbols.py`](https://github.com/north-road/slyr/blob/master/slyr_community/converters/symbols.py) (Symbology), [`slyr_community/qgis_plugin/algorithms/lyr_to_qlr.py`](https://github.com/north-road/slyr/blob/master/slyr_community/qgis_plugin/algorithms/lyr_to_qlr.py) (Layer conversion), [`slyr_community/converters/context.py`](https://github.com/north-road/slyr/blob/master/slyr_community/converters/context.py) (Conversion context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["QGIS Entry Points"]
  node_plugin["Plugin setup<br/>[plugin.py]"]
  node_provider["Processing provider<br/>[provider.py]"]
  node_style_algorithm["Style conversion<br/>[style_to_xml.py]"]
  node_layer_algorithm["Layer conversion<br/>[lyr_to_qlr.py]"]
end

subgraph group_parse["Binary Parsing"]
  node_extractor["Style extractor<br/>[extractor.py]"]
  node_stream["Binary stream<br/>[stream.py]"]
  node_registry["Object registry<br/>[object_registry.py]"]
  node_object["Parsed objects<br/>[object.py]"]
end

subgraph group_convert["QGIS Conversion"]
  node_context["Conversion context<br/>[context.py]"]
  node_layers["Vector layers<br/>[layers.py]"]
  node_symbols["Symbology<br/>[symbols.py]"]
  node_color["Color conversion<br/>[color.py]"]
  node_text["Text formatting<br/>[text_format.py]"]
  node_layout["Layout conversion<br/>[layout.py]"]
end

subgraph group_tools["Style Utilities"]
  node_cli_tools["Style CLI tools<br/>[style_dump.py]"]
end

node_user(("QGIS user"))
node_mdbtools["mdbtools"]
node_qgis_style[("QGIS style library")]
node_style_database[("ESRI style database")]

node_user -->|"uses"| node_plugin
node_plugin -->|"registers"| node_provider
node_provider -->|"provides"| node_style_algorithm
node_provider -.->|"provides"| node_layer_algorithm
node_style_algorithm -->|"extracts symbols"| node_extractor
node_style_algorithm -->|"uses context"| node_context
node_style_algorithm -->|"converts symbols"| node_symbols
node_style_algorithm -->|"exports XML"| node_qgis_style
node_layer_algorithm -->|"parses layer"| node_stream
node_layer_algorithm -->|"uses context"| node_context
node_layer_algorithm -->|"converts layer"| node_layers
node_stream -->|"creates objects"| node_registry
node_registry -->|"registers subclasses"| node_object
node_symbols -->|"uses settings"| node_context
node_symbols -->|"converts colors"| node_color
node_text -->|"converts colors"| node_color
node_text -->|"uses symbols"| node_symbols
node_layout -->|"converts symbols"| node_symbols
node_layout -->|"uses context"| node_context
node_extractor -->|"runs command"| node_mdbtools
node_cli_tools -->|"reads style data"| node_extractor
node_style_database -->|"provides input"| node_cli_tools

click node_plugin "https://github.com/north-road/slyr/blob/master/slyr_community/plugin.py"
click node_provider "https://github.com/north-road/slyr/blob/master/slyr_community/qgis_plugin/provider.py"
click node_style_algorithm "https://github.com/north-road/slyr/blob/master/slyr_community/qgis_plugin/algorithms/style_to_xml.py"
click node_layer_algorithm "https://github.com/north-road/slyr/blob/master/slyr_community/qgis_plugin/algorithms/lyr_to_qlr.py"
click node_extractor "https://github.com/north-road/slyr/blob/master/slyr_community/bintools/extractor.py"
click node_stream "https://github.com/north-road/slyr/blob/master/slyr_community/parser/stream.py"
click node_registry "https://github.com/north-road/slyr/blob/master/slyr_community/parser/object_registry.py"
click node_object "https://github.com/north-road/slyr/blob/master/slyr_community/parser/object.py"
click node_context "https://github.com/north-road/slyr/blob/master/slyr_community/converters/context.py"
click node_layers "https://github.com/north-road/slyr/blob/master/slyr_community/converters/layers.py"
click node_symbols "https://github.com/north-road/slyr/blob/master/slyr_community/converters/symbols.py"
click node_color "https://github.com/north-road/slyr/blob/master/slyr_community/converters/color.py"
click node_text "https://github.com/north-road/slyr/blob/master/slyr_community/converters/text_format.py"
click node_layout "https://github.com/north-road/slyr/blob/master/slyr_community/converters/layout.py"
click node_cli_tools "https://github.com/north-road/slyr/blob/master/slyr_community/tools/style_dump.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_plugin,node_provider,node_style_algorithm,node_layer_algorithm,node_user toneBlue
class node_extractor,node_stream,node_registry,node_object,node_qgis_style,node_style_database toneAmber
class node_context,node_layers,node_symbols,node_color,node_text,node_layout toneMint
class node_cli_tools toneRose
class node_mdbtools toneIndigo
```

## Components

### QGIS Entry Points

- [Plugin setup](https://github.com/north-road/slyr/blob/master/slyr_community/plugin.py): `slyr_community/plugin.py`
- [Processing provider](https://github.com/north-road/slyr/blob/master/slyr_community/qgis_plugin/provider.py): `slyr_community/qgis_plugin/provider.py`
- [Style conversion](https://github.com/north-road/slyr/blob/master/slyr_community/qgis_plugin/algorithms/style_to_xml.py): `slyr_community/qgis_plugin/algorithms/style_to_xml.py`
- [Layer conversion](https://github.com/north-road/slyr/blob/master/slyr_community/qgis_plugin/algorithms/lyr_to_qlr.py): `slyr_community/qgis_plugin/algorithms/lyr_to_qlr.py`

### Binary Parsing

- [Style extractor](https://github.com/north-road/slyr/blob/master/slyr_community/bintools/extractor.py): `slyr_community/bintools/extractor.py`
- [Binary stream](https://github.com/north-road/slyr/blob/master/slyr_community/parser/stream.py): `slyr_community/parser/stream.py`
- [Object registry](https://github.com/north-road/slyr/blob/master/slyr_community/parser/object_registry.py): `slyr_community/parser/object_registry.py`
- [Parsed objects](https://github.com/north-road/slyr/blob/master/slyr_community/parser/object.py): `slyr_community/parser/object.py`

### QGIS Conversion

- [Conversion context](https://github.com/north-road/slyr/blob/master/slyr_community/converters/context.py): `slyr_community/converters/context.py`
- [Vector layers](https://github.com/north-road/slyr/blob/master/slyr_community/converters/layers.py): `slyr_community/converters/layers.py`
- [Symbology](https://github.com/north-road/slyr/blob/master/slyr_community/converters/symbols.py): `slyr_community/converters/symbols.py`
- [Color conversion](https://github.com/north-road/slyr/blob/master/slyr_community/converters/color.py): `slyr_community/converters/color.py`
- [Text formatting](https://github.com/north-road/slyr/blob/master/slyr_community/converters/text_format.py): `slyr_community/converters/text_format.py`
- [Layout conversion](https://github.com/north-road/slyr/blob/master/slyr_community/converters/layout.py): `slyr_community/converters/layout.py`

### Style Utilities

- [Style CLI tools](https://github.com/north-road/slyr/blob/master/slyr_community/tools/style_dump.py): `slyr_community/tools/style_dump.py`

### Other components

- **QGIS user**
- **mdbtools**
- **QGIS style library**
- **ESRI style database**

## Connections

- QGIS user → Plugin setup: uses
- Plugin setup → Processing provider: registers (evidence: `slyr_community/plugin.py`)
- Processing provider → Style conversion: provides (evidence: `slyr_community/qgis_plugin/provider.py`)
- Processing provider → Layer conversion: provides
- Style conversion → Style extractor: extracts symbols (evidence: `slyr_community/qgis_plugin/algorithms/style_to_xml.py`)
- Style conversion → Conversion context: uses context (evidence: `slyr_community/qgis_plugin/algorithms/style_to_xml.py`)
- Style conversion → Symbology: converts symbols (evidence: `slyr_community/qgis_plugin/algorithms/style_to_xml.py`)
- Style conversion → QGIS style library: exports XML
- Layer conversion → Binary stream: parses layer (evidence: `slyr_community/qgis_plugin/algorithms/lyr_to_qlr.py`)
- Layer conversion → Conversion context: uses context (evidence: `slyr_community/qgis_plugin/algorithms/lyr_to_qlr.py`)
- Layer conversion → Vector layers: converts layer (evidence: `slyr_community/qgis_plugin/algorithms/lyr_to_qlr.py`)
- Binary stream → Object registry: creates objects (evidence: `slyr_community/parser/stream.py`)
- Object registry → Parsed objects: registers subclasses (evidence: `slyr_community/parser/initalize_registry.py`)
- Symbology → Conversion context: uses settings (evidence: `slyr_community/converters/symbols.py`)
- Symbology → Color conversion: converts colors (evidence: `slyr_community/converters/symbols.py`)
- Text formatting → Color conversion: converts colors (evidence: `slyr_community/converters/text_format.py`)
- Text formatting → Symbology: uses symbols (evidence: `slyr_community/converters/text_format.py`)
- Layout conversion → Symbology: converts symbols (evidence: `slyr_community/converters/layout.py`)
- Layout conversion → Conversion context: uses context (evidence: `slyr_community/converters/layout.py`)
- Style extractor → mdbtools: runs command (evidence: `slyr_community/bintools/extractor.py`)
- Style CLI tools → Style extractor: reads style data (evidence: `slyr_community/tools/style_dump.py`)
- ESRI style database → Style CLI tools: provides input
