Metadata-Version: 2.4
Name: udsdoc
Version: 0.92.0
Summary: Generate UDS (ISO 14229 / 15765) specification documents and ISO 22901-1 ODX/PDX from AUTOSAR DCM/CanTp/DEM ARXML (formerly udsxml2tex)
Author: udsdoc contributors
License: MIT
Keywords: autosar,arxml,uds,dcm,dem,cantp,iso14229,iso15765,iso22901,odx,pdx,latex,tex,diagnostics,udsxml2tex
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Manufacturing
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Documentation
Classifier: Topic :: Software Development :: Embedded Systems
Classifier: Topic :: Text Processing :: Markup :: LaTeX
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: lxml>=4.9.0
Requires-Dist: Jinja2>=3.1.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: mypy>=1.0; extra == "dev"
Requires-Dist: ruff>=0.1; extra == "dev"
Provides-Extra: web
Requires-Dist: fastapi>=0.100.0; extra == "web"
Requires-Dist: uvicorn>=0.22.0; extra == "web"
Requires-Dist: python-multipart>=0.0.6; extra == "web"
Requires-Dist: PyYAML>=6.0; extra == "web"
Requires-Dist: python-dotenv>=1.0; extra == "web"
Requires-Dist: pymupdf>=1.24; extra == "web"
Provides-Extra: yaml
Requires-Dist: PyYAML>=6.0; extra == "yaml"
Provides-Extra: svg
Requires-Dist: pymupdf>=1.24; extra == "svg"
Provides-Extra: watch
Requires-Dist: watchdog>=3.0; extra == "watch"
Provides-Extra: lsp
Requires-Dist: pygls>=1.2; extra == "lsp"
Provides-Extra: progress
Requires-Dist: tqdm>=4.65; extra == "progress"
Provides-Extra: rich
Requires-Dist: rich>=13.0; extra == "rich"
Provides-Extra: viz
Requires-Dist: matplotlib>=3.5; extra == "viz"
Requires-Dist: numpy>=1.20; extra == "viz"
Provides-Extra: llm
Requires-Dist: anthropic>=0.40.0; extra == "llm"
Requires-Dist: openai>=1.0.0; extra == "llm"
Provides-Extra: ecu-test
Requires-Dist: python-can>=4.3.0; extra == "ecu-test"
Requires-Dist: python-isotp>=2.0.0; extra == "ecu-test"
Provides-Extra: all
Requires-Dist: fastapi>=0.100.0; extra == "all"
Requires-Dist: uvicorn>=0.22.0; extra == "all"
Requires-Dist: python-multipart>=0.0.6; extra == "all"
Requires-Dist: PyYAML>=6.0; extra == "all"
Requires-Dist: python-dotenv>=1.0; extra == "all"
Requires-Dist: pymupdf>=1.24; extra == "all"
Requires-Dist: watchdog>=3.0; extra == "all"
Requires-Dist: pygls>=1.2; extra == "all"
Requires-Dist: tqdm>=4.65; extra == "all"
Requires-Dist: rich>=13.0; extra == "all"
Requires-Dist: matplotlib>=3.5; extra == "all"
Requires-Dist: numpy>=1.20; extra == "all"
Requires-Dist: anthropic>=0.40.0; extra == "all"
Requires-Dist: openai>=1.0.0; extra == "all"
Requires-Dist: python-can>=4.3.0; extra == "all"
Requires-Dist: python-isotp>=2.0.0; extra == "all"
Provides-Extra: ci-test
Requires-Dist: fastapi>=0.100.0; extra == "ci-test"
Requires-Dist: uvicorn>=0.22.0; extra == "ci-test"
Requires-Dist: python-multipart>=0.0.6; extra == "ci-test"
Requires-Dist: PyYAML>=6.0; extra == "ci-test"
Requires-Dist: python-dotenv>=1.0; extra == "ci-test"
Requires-Dist: pymupdf>=1.24; extra == "ci-test"
Requires-Dist: watchdog>=3.0; extra == "ci-test"
Requires-Dist: pygls>=1.2; extra == "ci-test"
Requires-Dist: tqdm>=4.65; extra == "ci-test"
Requires-Dist: rich>=13.0; extra == "ci-test"
Requires-Dist: matplotlib>=3.5; extra == "ci-test"
Requires-Dist: numpy>=1.20; extra == "ci-test"
Requires-Dist: anthropic>=0.40.0; extra == "ci-test"
Requires-Dist: openai>=1.0.0; extra == "ci-test"
Dynamic: license-file

# udsdoc

**AUTOSAR DCM/CanTp/DEM ARXML → UDS (ISO 14229) specification documents
(LaTeX → PDF) and ASAM ODX 2.2 / PDX (ISO 22901-1).**

[![PyPI version](https://badge.fury.io/py/udsdoc.svg)](https://badge.fury.io/py/udsdoc)
[![Python](https://img.shields.io/pypi/pyversions/udsdoc.svg)](https://pypi.org/project/udsdoc/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

`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

```bash
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).

## GUI version

```bash
udsdoc --serve            # opens http://127.0.0.1:8765
```

- **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

```bash
# 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 --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`).
- **Outputs** — `--pdf` (Tex → PDF), `--format pdx` (ISO 22901-1 PDX; also
  `html`, `md`, `rst`, `odx`).

Python API:

```python
from udsdoc import ArxmlParser, TexGenerator

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

## LLM configuration

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 as `ANTHROPIC_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"}`).

`--verify` alone runs fully offline (deterministic status / numeric / lexical
checks); add `--verify-llm` to let the LLM judge the prose-ambiguous rows.

## License

MIT
