# richclubb/python-uds architecture

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

- Interactive diagram: https://gitdiagram.com/richclubb/python-uds
- Repository: https://github.com/richclubb/python-uds

## Overview

python-uds is an extensible UDS diagnostic library: a client uses a configured Uds connection to issue diagnostic services and receive decoded responses over a transport. Configuration builds service methods and binds them to the Uds object; the runtime sends requests through a transport, while optional file-transfer support parses Intel HEX data and invokes download/transfer services. CAN is the README-documented connection; LIN and other transport modules are present in the tree. The graph uses documented and indexed relationships; unsampled subsystem links are omitted where evidence does not establish the caller.

Main entry points: [`uds/uds_communications/Uds/Uds.py`](https://github.com/richclubb/python-uds/blob/master/uds/uds_communications/Uds/Uds.py) (UDS Connection), [`uds/uds_config_tool/UdsConfigTool.py`](https://github.com/richclubb/python-uds/blob/master/uds/uds_config_tool/UdsConfigTool.py) (Connection Configurator), [`uds/uds_config_tool/FunctionCreation`](https://github.com/richclubb/python-uds/tree/master/uds/uds_config_tool/FunctionCreation) (Service Method Factories), [`uds/uds_communications/TransportProtocols/Can/CanTp.py`](https://github.com/richclubb/python-uds/blob/master/uds/uds_communications/TransportProtocols/Can/CanTp.py) (CAN Transport)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["UDS Runtime"]
  node_uds["UDS Connection<br/>[Uds.py]"]
  node_timer["Resettable Timers<br/>[ResettableTimer.py]"]
end

subgraph group_transport["Transports"]
  node_transport_factory["Transport Factory<br/>[TpFactory.py]"]
  node_tp_interface["Transport Interface<br/>[iTp.py]"]
  node_can_tp["CAN Transport<br/>[CanTp.py]"]
  node_can_types["CAN Frame Types<br/>[CanTpTypes.py]"]
  node_can_connection["CAN Connection<br/>[CanConnection.py]"]
  node_can_factory["CAN Connection Factory"]
  node_lin_tp["LIN Transport<br/>[LinTp.py]"]
end

subgraph group_services["Services and Configuration"]
  node_config_tool["Connection Configurator<br/>[UdsConfigTool.py]"]
  node_service_containers["Service Containers"]
  node_service_factories["Service Method Factories"]
  node_factory_interface["Factory Interface"]
end

subgraph group_data["Data and Standards"]
  node_decode["Value Decoding<br/>[DecodeFunctions.py]"]
  node_iso["ISO Service Definitions<br/>[ISOStandard.py]"]
  node_ihex["Intel HEX Parser<br/>[IHexFunctions.py]"]
  node_config["Configuration<br/>[Config.py]"]
end

node_client(("Diagnostic Client"))
node_can_service["Python-CAN"]

node_client -->|"calls services"| node_uds
node_uds -.->|"selects transport"| node_transport_factory
node_uds -->|"parses transfer file"| node_ihex
node_uds -->|"uses service values"| node_iso
node_uds -.->|"sends requests"| node_can_tp
node_can_tp -->|"uses frame types"| node_can_types
node_can_factory -->|"creates connection"| node_can_connection
node_can_connection -.->|"uses"| node_can_service
node_lin_tp -->|"implements"| node_tp_interface
node_config_tool -->|"creates connection"| node_uds
node_config_tool -->|"binds services"| node_service_containers
node_config_tool -->|"builds methods"| node_service_factories
node_service_factories -->|"implements contract"| node_factory_interface
node_service_factories -->|"uses conversions"| node_decode
node_service_containers -->|"sends requests"| node_uds
node_uds -.->|"uses timing"| node_timer
node_config_tool -.->|"loads settings"| node_config

click node_uds "https://github.com/richclubb/python-uds/blob/master/uds/uds_communications/Uds/Uds.py"
click node_transport_factory "https://github.com/richclubb/python-uds/blob/master/uds/uds_communications/TransportProtocols/TpFactory.py"
click node_tp_interface "https://github.com/richclubb/python-uds/blob/master/uds/uds_communications/TransportProtocols/iTp.py"
click node_can_tp "https://github.com/richclubb/python-uds/blob/master/uds/uds_communications/TransportProtocols/Can/CanTp.py"
click node_can_types "https://github.com/richclubb/python-uds/blob/master/uds/uds_communications/TransportProtocols/Can/CanTpTypes.py"
click node_can_connection "https://github.com/richclubb/python-uds/blob/master/uds/uds_communications/TransportProtocols/Can/CanConnection.py"
click node_can_factory "https://github.com/richclubb/python-uds/blob/master/uds/uds_communications/TransportProtocols/Can/CanConnectionFactory.py"
click node_lin_tp "https://github.com/richclubb/python-uds/blob/master/uds/uds_communications/TransportProtocols/Lin/LinTp.py"
click node_config_tool "https://github.com/richclubb/python-uds/blob/master/uds/uds_config_tool/UdsConfigTool.py"
click node_service_containers "https://github.com/richclubb/python-uds/tree/master/uds/uds_config_tool/SupportedServices"
click node_service_factories "https://github.com/richclubb/python-uds/tree/master/uds/uds_config_tool/FunctionCreation"
click node_factory_interface "https://github.com/richclubb/python-uds/blob/master/uds/uds_config_tool/FunctionCreation/iServiceMethodFactory.py"
click node_decode "https://github.com/richclubb/python-uds/blob/master/uds/uds_config_tool/DecodeFunctions.py"
click node_iso "https://github.com/richclubb/python-uds/blob/master/uds/uds_config_tool/ISOStandard/ISOStandard.py"
click node_ihex "https://github.com/richclubb/python-uds/blob/master/uds/uds_config_tool/IHexFunctions.py"
click node_config "https://github.com/richclubb/python-uds/blob/master/uds/uds_configuration/Config.py"
click node_timer "https://github.com/richclubb/python-uds/blob/master/uds/uds_communications/Utilities/ResettableTimer.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_uds,node_timer,node_client toneBlue
class node_transport_factory,node_tp_interface,node_can_tp,node_can_types,node_can_connection,node_can_factory,node_lin_tp toneAmber
class node_config_tool,node_service_containers,node_service_factories,node_factory_interface toneMint
class node_decode,node_iso,node_ihex,node_config toneRose
class node_can_service toneIndigo
```

## Components

### UDS Runtime

- [UDS Connection](https://github.com/richclubb/python-uds/blob/master/uds/uds_communications/Uds/Uds.py): `uds/uds_communications/Uds/Uds.py`
- [Resettable Timers](https://github.com/richclubb/python-uds/blob/master/uds/uds_communications/Utilities/ResettableTimer.py): `uds/uds_communications/Utilities/ResettableTimer.py`

### Transports

- [Transport Factory](https://github.com/richclubb/python-uds/blob/master/uds/uds_communications/TransportProtocols/TpFactory.py): `uds/uds_communications/TransportProtocols/TpFactory.py`
- [Transport Interface](https://github.com/richclubb/python-uds/blob/master/uds/uds_communications/TransportProtocols/iTp.py): `uds/uds_communications/TransportProtocols/iTp.py`
- [CAN Transport](https://github.com/richclubb/python-uds/blob/master/uds/uds_communications/TransportProtocols/Can/CanTp.py): `uds/uds_communications/TransportProtocols/Can/CanTp.py`
- [CAN Frame Types](https://github.com/richclubb/python-uds/blob/master/uds/uds_communications/TransportProtocols/Can/CanTpTypes.py): `uds/uds_communications/TransportProtocols/Can/CanTpTypes.py`
- [CAN Connection](https://github.com/richclubb/python-uds/blob/master/uds/uds_communications/TransportProtocols/Can/CanConnection.py): `uds/uds_communications/TransportProtocols/Can/CanConnection.py`
- [CAN Connection Factory](https://github.com/richclubb/python-uds/blob/master/uds/uds_communications/TransportProtocols/Can/CanConnectionFactory.py): `uds/uds_communications/TransportProtocols/Can/CanConnectionFactory.py`
- [LIN Transport](https://github.com/richclubb/python-uds/blob/master/uds/uds_communications/TransportProtocols/Lin/LinTp.py): `uds/uds_communications/TransportProtocols/Lin/LinTp.py`

### Services and Configuration

- [Connection Configurator](https://github.com/richclubb/python-uds/blob/master/uds/uds_config_tool/UdsConfigTool.py): `uds/uds_config_tool/UdsConfigTool.py`
- [Service Containers](https://github.com/richclubb/python-uds/tree/master/uds/uds_config_tool/SupportedServices): `uds/uds_config_tool/SupportedServices`
- [Service Method Factories](https://github.com/richclubb/python-uds/tree/master/uds/uds_config_tool/FunctionCreation): `uds/uds_config_tool/FunctionCreation`
- [Factory Interface](https://github.com/richclubb/python-uds/blob/master/uds/uds_config_tool/FunctionCreation/iServiceMethodFactory.py): `uds/uds_config_tool/FunctionCreation/iServiceMethodFactory.py`

### Data and Standards

- [Value Decoding](https://github.com/richclubb/python-uds/blob/master/uds/uds_config_tool/DecodeFunctions.py): `uds/uds_config_tool/DecodeFunctions.py`
- [ISO Service Definitions](https://github.com/richclubb/python-uds/blob/master/uds/uds_config_tool/ISOStandard/ISOStandard.py): `uds/uds_config_tool/ISOStandard/ISOStandard.py`
- [Intel HEX Parser](https://github.com/richclubb/python-uds/blob/master/uds/uds_config_tool/IHexFunctions.py): `uds/uds_config_tool/IHexFunctions.py`
- [Configuration](https://github.com/richclubb/python-uds/blob/master/uds/uds_configuration/Config.py): `uds/uds_configuration/Config.py`

### Other components

- **Diagnostic Client**
- **Python-CAN**

## Connections

- Diagnostic Client → UDS Connection: calls services
- UDS Connection → Transport Factory: selects transport
- UDS Connection → Intel HEX Parser: parses transfer file (evidence: `uds/uds_communications/Uds/Uds.py`)
- UDS Connection → ISO Service Definitions: uses service values (evidence: `uds/uds_communications/Uds/Uds.py`)
- UDS Connection → CAN Transport: sends requests
- CAN Transport → CAN Frame Types: uses frame types (evidence: `uds/uds_communications/TransportProtocols/Can/CanTp.py`)
- CAN Connection Factory → CAN Connection: creates connection (evidence: `uds/uds_communications/TransportProtocols/Can/CanConnectionFactory.py`)
- CAN Connection → Python-CAN: uses
- LIN Transport → Transport Interface: implements (evidence: `uds/uds_communications/TransportProtocols/Lin/LinTp.py`)
- Connection Configurator → UDS Connection: creates connection (evidence: `uds/uds_config_tool/UdsConfigTool.py`)
- Connection Configurator → Service Containers: binds services (evidence: `uds/uds_config_tool/UdsConfigTool.py`)
- Connection Configurator → Service Method Factories: builds methods (evidence: `uds/uds_config_tool/UdsConfigTool.py`)
- Service Method Factories → Factory Interface: implements contract (evidence: `uds/uds_config_tool/FunctionCreation/DiagnosticSessionControlMethodFactory.py`)
- Service Method Factories → Value Decoding: uses conversions (evidence: `uds/uds_config_tool/FunctionCreation/DiagnosticSessionControlMethodFactory.py`)
- Service Containers → UDS Connection: sends requests (evidence: `uds/uds_config_tool/SupportedServices/DiagnosticSessionControlContainer.py`)
- UDS Connection → Resettable Timers: uses timing
- Connection Configurator → Configuration: loads settings
