Skip to main content

dlestxetx: DLE/STX/ETX packet encoder/decoder

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')
b'\x10\x02\x01\x10\x10\x05\x10\x03'

decode packets into data:

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

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)
b'\x04\x05\x06'
>>> read(packets)
b'\x07\x08\x09'

Installation

Install this module from PyPI using pip:

pip install dlestxetx

Changes

1.0.1

Add support for Python 3.5.

1.0.0

Initial release.

Contribute

Support

License

This project is licensed under the MIT License.

Metadata

Release files for dlestxetx 1.0.1

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

Source distribution (sdist)

Source distribution for dlestxetx 1.0.1
File Size Uploaded
dlestxetx-1.0.1.tar.gz 4.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dlestxetx 1.0.1
File Interpreter ABI Platform
dlestxetx-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 8.6 kB

Release files / dlestxetx-1.0.1.tar.gz

Download URL dlestxetx-1.0.1.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d639fbcb94ac36320ffe833829c8eb9201a959124c849f9fff91c3cd44d04fd2
BLAKE2b-256 checksum
How to use checksums
25be04fce66ae06665567ba7cc831db31415c39258d935c687941495b223e51c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release files / dlestxetx-1.0.1-py3-none-any.whl

Download URL dlestxetx-1.0.1-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
711c8de64ded4442203acc6181bdb0362434274aa8bd4079f65fb5a493f35294
BLAKE2b-256 checksum
How to use checksums
5211a3faee518484baa41895fc6de0501d77c1a51993b0ffebccbf4eac6d45fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 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