Skip to main content

py-a2lfile

CI license

py-a2lfile is a Python wrapper around the Rust crate a2lfile. It provides a small, read-only API for loading and inspecting A2L files from Python while relying on the upstream Rust implementation for parsing performance and stability.

Current Capabilities

  • Parse A2L content from a file path with a2lfile.load(...)
  • Parse A2L content directly from a string with a2lfile.load_from_string(...)
  • Inspect modules and measurements through a small, read-only Python API
  • Access conversion metadata including COMPU_METHOD, COMPU_TAB, COMPU_VTAB, and COMPU_VTAB_RANGE
  • Resolve references from measurements to conversion tables and engineering units
  • Inspect module-level metadata such as MOD_COMMON, MOD_PAR, and unit definitions
  • Traverse generic IF_DATA, including tagged structures used for XCP-oriented extraction
  • Access detailed measurement metadata such as annotations, bit operations, addresses, refresh information, symbol links, and virtual channels
  • Stable and fast parsing backed by the Rust a2lfile library
  • Typed distribution with _a2lfile.pyi and py.typed
  • Supports CPython 3.12, 3.13, and 3.14 using stable ABI (abi3) wheels

Limitations

  • Parse-only API; this package does not currently provide editing or write-back support
  • Intentionally small wrapper surface focused on inspection rather than full ASAP2 authoring workflows
  • Free-threaded Python builds are not covered by the published abi3 wheels

Installation

pip install py-a2lfile

The package is installed from PyPI as py-a2lfile, but imported in Python as a2lfile.

Releases provide a single cp312-abi3 wheel per platform for standard CPython 3.12–3.14 on Linux x86_64, Linux aarch64, and Windows x64. Other platforms require a source build with Rust installed.

Example

import a2lfile

a2l = a2lfile.load("example.a2l")

for module in a2l.modules:
    print(module.name)
    for measurement in module.measurements:
        print(" ", measurement.name, measurement.conversion)

Development

uv sync --dev --python python3.12
uv run maturin develop --uv
uv run pytest

Acknowledgements

This package is a Python wrapper around the Rust crate a2lfile.

Credit for the underlying A2L parsing implementation belongs to the a2lfile authors and maintainers. This wrapper exists to make that parser available from Python, because a2lfile was the most capable and well-maintained A2L parser identified for this use case.

License

Licensed under either of:

Metadata

Release files for py-a2lfile 0.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-a2lfile 0.0.9
File Size Uploaded
py_a2lfile-0.0.9.tar.gz 29.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for py-a2lfile 0.0.9
File Interpreter ABI Platform
py_a2lfile-0.0.9-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details
py_a2lfile-0.0.9-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 abi3 Linux glibc 2.17+ x86-64 Details
py_a2lfile-0.0.9-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.12 abi3 Linux glibc 2.17+ ARM64 Details

Total release size: 2.2 MB

Release files / py_a2lfile-0.0.9.tar.gz

Download URL py_a2lfile-0.0.9.tar.gz
Size 29.9 kB
Tags Source
SHA-256 checksum
How to use checksums
650cef73a59e1a4925a1da45c4391d0168cc57c9c56bbb0b4a8a096888e51c5a
BLAKE2b-256 checksum
How to use checksums
a5745bc897c877d56cc60407838bd10a697ab7afd3d5450519709e7dd1faf4ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / py_a2lfile-0.0.9-cp312-abi3-win_amd64.whl

Download URL py_a2lfile-0.0.9-cp312-abi3-win_amd64.whl
Size 628.5 kB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
9b355eef876cfc48c62fddebe2c22b85bab0031f9d01c13c07fc839203e6631d
BLAKE2b-256 checksum
How to use checksums
2616fddef2303dcf14880b9c67c138ca7f2b14dedf8c8e50eecf0f21e8e4dc35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / py_a2lfile-0.0.9-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL py_a2lfile-0.0.9-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 812.4 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
eaf6b7ef2e238e4d17aacd42b00ccae670878f56cf37ee58284f895f9ca007dc
BLAKE2b-256 checksum
How to use checksums
63333f832afcf8819e8e36f244220e80ac0e397bc4dab1555b3f8a7cb258336b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / py_a2lfile-0.0.9-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL py_a2lfile-0.0.9-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 761.4 kB
Tags CPython 3.12 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
1cbad994dd267ca3fd244b621c319eaf95ba8f78c91b413a059ce6e807ceb382
BLAKE2b-256 checksum
How to use checksums
9fac1ec93f1e936dce70a74223dd01bacfe6e87b01700f70455156bad4ec1b47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.0.9 This release

4 release files

0.0.8

4 release files

0.0.7

4 release files

0.0.6

4 release files

0.0.5

4 release files

0.0.4

4 release files

0.0.3

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page