Metadata-Version: 2.4
Name: udsxml2tex
Version: 0.1.0
Summary: Convert AUTOSAR DCM arxml to LaTeX UDS specification documents
Author: udsxml2tex contributors
License: MIT
Project-URL: Homepage, https://github.com/udsxml2tex/udsxml2tex
Project-URL: Repository, https://github.com/udsxml2tex/udsxml2tex
Keywords: autosar,arxml,uds,dcm,latex,tex,diagnostics
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
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: Topic :: Software Development :: Documentation
Classifier: Topic :: Text Processing :: Markup :: LaTeX
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"
Dynamic: license-file

# udsxml2tex

**Convert AUTOSAR DCM arxml to LaTeX UDS specification documents**

A Python library that parses AUTOSAR DCM (Diagnostic Communication Manager) arxml configuration files and automatically generates ISO 14229 (UDS: Unified Diagnostic Services) specification documents in LaTeX format.

## Features

- Automatically extracts UDS specification data from DCM arxml files
  - Diagnostic sessions
  - Security access levels
  - UDS service list (SID, supported sessions, NRCs, etc.)
  - DID (Data Identifier) definitions
  - Routine Control definitions
- Generates professional LaTeX specification documents
- Customizable via Jinja2 templates
- Available as both a CLI command and a Python API
- Supports merging multiple arxml files

## Installation

```bash
pip install udsxml2tex
```

From source (for development):

```bash
git clone https://github.com/udsxml2tex/udsxml2tex.git
cd udsxml2tex
pip install -e ".[dev]"
```

## Usage

### CLI

```bash
# Basic conversion
udsxml2tex input.arxml

# Specify output file
udsxml2tex input.arxml -o output.tex

# Override ECU name
udsxml2tex input.arxml --ecu-name "MyECU"

# Merge and convert multiple files
udsxml2tex dcm_config.arxml dcm_dids.arxml -o merged_spec.tex

# Verbose logging
udsxml2tex input.arxml -v
```

### Python API

```python
from udsxml2tex import ArxmlParser, TexGenerator

# Parse ARXML
parser = ArxmlParser()
spec = parser.parse("path/to/dcm_config.arxml")

# Generate LaTeX
generator = TexGenerator()
generator.generate(spec, "output/uds_spec.tex")

# Get as string
tex_content = generator.generate_string(spec)
```

### Custom Templates

You can use your own LaTeX templates:

```python
generator = TexGenerator(template_dir="my_templates/")
generator.generate(spec, "output.tex", template_name="custom.tex.j2")
```

```bash
udsxml2tex input.arxml --template-dir my_templates/ --template custom.tex.j2
```

## Generated Document Structure

1. **Title Page** — ECU name, date
2. **Table of Contents**
3. **Document Overview** — Protocol information, CAN IDs
4. **Diagnostic Sessions** — Session list (ID, P2/P2* timers)
5. **Security Access** — Security level list
6. **UDS Services** — Service overview + detailed per-service info (including NRCs)
7. **DID Definitions** — DID overview + data element details
8. **Routine Control** — Routine overview + parameter details

## Supported arxml Structure

The following AUTOSAR DCM configuration elements are parsed:

| Element | Description |
|---------|-------------|
| `DcmDsl` | Diagnostic Session Layer (protocol, timing) |
| `DcmDsp` | Diagnostic Service Processing (sessions, security, DIDs, routines) |
| `DcmDsd` | Diagnostic Service Dispatcher (service table) |

Supports AUTOSAR R4.x arxml format.

## Requirements

- Python >= 3.9
- lxml >= 4.9.0
- Jinja2 >= 3.1.0
- LaTeX distribution (for compiling the generated .tex files)

## License

MIT License
