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
  • Intended for CPython 3.12

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
  • Currently targeted at CPython 3.12 rather than a broad ABI-compatible interpreter matrix

Installation

pip install py-a2lfile

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

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.6

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.6
File Size Uploaded
py_a2lfile-0.0.6.tar.gz 27.6 kB Details

Built distributions (wheels)

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

Total release size: 2.2 MB

Release files / py_a2lfile-0.0.6.tar.gz

Download URL py_a2lfile-0.0.6.tar.gz
Size 27.6 kB
Tags Source
SHA-256 checksum
How to use checksums
55edc821b6571611d7a48d073692ae5db39cb5f1e21b0a717746fe203069ec5b
BLAKE2b-256 checksum
How to use checksums
746c23e4990cf019d0759ea6f2bc7ff7e9a973c92ba1a21541bc01c540543238
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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.6-cp312-cp312-win_amd64.whl

Download URL py_a2lfile-0.0.6-cp312-cp312-win_amd64.whl
Size 620.7 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
9409ff612dfe866c48bab6e2ed4907b3c743ffdc714bfd5930c89c0242321485
BLAKE2b-256 checksum
How to use checksums
c36a0b7fd7bd3c5db90b102ebf7abd483e2d3e9281356a010c26bd5d3ed83f58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL py_a2lfile-0.0.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 805.3 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
cb5c212cb97688423b6ad1ea7ff56e674219f00af6ec8bf795a08f48c09ae034
BLAKE2b-256 checksum
How to use checksums
bd5c28fa373ae7e0f39df6a0ea02bc128dbb4b7d2776fc0d50142fcbcc5e6bbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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.6-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL py_a2lfile-0.0.6-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 756.6 kB
Tags CPython 3.12 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
33af2852819e8291d64ce4c9416a3fd41ab0640c1e466df1d55e26e1e5eb8e10
BLAKE2b-256 checksum
How to use checksums
759a69ea75c5edf0849efeb4a520fc9a9299e15a09a929da32420433c4860b8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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

0.0.9

4 release files

0.0.8

4 release files

0.0.7

4 release files

This release

0.0.6 This release

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