ldfparser
LDF Language support for Python
What it is and what it does
ldfparser reads LIN Description Files and extracts their signal and frame metadata, then uses those definitions to encode raw signal values into binary messages and decode binary messages back into signal dictionaries. It implements the LIN protocol standards (1.3, 2.0, 2.1, 2.2A) and provides both programmatic and command-line interfaces for working with LDF files.
The package depends on lark for parsing, bitstruct for bit-level encoding/decoding, and jinja2 for templating. It is designed for automotive and embedded systems work where LIN bus communication requires translating between human-readable signal names and their binary representations. The library is still pre-release, so breaking changes can occur between minor versions; production use should pin to a specific version and test before upgrading.
Use it for:
- Decode raw CAN/LIN bus messages captured from a vehicle into human-readable signal values for analysis or logging.
- Encode signal commands (e.g., motor RPM, fan state) into binary frames for transmission over a LIN bus.
- Extract signal definitions and metadata from LDF files to build protocol documentation or validation tools.
- Validate LDF file syntax and semantic correctness before using it in production automotive systems.
- Automate conversion between LDF and other formats (e.g., JSON) for integration with external tools.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses LIN Description Files (LDF) to extract signal and frame definitions, and encodes/decodes messages according to those definitions.
Yes, if you work with LIN bus protocols and LDF files in automotive or embedded contexts. The package has low install friction, permissive licensing, and no known vulnerabilities. However, be aware that maintenance is aging (last release 564 days ago) and the library is pre-release, so pin versions in production and test upgrades carefully. Not relevant for general-purpose Python development.
Install
ldfparser on PyPI
pip
pip install ldfparseruv
uv add ldfparserpoetry
poetry add ldfparserInstalling ldfparser
Before you install
Low install friction with three straightforward dependencies (lark, bitstruct, jinja2). Maintenance status is aging—last release was 564 days ago—so expect slower response to issues, though the repository remains active and not archived.
License in practice
MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely provided you include the original license notice.
Quickstart
pip install ldfparser
import ldfparser
ldf = ldfparser.parse_ldf(path="network.ldf")
frame = ldf.get_unconditional_frame('Frame_1')
message = frame.encode_raw({"Signal_1": 123, "Signal_2": 0})
Requires a valid LDF file; the library is in pre-release state, so breaking changes may occur between minor versions—pin to exact version in production.
Verify before relying
- Whether the library successfully parses all real-world LDF files that conform to LIN 1.3, 2.0, 2.1, or 2.2A standards, or if compatibility gaps remain.
- Current state of checksum calculation for frames (listed as a known missing feature in the description).
- Stability and completeness of the experimental LDF save-to-file feature.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,<4) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — lark, bitstruct, jinja2 |
| Maintenance | aging — 564 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,399,749/month — #3,953 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ldfparser-0.26.0-py3-none-any.whl
Keywords: LIN, LDF
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
bbpbDecode and re-encode Protocol Buffer messages…
permissive · top 15,000 on PyPI
cantoolsCantools parses automotive CAN bus database…
permissive · top 5,000 on PyPI
asammdfasammdf parses, edits, and exports ASAM MDF…
copyleft · top 5,000 on PyPI
rf-protocolsDecodes and encodes radio frequency signals for…
permissive · top 15,000 on PyPI
odxtoolsodxtools parses and processes ODX (Open…
permissive · top 5,000 on PyPI
canmatrixCanmatrix parses, manipulates, and converts CAN…
permissive · top 5,000 on PyPI
pylzsspylzss decodes and encodes data compressed with…
copyleft · top 15,000 on PyPI
decordDecord decodes video and audio files with…
permissive · top 5,000 on PyPI
pamqppamqp encodes and decodes AMQP 0-9-1 protocol…
permissive · top 5,000 on PyPI
pylspciParses the output of the lspci command to…
copyleft · top 15,000 on PyPI