Skip to main content

LDF Language support for Python

Project description

LDF Parser

Workflow License

This tool is able parse LIN Description Files, retrieve signal names and frames from them, as well as encoding messages using frame definitions and decoding them.


Example

import ldfparser

# Load LDF
ldf = ldfparser.LDF(path = "network.ldf")
frame = ldf.frame('Frame_1')

# Encode signal values into frame
message = frame.raw({"Signal_1": 123, "Signal_2": 0})
print(binascii.hexlify(message))
# >> 0x7B00

# Decode message into dictionary of signal names and values
received = bytearray([0x7B, 0x00])
print(frame.parse(received))
# >> {"Signal_1": 123, "Signal_2": 0}

# Encode signal values through converters
message = frame.data({"MotorRPM": 100, "FanState": "ON"}, ldf.converters)
print(binascii.hexlify(message))
# >> 0xFE01

Features

  • Semantic validation of LDF files

  • Retrieve Signal and Frame information

  • Retrieve Signal encoding types and use them to convert values

Currently not supported

  • Header information

  • Signals longer than 16 bits

  • Ascii and BCD signal values

  • Node attributes

  • Scheduling table

  • Diagnostics


Installation

Install via pip install ldfparser


Credits

Inspired by uCAN-LIN LinUSBConverter, specifically the LDF parsing mechanism via Lark


License

License

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

ldfparser-0.2.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distributions

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

ldfparser-0.2.0-py3.6.egg (18.0 kB view details)

Uploaded Egg

ldfparser-0.2.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file ldfparser-0.2.0.tar.gz.

File metadata

  • Download URL: ldfparser-0.2.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.12

File hashes

Hashes for ldfparser-0.2.0.tar.gz
Algorithm Hash digest
SHA256 36702ce663c2878ece8bb3e91ee37f826e4ad0ddcea93321ec74173354907c7d
MD5 f04066ac30d44e9397f2cc855df99be4
BLAKE2b-256 4370e1748162527144f4d92d6cdea156a4d9a413e072dfecb8efd88f236e1701

See more details on using hashes here.

File details

Details for the file ldfparser-0.2.0-py3.6.egg.

File metadata

  • Download URL: ldfparser-0.2.0-py3.6.egg
  • Upload date:
  • Size: 18.0 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.12

File hashes

Hashes for ldfparser-0.2.0-py3.6.egg
Algorithm Hash digest
SHA256 5369a2347a8bbcb86fbabcef79011a530bc1614bee3909a2b859c2e5034064b7
MD5 23eea59f2f638e45127480303d88c310
BLAKE2b-256 4835a9ead6e6dbbc7243d7d8c2a4f311bda8fec3231df736e92d57016ac6951f

See more details on using hashes here.

File details

Details for the file ldfparser-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ldfparser-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.12

File hashes

Hashes for ldfparser-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6780728120c1523dd43dfc53ad7af5c6b13c4d6223691a86db2148024c70319a
MD5 8803566b5d945936d0eef20a1954e8ea
BLAKE2b-256 8ee844bd98f7b29fb0ae975ac0fd17005a639ae28520572c731c6da897e19380

See more details on using hashes here.

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