Skip to main content

Build Status

KLV in Python

A Python parser for KLV (Key Length Value) encoded data. KLV encoding is commonly used in the motion picture industry.

http://en.wikipedia.org/wiki/KLV

Unit Tests

Install nose:

pip install nose

Run the command nosetests in the root directory.

Encode Key/Value

import klv
key = [0x03, 0x2E, 0x5F, 0xAB, 0x08, 0x12, 0x2F, 0x0C,
       0xEE, 0x33, 0x00, 0x01, 0x02, 0x45, 0x6D, 0xDD]
value = [0x05, 0x04, 0x03, 0x02, 0x01]
klv_msg = klv.encode(key, value)

klv_msg will be a bytearray; to convert to an array of ints, use list(klv_msg) and to convert to a string of bytes, use str(klv_msg).

Decode KLV Messages

import klv
key, value = klv.decode(klv_msg, 16)

Decode takes the form decode(<klv>, <key length>) to accomodate messages with different length keys. The key and value results are bytearrays.

Metadata

Release files for klv 0.0.5

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

Source distribution (sdist)

Source distribution for klv 0.0.5
File Size Uploaded Provenance Actions
klv-0.0.5.tar.gz 2.7 kB Without provenance Details for klv-0.0.5.tar.gz

Built distribution (wheel)

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

Total release size: 6.3 kB

Release files / klv-0.0.5.tar.gz

Download URL klv-0.0.5.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9538f82eef1758368c699abb79649a5131c060c93c0b91033ec7ae6eb50bfe8c
BLAKE2b-256 checksum
How to use checksums
524ef89c601a0251116d7eb2b74d8c582084266808b0411b88acca41ecf0cb4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4

Release files / klv-0.0.5-py3-none-any.whl

Download URL klv-0.0.5-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f89d3ac3f4bb44bf78af63a74c19ff64bcaf7cd9500ad727d62e665aa3faf7e
BLAKE2b-256 checksum
How to use checksums
676eb3496b17c04f2b46d5b4e760dfccdd329da80a43fa7777387f35f2b47e5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4

Security for klv 0.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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