Skip to main content

The parser for EB XDM file

Project description

py-eb-model

Python parser engine for EB Tresos XDM (XML Data Model) files used in AUTOSAR automotive software development. Extracts configuration data from proprietary XML formats and exports to Excel for analysis and reporting.

Features

  • 50+ Module Support: Covers core AUTOSAR modules including OS, RTE, NvM, EcuC, and communication stacks
  • Unified CLI: Single eb-convert command with auto-detection of module types
  • Batch Processing: Convert multiple XDM files in one operation
  • Standards Compliant: ISO/IEC/IEEE 29119 compliant testing and requirements traceability
  • Enterprise Ready: Comprehensive documentation, requirements traceability, and integration testing

Installation

pip install py_eb_model

Quick Start

Convert XDM to Excel

# Convert a single file
eb-convert Os.xdm output/

# Convert multiple files
eb-convert Os.xdm NvM.xdm Rte.xdm output/

# With verbose logging
eb-convert --verbose Os.xdm output/

# With file logging
eb-convert --log conversion.log Os.xdm output/

Auto-Detection

The CLI automatically detects module type from the XDM file's MODULE-CONFIGURATION tag. No need to specify module names - they're extracted from the file itself.

Output

For each input file, an Excel file is generated in the output directory:

  • Os.xdmoutput/Os.xlsx
  • NvM.xdmoutput/NvM.xlsx
  • Rte.xdmoutput/Rte.xlsx
  • etc.

Supported Modules

Core Modules

  • Os: Operating System configuration (tasks, ISRs, resources, schedule tables, counters)
  • Rte: Runtime Environment configuration (entities, events, data mappings)
  • NvM: Non-Volatile Memory manager (block descriptors, datasets)
  • EcuC: ECU Configuration (partitions, core definitions)
  • BswM: Basic Software Mode manager
  • Tm: Trigger Manager
  • PbcfgM: Port Configuration Manager
  • EcuM: ECU State Manager
  • Det: Development Error Tracer

Communication Stacks

  • CAN Stack: CanIf, CanNm, CanSM, CanTp
  • LIN Stack: LinIf, LinSM, LinTp
  • FlexRay Stack: FrIf, FrNm, FrSM, FrTp, FrArTp
  • Ethernet Stack: EthIf, EthSM, TcpIp, SoAd, UdpNm, DoIP, SomeIpTp

Communication Modules

  • Com: Communication layer
  • ComM: Communication Manager
  • PduR: PDU Router
  • IpduM: IPDU Manager
  • LdCom: Low-Level COM
  • Nm: Network Management
  • Crc: Cyclic Redundancy Check

Memory Modules

  • MemIf: Memory Abstraction Interface
  • Fee: Flash EEPROM Emulation
  • Ea: EEPROM Abstraction
  • MemMap: Memory Mapping
  • MemAcc: Memory Access

Crypto/Security

  • Crypto: Cryptographic services
  • CryIf: Crypto Interface
  • Csm: Cryptographic Service Manager
  • SecOC: Secure Onboard Communication

Diagnostics/Events

  • FiM: Function Inhibition Manager
  • Dcm: Diagnostic Communication Manager
  • Dem: Diagnostic Event Manager
  • Dlt: Diagnostic Log and Trace

J1939 Stack

  • J1939Dcm: J1939 Diagnostic Communication Manager
  • J1939Nm: J1939 Network Management
  • J1939Rm: J1939 Route Manager
  • J1939Tp: J1939 Transport Protocol

Development

Building Distribution

# Build distribution
python -m build

# Verify distribution
twine check dist/*

# Upload to PyPI
twine upload dist/*

Testing

# Run all tests
pytest

# Run with coverage
pytest --cov=src/eb_model --cov-report=term-missing

# Run only unit tests
pytest -m "not integration"

# Run only integration tests
pytest -m integration

Linting

# Using ruff
ruff check .

# Using flake8
flake8 . --max-line-length=150 --ignore=F401,W293,F403

CLI Options

eb-convert

eb-convert <input.xdm> [<input2.xdm> ...] <output_dir/> [options]

Options:

  • -v, --verbose: Enable verbose (DEBUG) logging
  • --log LOG: Log file path for file-based logging
  • --skip-os-task: Skip generating Os task (OS module only)

Legacy Commands

The following legacy commands are still available but deprecated:

  • os-xdm-xlsx, rte-xdm-xlsx, nvm-xdm-xlsx, ecuc-xdm-xlsx (core modules)
  • bswm-xdm-xlsx, tm-xdm-xlsx, pbcfgm-xdm-xlsx, ecum-xdm-xlsx, det-xdm-xlsx (system)
  • 52+ additional module-specific commands

Please migrate to eb-convert for new usage.

PrefSystemImporter

Reads EB preference XDM and generates ARXML file lists or AUTOSAR builder projects.

pref-system-importer [options] INPUTS [INPUTS ...] OUTPUT

Key Options:

  • --base-path BASE_PATH: Base path for EB tresos project
  • --file-list: Generate ARXML file list (default)
  • --ab-project: Generate AUTOSAR builder project
  • --project PROJECT: Project name for AUTOSAR builder project
  • --env ENV [ENV ...]: Specify environment variables

Example:

# Generate ARXML file list
pref-system-importer --base-path /path/to/project .prefs/pref_imp_exp_Imp_System.xdm output.lst

# Generate AUTOSAR builder project
pref-system-importer --base-path /path/to/project --ab-project --project MyProject .prefs/pref_system.xdm .project

Documentation

Change History

Version 1.3.0

Major Release - Complete XDM Model Coverage

  1. CLI Refactoring

    • Unified eb-convert command replacing 52+ module-specific CLI commands
    • Auto-detection of module types from XDM files
    • Batch processing support for multiple files
    • Enhanced logging with file and console output
  2. Module Expansion

    • Added J1939 stack: J1939Dcm, J1939Nm, J1939Rm, J1939Tp
    • Added diagnostic stack: FiM, Dcm, Dem, Dlt
    • Added crypto/security stack: Crypto, CryIf, Csm, SecOC
    • Added memory stack: MemIf, Fee, Ea, MemMap, MemAcc, Crc
    • Added communication stack: Com, LdCom, PduR, IpduM, Nm, ComM
    • Added Ethernet and FlexRay communication stack modules
  3. Testing Improvements

    • Integration tests for XDM file parsing
    • ISO/IEC/IEEE 29119 compliant test documentation
    • Test reorganization following modern Python layout
    • Expanded test coverage for new modules
  4. Documentation

    • Requirements traceability matrix linking code to SWR documents
    • Comprehensive CLI usage documentation
    • Enterprise-standard software requirements documentation
    • Architecture design specifications
  5. Code Quality

    • Migration from setup.py to pyproject.toml
    • Type annotations throughout codebase
    • Linting tooling configuration (ruff, flake8)
    • Code quality improvements and bug fixes
    • Import hygiene improvements with explicit imports
  6. Infrastructure

    • Parser-writer registry with auto-discovery
    • CLI options registry for module-specific arguments
    • Modern Python project layout with src/ directory
    • Enhanced error handling and logging

Version 1.2.3

  1. Implement OsApplication parser.

Version 1.2.2

  1. Fix TARGET of EcucPartitionSoftwareComponentInstanceRef is empty and skipped to added.

Version 1.2.1

  1. Read EcucPartition from EcuC.xdm
  2. Read EcucPartitionSoftwareComponentInstanceRef from EcuC.xdm

Version 1.2.0

  1. Fix AbstractEbModelParser::_convert_value error.
  2. Add structure for Ecuc.xdm and BswM.xdm.

Version 1.1.9

  1. Parse OsAppAlarmRef List of OsApplication
  2. Parse OsAppCounterRef List of OsApplication
  3. Parse OsAppScheduleTableRef Lis of OsApplication
  4. Add read_eb_origin_value method to read optional EB extended configuration
  5. Fix OsIsrPriority and OsIsrVector issue.

Version 1.1.8

  1. Support to read NvM configuration from EB tresos Xdm file
  2. Export NvM Configuration to excel file.

Version 1.1.7

  1. Solve case issue of read_optional_value enables attribute.
  2. Support to read IMPORT_INFO for OsResource.
  3. Add test cases for OsXdmParser.

Version 1.1.6

  1. Add OsResource support in Os Module:
    • Os::getOsResourceList
    • Os::addOsResource
  2. Read NvMBlockDescriptor List

Version 1.1.5

  1. Add new interfaces to support to get the instance by name:
    • Rte::getRteBswModuleInstance
    • Rte::getRteBswModuleInstance

Version 1.1.4

  1. Fix incorrect attribute of osTaskAutostart.
  2. Add isOsTaskAutostart method to get enabled flag of osTaskAutostart.
  3. Add flake8 change rules.

Version 1.1.3

  1. Support to read Isr Priority and Vector for R52+ core.
  2. Export Isr Priority and Vector to Excel.
  3. Read OsAppResourceRef, OsAppIsrRef from OsApplication.

Version 1.1.2

  1. Read OsAppTaskRef from OsApplication.

Version 1.1.1

  1. Add support to append SystemMod/EcuExtract.arxml into list automatically for PrefSystemImporter.

Version 1.0.3

  1. Generate System import file list based on EB preference Xdm.
  2. Add support to read OsTaskAutostart element.
  3. Add support to read OsTaskType element.

Version 1.0.2

  1. Fix setOsAlarmCallbackName bug

Version 1.0.1

  1. Change attribute to start with lowercase
  2. read_ref_value and read_optional_ref_value method returns EcucRefType.
  3. Read OsScheduleTable and export to excel
  4. Read OsCounter and export to excel

Version 0.8.0

  1. Create basic model for EB xdm. (Issue #1)
  2. Support to extract Os Tasks/Isrs from EB xdm and store them in excel files. (Issue #1)

License

MIT License - see LICENSE file for details

Links

Project details


Download files

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

Source Distribution

py_eb_model-1.3.0.tar.gz (148.9 kB view details)

Uploaded Source

Built Distribution

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

py_eb_model-1.3.0-py3-none-any.whl (289.1 kB view details)

Uploaded Python 3

File details

Details for the file py_eb_model-1.3.0.tar.gz.

File metadata

  • Download URL: py_eb_model-1.3.0.tar.gz
  • Upload date:
  • Size: 148.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for py_eb_model-1.3.0.tar.gz
Algorithm Hash digest
SHA256 b67350a22b1d15f92fe93df59425e04513d6d014956901dd4cea848326fc0c7c
MD5 d2f28bb6734678f390d79b6b2eddcbfa
BLAKE2b-256 73c1704dfb208f3beb598350885e68cbbc9f34607dc775624a62b094022733df

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_eb_model-1.3.0.tar.gz:

Publisher: python-publish.yml on melodypapa/py-eb-model

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_eb_model-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: py_eb_model-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 289.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for py_eb_model-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5855b0f75e6213de825267be07e52a39c84396a04c8500c9d2a3a1732266f7f7
MD5 32bc69336be3a0fb14b956659874861f
BLAKE2b-256 44ef17d0ea1cf40048cf815cb855991d6af87fe6c55a9cc35df1603108484e00

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_eb_model-1.3.0-py3-none-any.whl:

Publisher: python-publish.yml on melodypapa/py-eb-model

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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