udsdoc
AUTOSAR DCM/CanTp/DEM ARXML → UDS (ISO 14229) specification documents (LaTeX → PDF) and ASAM ODX 2.2 / PDX (ISO 22901-1).
udsdoc turns AUTOSAR diagnostic ARXML into a complete UDS specification and
into ODX/PDX for diagnostic tooling. It offers two front-ends over the same
pipeline: a GUI (local browser app) and a CLI (headless, CI/HPC-friendly).
Install
pip install udsdoc # CLI core (LaTeX / Markdown / RST / ODX / PDX)
pip install udsdoc[web] # GUI (udsdoc --serve)
pip install udsdoc[all] # everything (GUI + LLM verify + ECU testing)
PDF output needs a LaTeX distribution with xelatex (TeX Live / MiKTeX).
No pip on the target machine? Grab the self-contained udsdoc.pyz from
Releases — it runs with
just a Python interpreter (python3 udsdoc.pyz input.arxml -o spec.tex).
GUI version
udsdoc --serve # opens http://127.0.0.1:8765
The no-install static browser edition also generates LaTeX/PDX and performs local compliance analysis entirely in the tab. Its Pyodide runtime, Python wheels, WebLLM runtime, and odx-rs WASM are self-hosted and available offline after the first successful load.
- Inputs — on the Generate tab, pick a BSW repository folder (or a built-in sample). It auto-discovers the ARXML (Dcm / CanTp / Dem) and the C sources; attach an optional Compliance Matrix CSV (+ a sources YAML) for a requirements-compliance chapter.
- Outputs — Generate & Download a LaTeX ZIP that includes a compiled
spec.pdf(Tex → PDF), or Export ODX / PDX for CANalyzer / CANoe. - LLM — the LLM tab connects the provider used by Verify
Conditionally-Accepted comments: Claude (browser sign-in), ChatGPT /
Gemini (paste an API key — the button opens the key page for you), or
local Ollama (pick or install an open-source model). Credentials are
stored locally under
~/.udsdoc/.
CLI version
# ARXML in → LaTeX + compiled PDF out
udsdoc dcm.arxml cantp.arxml --dem dem.arxml --pdf -o spec.tex
# auto-discover a whole BSW repo (ARXML + C sources)
udsdoc --repo /path/to/bsw-project --pdf -o spec.tex
# DID / RID C sources for variable cross-referencing
udsdoc dcm.arxml --c-source did.c --c-source rid.c -o spec.tex
# Compliance Matrix + verify the concluded OEM↔supplier dialogue vs. the
# implementation, emit ISO 22901-1 PDX
udsdoc dcm.arxml --dem dem.arxml \
--compliance-matrix matrix.csv --verify --verify-mini \
--format pdx -o out/spec
- Inputs — ARXML as positional arguments (+
--dem), or a whole repository via--repo; C sources via--c-source; requirements via--compliance-matrix(+--compliance-matrix-sources). The matrix loader accepts the classicreq_id/description/source_ref/traces_tocontract and real-world OEM/DOORS exports (ID / ObjectType_<proj> / … / CONTENT / AcceptanceState_<proj> / CommentToCustomer_<proj> / Comment_Customer_<proj> / Final_Agreement_Status) — the per-project header tag (_ZFLSRM, …) is stripped automatically, heading/information rows are skipped, andFinal_Agreement_Statusis honored as the negotiation state (see thecompliance_matrixmodule docstring for the full mapping). - Outputs —
--format pdf/--pdf(Tex → PDF),--format pdx(ISO 22901-1 PDX; alsotex,tex-zip— the structured multi-file LaTeX project as a ZIP —html,md,rst,odx). Exit codes: 0 ok / 1 runtime error / 2 usage error / 3 quality gate (--verify-strict,--validate,--odx-strict).
Python API:
from udsdoc import ArxmlParser, TexGenerator
spec = ArxmlParser().parse_multi(["dcm.arxml", "cantp.arxml"])
TexGenerator().generate(spec, "spec.tex")
Compliance verification
Verification is a local-first evidence pipeline:
--verifyruns deterministic status, trace, numeric, access, and lexical checks with no network access.--verify-miniadds the opt-in, dependency-freeudsdoc-mini-semantic-v1tier. It uses issue-scoped dialogue chronology, exact parsed-spec evidence, and mandatory abstention.--verify-llmsends only the unresolved residue to the configured model.
Missing SID/DID/RID/DTC/session/security traces can be inferred from explicitly
anchored English or Japanese text. Bare hexadecimal values are ignored, and
every inferred trace retains confidence and source evidence. The frozen
90-row compact-model benchmark measures 64.4% coverage, 91.4% accuracy on
covered rows, 80.0% deviation precision, and 40.0% deviation recall. The low
recall is why uncertain remains a first-class review outcome.
The Verify feature (does the concluded OEM↔supplier dialogue match the implementation?) works with Anthropic (Claude), any OpenAI-compatible endpoint (OpenAI, Gemini's OpenAI-compatible API, OpenRouter, …) or local Ollama. Configure it once, whichever way suits you:
- GUI — the LLM tab: sign in with Claude, paste a ChatGPT / Gemini key, or pick an Ollama model.
- Env vars —
UDSDOC_LLM_PROVIDER,UDSDOC_LLM_MODEL,UDSDOC_LLM_BASE_URL,UDSDOC_LLM_API_KEY(or a provider-native key such asANTHROPIC_API_KEY/OPENAI_API_KEY/GEMINI_API_KEY). - CLI flags —
--llm-provider,--llm-model,--llm-base-url,--llm-api-key, or--llm-config <file>. - Config file —
~/.udsdoc/llm.json({"provider", "model", "base_url", "api_key", "timeout"}).
The static browser edition does not expose remote API-key providers. It can
send uncertain rows to Ollama at the fixed loopback endpoint
127.0.0.1:11434, or run a consent-loaded WebLLM model in the browser. Model
weights are not bundled. See the local-AI architecture and privacy
contract for data-flow, offline, grounding,
and reproducible benchmark details.
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file udsdoc-0.170.3.tar.gz.
File metadata
- Download URL: udsdoc-0.170.3.tar.gz
- Upload date:
- Size: 2.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f7abad58f74ebaa742d62a7b6a52809b5db5248b3e957c4866e5f0e7876c07a
|
|
| MD5 |
0ced0e808738cceb8acae871fd8f5f67
|
|
| BLAKE2b-256 |
bed6b439edcaeee679673c77d7aa53a219bf847999c62ab88fdd1b2372951e9f
|
File details
Details for the file udsdoc-0.170.3-py3-none-any.whl.
File metadata
- Download URL: udsdoc-0.170.3-py3-none-any.whl
- Upload date:
- Size: 2.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5a986e743cb1eb197ff281ef57c0e2a527cbb80f9d4a4428ee1324a41cf63fa
|
|
| MD5 |
deb8f56cd79b364bed1b42f7a88d693e
|
|
| BLAKE2b-256 |
36f07cf2656039c382939d89fb82eb27aed3b96f6ea4fe194e96af08625e5cd2
|