Skip to main content

DLE/STX/ETX packet encoder/decoder

Project description

latest release on PyPI build & test status test coverage status

DLE/STX/ETX is a packet framing algorithm, used by some devices (such as Metlink LED passenger information displays) to transmit data as packets over a serial medium. This algorithm delimits data using DLE, STX, and ETX control codes.

Packets begin with a DLE STX sequence, follow with a byte-stuffed data stream (all DLE bytes in the data are conveyed as DLE DLE), and end with a DLE ETX sequence.

The dlestxetx module provides functions to encode data into packets:

>>> from dlestxetx import encode
>>> encode(b'\x01\x10\x05')

decode packets into data:

>>> from dlestxetx import decode
>>> decode(b'\x10\x02\x01\x10\x10\x05\x10\x03')

and read packets directly from file objects:

>>> from dlestxetx import read
>>> packets = BytesIO(encode(b'\x04\x05\x06') + encode(b'\x07\x08\x09'))
>>> read(packets)
>>> read(packets)


Install this module from PyPI using pip:

pip install dlestxetx


Add support for Python 3.5.
Initial release.



This project is licensed under the MIT License.

Project details

Download files

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

Files for dlestxetx, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size dlestxetx-1.0.1-py3-none-any.whl (4.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size dlestxetx-1.0.1.tar.gz (4.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page