Skip to main content

Convert AUTOSAR DCM/CanTp/DEM arxml to LaTeX UDS (ISO 14229 / 15765) specification documents and ISO 22901-1 ODX/PDX

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

udsxml2tex

AUTOSAR DCM/CanTp/DEM ARXML → ISO 14229 (UDS) / ISO 15765 / ISO 22901-1 (ODX/PDX) specification documents.

PyPI version Python License: MIT

udsxml2tex parses AUTOSAR diagnostic ARXML (DCM, CanTp, DEM, DoIP, COM, AP) and renders a complete UDS specification in LaTeX / PDF / HTML / Markdown / RST / CSV / YAML / JSON / DOCX, plus ASAM ODX 2.2.0 / PDX (ISO 22901-1) for industry diagnostic tooling.

It also ships a local browser UI (--serve) that one-clicks an entire BSW software repository through the pipeline, auto-detecting single-ECU vs multi-ECU layouts.


Install

pip install udsxml2tex                  # core (LaTeX / Markdown / JSON / YAML)
pip install udsxml2tex[web]             # browser UI (--serve) + inline TikZ-UML SVG figures
pip install udsxml2tex[llm]             # LLM analysis (Anthropic + OpenAI / Ollama)
pip install udsxml2tex[ecu-test]        # CAN/ISO-TP hardware testing
pip install udsxml2tex[all]             # everything

Other extras: yaml, svg, watch, docx, lsp, progress, rich, viz.

A LaTeX distribution (TeX Live / MiKTeX with xelatex for CJK) is required to compile generated .tex to PDF. The HTML output renders standalone. TikZ-UML diagrams in the HTML output (SID 0x10 session FSM, SID 0x27 SecurityAccess FSM and sequence) are compiled to inline SVG when xelatex plus a PDF→SVG tool are present — the [web] / [svg] extras pull in pymupdf, which provides an in-process PDF→SVG converter so no system binary (pdftocairo / dvisvgm / pdf2svg / inkscape) is required. Without the toolchain the HTML output silently falls back to Mermaid.


Quick start

# Single ARXML → LaTeX
udsxml2tex dcm.arxml -o spec.tex

# Merge DCM + CanTp + DEM
udsxml2tex dcm.arxml cantp.arxml --dem dem.arxml -o spec.tex

# Auto-discover everything under a BSW repo (CLI mirror of the browser UI)
udsxml2tex --repo /path/to/bsw-project -o spec.tex
udsxml2tex --repo /path/to/bsw-project --repo-dry-run     # show classification

# Application + Bootloader ARXMLs owned by separate teams — placed in
# parallel subtrees (app/, boot/) under the repo root. The scanner
# detects boot-domain files by path tokens (boot/, bootloader/, bl/,
# fbl/, pbl/, sbl/, *_boot*, *_bl*) and merges them into ONE spec with
# the Drive vs Boot domain tagged per session / service / DID / RID.
udsxml2tex --repo /path/to/bsw-project -o spec.tex
#   → "INFO: …merged bootloader spec (1 sessions, 1 dids, 1 routines)"

# Hand-off helper: OEM team has only a requirement-analysis CSV (RTM
# format from `udsxml2tex --rtm-csv …`) and needs a Dcm ARXML skeleton
# to give the external bootloader supplier as the contract. Generate one
# without parsing any ARXML at all:
udsxml2tex --gen-arxml-from-csv oem_boot_requirements.csv \
           --gen-arxml-output   boot_skeleton.arxml \
           --gen-arxml-ecu-name BootMcuA \
           --gen-arxml-domain   boot          # boot|drive|both|all

# Output formats
udsxml2tex dcm.arxml --format html  -o spec.html
udsxml2tex dcm.arxml --format md    -o spec.md
udsxml2tex dcm.arxml --format pdx   -o ecu.pdx            # ISO 22901-1 PDX
udsxml2tex dcm.arxml --pdf                                 # compile to PDF

# Multi-language output:
#   --lang en+ja+de   → ONE document with stacked translations (browser UI default)
#   --langs en,ja,de  → one document per language (legacy multi-file mode)
udsxml2tex dcm.arxml --lang en+ja+de  -o spec.tex
udsxml2tex dcm.arxml --langs en,ja,de -o spec.md --format md

# Validation, diff, multi-ECU systems
udsxml2tex dcm.arxml --validate
udsxml2tex new.arxml --diff old.arxml
udsxml2tex --system system.yaml --system-output-dir out/   # 1+1 / gateway

# Browser UI
udsxml2tex --serve                                         # http://127.0.0.1:8765

Python API

from udsxml2tex import ArxmlParser, TexGenerator, validate, diff_specs

spec = ArxmlParser().parse_multi(["dcm.arxml", "cantp.arxml"])
TexGenerator().generate(spec, "spec.tex")
TexGenerator().compile_pdf("spec.tex")

print(validate(spec).summary())                # ISO 14229-1 consistency
print(diff_specs(spec_a, spec_b).to_markdown())

Features

Coverage

  • DCM (ISO 14229-1) — sessions, security, all 26 standard services, DIDs, routines, DTCs, memory ranges, IO control / periodic / dynamic DIDs, Authentication, ResponseOnEvent, LinkControl, multi-client.
  • CanTp (ISO 15765-2) — channels, BS/STmin, N_As/Bs/Cs/Ar/Br/Cr, addressing.
  • DEM (ISO 14229-1 §11) — DTC config, OBD/WWH-OBD, freeze frames, extended data, operation cycles, indicators, combined DTCs.
  • DoIP (ISO 13400), Communication ARXML, Adaptive Platform service interfaces.
  • C/C++ source scanning — DID/RID global variables (transitive depth ≤3).
  • Bootloader overlay — single document covering Drive + Boot domains via YAML.

Output

  • tex (Jinja2 + structured ZIP), pdf (xelatex/latexmk), html (multi-page ZIP with offline Mermaid + NRC ladders), md, rst, csv, yaml, json, docx, odx, pdx.
  • Visualizations: heatmaps, timing diagrams, UML sequences, byte-level DID maps, session/security FSMs.

Requirements Traceability (ASPICE SYS.2.BP4 / ISO 26262-8 §6.4.5)

  • --rtm CSV [CSV ...] + --rtm-sources YAML — append a Requirements Traceability Matrix chapter to the LaTeX/PDF output that joins each upstream requirement against the parsed ARXML (SID / DID / RID / DTC / session / security level). Resolved coverage % is computed and shown; unresolved rows are flagged with an asterisk.

Quality

  • --validate — 17 ISO 14229-1 consistency checks.
  • --diff — semantic spec diff (ARXML or JSON).
  • --iso-version {2006,2013,2020} — drop features outside the chosen revision.
  • --autosar-compat-report — flag features postdating the detected AUTOSAR release.
  • Schema export: JSON Schema (draft-07), Pydantic v2 model source.

LLM analysis ([llm] extra)

  • --llm-summarize, --llm-query, --llm-nrc-descriptions, --llm-translate.
  • Backends: Anthropic Claude API or any OpenAI-compatible server (Ollama, llama.cpp, vLLM, OpenRouter, Azure). One-shot setup: udsxml2tex --bootstrap-ollama (Linux/macOS).

ECU hardware testing ([ecu-test] extra)

  • Auto-generates UDS test cases from the parsed spec, executes over CAN / ISO-TP via python-can. Heuristic generator or formal --ecu-formal state-machine explorer (all-transitions coverage). HTML / JUnit XML / CSV / coverage reports.

Multi-ECU systems

  • Declarative YAML config (--system) for redundant / gateway-with-forwarder topologies, per-ECU spec + integration document, ARXML coverage-gap routing inference, cross-ECU validator.

Browser UI (--serve, [web] extra)

  • Local FastAPI server with five sidebar tabs:
    • Generate — pick a BSW repository folder; the server uploads UDS-relevant files (.arxml, .c, .h, .yaml, .json), classifies each ARXML by AUTOSAR module, auto-detects single vs multi-ECU, and generates the chosen format. format=tex ZIPs include a compiled spec.pdf when xelatex is on PATH; otherwise the UI flags the failure (and the ZIP carries a PDF_NOT_COMPILED.txt with the underlying reason). Optional Requirements Traceability Matrix (RTM) CSV upload (ASPICE SYS.2.BP4 / ISO 26262-8 §6.4.5 — DOORS-style) appends a per-row traceability chapter with LaTeX \cite{} references; a Load sample bundle button materialises a complete demo repo + two RTM CSVs server-side for a one-click pipeline preview.
    • Spec — parsed SID / NRC / DID / RID / DTC tables shown after a successful Parse & Preview.
    • Chat — multi-turn LLM Q&A with streaming responses (Anthropic Claude API / Ollama / OpenAI-compatible). Installed Ollama / OpenAI models are auto-detected, and host RAM is read server-side to recommend a model size class.
    • UDS Workbench — interactive UDS request simulator (no hardware required), CAN trace log analyzer (ASC / BLF), one-click ODX / PDX export for CANalyzer & CANoe, and a collapsible hardware-in-the-loop test runner for CAN / ISO-TP campaigns.
    • About — version, links, feature list.

Tooling

  • Interactive wizard (-I), config files (--config), file watching (--watch), parallel parse, incremental cache, XSD validation, pytest plugin (uds_spec fixture), LSP server, shell completion, plugin system (ParserPlugin / GeneratorPlugin), i18n (en / de / ja with bilingual --lang ja+en mode + multi-language --langs en,ja,de).

Distribution

  • Docker image (TeX Live + udsxml2tex[all]).
  • GitHub Action (Marketplace-ready).
  • pre-commit hooks (validate / regen PDF / regen TeX ZIP).
  • VS Code extension (right-click .arxml → generate / validate / diff / LLM).

Documentation


Requirements

  • Python ≥ 3.9
  • lxml ≥ 4.9, Jinja2 ≥ 3.1
  • LaTeX with xelatex (TeX Live / MiKTeX) for PDF output

License

MIT

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

udsxml2tex-0.61.13.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

udsxml2tex-0.61.13-py3-none-any.whl (1.8 MB view details)

Uploaded Python 3

File details

Details for the file udsxml2tex-0.61.13.tar.gz.

File metadata

  • Download URL: udsxml2tex-0.61.13.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for udsxml2tex-0.61.13.tar.gz
Algorithm Hash digest
SHA256 6b0455597434beeede0d589889a6862a4943cab7b7f9da573700383ff124e231
MD5 7bfd00695e10fdcfe0277acc25066a08
BLAKE2b-256 370583099b11b4a38c270e864a8a3a7214b1136783007c4f414ca2e0cf342877

See more details on using hashes here.

File details

Details for the file udsxml2tex-0.61.13-py3-none-any.whl.

File metadata

  • Download URL: udsxml2tex-0.61.13-py3-none-any.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for udsxml2tex-0.61.13-py3-none-any.whl
Algorithm Hash digest
SHA256 a0841ac6dc80dc2fbb2bbe5542bea93519aacb3b035eaf5a9eaa90ce67b26ea6
MD5 266371939bb76937c059fd8e2a52b600
BLAKE2b-256 86f3fecf1dacf3c2ee0b82b6349270c9ab30528e0368b03747e63aa0beca37fd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page