# open-dis/open-dis-python architecture

> Architecture diagram of the GitHub repository open-dis/open-dis-python, 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/open-dis/open-dis-python
- Repository: https://github.com/open-dis/open-dis-python

## Overview

open-dis-python is a Python implementation of the DIS 7 binary protocol. The documented user workflow is to run a receiver and sender and observe DIS traffic; the library supplies PDU and record types plus binary stream support. The graph includes documented examples and major protocol domains, alongside the serialization layer. Source excerpts support the core serialization dependencies; example internals and several unsampled modules are represented conservatively, so their runtime connections are not inferred.

Main entry points: [`opendis/record/base.py`](https://github.com/open-dis/open-dis-python/blob/master/opendis/record/base.py) (Record interfaces), [`opendis/stream.py`](https://github.com/open-dis/open-dis-python/blob/master/opendis/stream.py) (Binary streams), [`opendis/record/__init__.py`](https://github.com/open-dis/open-dis-python/blob/master/opendis/record/__init__.py) (Record registry and exports), [`opendis/record/common.py`](https://github.com/open-dis/open-dis-python/blob/master/opendis/record/common.py) (Common records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_protocol["DIS Protocol Model"]
  node_examples["Sender and receiver examples"]
  node_pdu["DIS 7 PDUs<br/>[dis7.py]"]
  node_factory["PDU factory<br/>[PduFactory.py]"]
end

subgraph group_records["Record Types"]
  node_record_api["Record registry and exports<br/>[__init__.py]"]
  node_common["Common records<br/>[common.py]"]
  node_radio["Radio records<br/>[__init__.py]"]
  node_warfare["Warfare records<br/>[__init__.py]"]
  node_warfare_enums["Warfare bitfields<br/>[enums.py]"]
end

subgraph group_runtime["Serialization Runtime"]
  node_base["Record interfaces<br/>[base.py]"]
  node_bitfield["Bitfield codec<br/>[bitfield.py]"]
  node_stream["Binary streams<br/>[stream.py]"]
  node_types["Protocol type aliases<br/>[types.py]"]
  node_names["Symbolic constants<br/>[symbolic_names.py]"]
end

subgraph group_utilities["Simulation Utilities"]
  node_deadreckoning["Dead reckoning<br/>[DeadReckoning.py]"]
  node_coordinates["Range coordinates"]
end

node_user(("Simulation user"))

node_user -->|"runs"| node_examples
node_examples -->|"exchanges DIS traffic"| node_user
node_factory -->|"uses PDU classes"| node_pdu
node_factory -->|"uses streams"| node_stream
node_pdu -->|"imports records"| node_record_api
node_pdu -->|"uses record base"| node_base
node_pdu -->|"serializes through"| node_stream
node_record_api -->|"exports records"| node_common
node_record_api -->|"exports records"| node_radio
node_record_api -->|"exports records"| node_warfare
node_record_api -->|"imports constants"| node_names
node_common -->|"uses interfaces"| node_base
node_common -->|"uses bitfields"| node_bitfield
node_common -->|"reads and writes"| node_stream
node_common -->|"uses constants"| node_names
node_radio -->|"uses interfaces"| node_base
node_radio -->|"uses bitfields"| node_bitfield
node_warfare -->|"uses interfaces"| node_base
node_warfare -->|"uses bitfields"| node_bitfield
node_warfare -->|"uses flags"| node_warfare_enums
node_warfare -->|"uses radio records"| node_radio
node_warfare_enums -->|"implements interface"| node_base
node_warfare_enums -->|"packs fields"| node_bitfield
node_base -->|"defines stream methods"| node_stream
node_bitfield -->|"reads and writes"| node_stream
node_stream -->|"uses aliases"| node_types

click node_examples "https://github.com/open-dis/open-dis-python/tree/master/examples"
click node_pdu "https://github.com/open-dis/open-dis-python/blob/master/opendis/dis7.py"
click node_factory "https://github.com/open-dis/open-dis-python/blob/master/opendis/PduFactory.py"
click node_record_api "https://github.com/open-dis/open-dis-python/blob/master/opendis/record/__init__.py"
click node_common "https://github.com/open-dis/open-dis-python/blob/master/opendis/record/common.py"
click node_radio "https://github.com/open-dis/open-dis-python/blob/master/opendis/record/radio/__init__.py"
click node_warfare "https://github.com/open-dis/open-dis-python/blob/master/opendis/record/warfare/__init__.py"
click node_warfare_enums "https://github.com/open-dis/open-dis-python/blob/master/opendis/record/warfare/enums.py"
click node_base "https://github.com/open-dis/open-dis-python/blob/master/opendis/record/base.py"
click node_bitfield "https://github.com/open-dis/open-dis-python/blob/master/opendis/record/bitfield.py"
click node_stream "https://github.com/open-dis/open-dis-python/blob/master/opendis/stream.py"
click node_types "https://github.com/open-dis/open-dis-python/blob/master/opendis/types.py"
click node_names "https://github.com/open-dis/open-dis-python/blob/master/opendis/record/symbolic_names.py"
click node_deadreckoning "https://github.com/open-dis/open-dis-python/blob/master/opendis/DeadReckoning.py"
click node_coordinates "https://github.com/open-dis/open-dis-python/blob/master/opendis/RangeCoordinates.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_examples,node_pdu,node_factory,node_user toneBlue
class node_record_api,node_common,node_radio,node_warfare,node_warfare_enums toneAmber
class node_base,node_bitfield,node_stream,node_types,node_names toneMint
class node_deadreckoning,node_coordinates toneRose
```

## Components

### DIS Protocol Model

- [Sender and receiver examples](https://github.com/open-dis/open-dis-python/tree/master/examples): `examples`
- [DIS 7 PDUs](https://github.com/open-dis/open-dis-python/blob/master/opendis/dis7.py): `opendis/dis7.py`
- [PDU factory](https://github.com/open-dis/open-dis-python/blob/master/opendis/PduFactory.py): `opendis/PduFactory.py`

### Record Types

- [Record registry and exports](https://github.com/open-dis/open-dis-python/blob/master/opendis/record/__init__.py): `opendis/record/__init__.py`
- [Common records](https://github.com/open-dis/open-dis-python/blob/master/opendis/record/common.py): `opendis/record/common.py`
- [Radio records](https://github.com/open-dis/open-dis-python/blob/master/opendis/record/radio/__init__.py): `opendis/record/radio/__init__.py`
- [Warfare records](https://github.com/open-dis/open-dis-python/blob/master/opendis/record/warfare/__init__.py): `opendis/record/warfare/__init__.py`
- [Warfare bitfields](https://github.com/open-dis/open-dis-python/blob/master/opendis/record/warfare/enums.py): `opendis/record/warfare/enums.py`

### Serialization Runtime

- [Record interfaces](https://github.com/open-dis/open-dis-python/blob/master/opendis/record/base.py): `opendis/record/base.py`
- [Bitfield codec](https://github.com/open-dis/open-dis-python/blob/master/opendis/record/bitfield.py): `opendis/record/bitfield.py`
- [Binary streams](https://github.com/open-dis/open-dis-python/blob/master/opendis/stream.py): `opendis/stream.py`
- [Protocol type aliases](https://github.com/open-dis/open-dis-python/blob/master/opendis/types.py): `opendis/types.py`
- [Symbolic constants](https://github.com/open-dis/open-dis-python/blob/master/opendis/record/symbolic_names.py): `opendis/record/symbolic_names.py`

### Simulation Utilities

- [Dead reckoning](https://github.com/open-dis/open-dis-python/blob/master/opendis/DeadReckoning.py): `opendis/DeadReckoning.py`
- [Range coordinates](https://github.com/open-dis/open-dis-python/blob/master/opendis/RangeCoordinates.py): `opendis/RangeCoordinates.py`

### Other components

- **Simulation user**

## Connections

- Simulation user → Sender and receiver examples: runs (evidence: `README.md`)
- Sender and receiver examples → Simulation user: exchanges DIS traffic (evidence: `README.md`)
- PDU factory → DIS 7 PDUs: uses PDU classes (evidence: `opendis/PduFactory.py`)
- PDU factory → Binary streams: uses streams (evidence: `opendis/PduFactory.py`)
- DIS 7 PDUs → Record registry and exports: imports records (evidence: `opendis/dis7.py`)
- DIS 7 PDUs → Record interfaces: uses record base (evidence: `opendis/dis7.py`)
- DIS 7 PDUs → Binary streams: serializes through (evidence: `opendis/dis7.py`)
- Record registry and exports → Common records: exports records (evidence: `opendis/record/__init__.py`)
- Record registry and exports → Radio records: exports records (evidence: `opendis/record/__init__.py`)
- Record registry and exports → Warfare records: exports records (evidence: `opendis/record/__init__.py`)
- Record registry and exports → Symbolic constants: imports constants (evidence: `opendis/record/__init__.py`)
- Common records → Record interfaces: uses interfaces (evidence: `opendis/record/common.py`)
- Common records → Bitfield codec: uses bitfields (evidence: `opendis/record/common.py`)
- Common records → Binary streams: reads and writes (evidence: `opendis/record/common.py`)
- Common records → Symbolic constants: uses constants (evidence: `opendis/record/common.py`)
- Radio records → Record interfaces: uses interfaces (evidence: `opendis/record/radio/__init__.py`)
- Radio records → Bitfield codec: uses bitfields (evidence: `opendis/record/radio/__init__.py`)
- Warfare records → Record interfaces: uses interfaces (evidence: `opendis/record/warfare/__init__.py`)
- Warfare records → Bitfield codec: uses bitfields (evidence: `opendis/record/warfare/__init__.py`)
- Warfare records → Warfare bitfields: uses flags (evidence: `opendis/record/warfare/__init__.py`)
- Warfare records → Radio records: uses radio records (evidence: `opendis/record/warfare/__init__.py`)
- Warfare bitfields → Record interfaces: implements interface (evidence: `opendis/record/warfare/enums.py`)
- Warfare bitfields → Bitfield codec: packs fields (evidence: `opendis/record/warfare/enums.py`)
- Record interfaces → Binary streams: defines stream methods (evidence: `opendis/record/base.py`)
- Bitfield codec → Binary streams: reads and writes (evidence: `opendis/record/bitfield.py`)
- Binary streams → Protocol type aliases: uses aliases (evidence: `opendis/stream.py`)
