Skip to main content

pyvlq

pyvlq is a Python library for encoding and decoding Variable-Length Quantity <https://en.wikipedia.org/wiki/Variable-length_quantity>_.

The library is available on PyPI and can be installed using pip:

pip install pyvlq

Usage

from io import BytesIO
import pyvlq

# Encode
encoded = pyvlq.encode(128)
print(encoded) # b'\x81\x00'

# Decode
decoded = pyvlq.decode(encoded)
print(decoded) # 128

# Decode from readable bytes
buffer = BytesIO(b'\x81\x00\xff\xff')
decoded = pyvlq.decode_stream(buffer)
print(decoded) # 128 (0xff\xff is ignored)
print(buffer.read(2)) # b'\xff\xff' (0xff\xff is left in the buffer)

Metadata

Release files for pyvlq 0.1.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 pyvlq 0.1.1
File Size Uploaded
pyvlq-0.1.1.tar.gz 3.6 kB Details

Built distribution (wheel)

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

Total release size: 7.1 kB

Release files / pyvlq-0.1.1.tar.gz

Download URL pyvlq-0.1.1.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f1d8c7d8b07f1a7de83f70793e33f0cbceb345262e98809d8fc526ad37870aa5
BLAKE2b-256 checksum
How to use checksums
99a86c55fe83f0ada0937840de122158327e05282f1243cee9f89aa7302de430
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.13

Release files / pyvlq-0.1.1-py3-none-any.whl

Download URL pyvlq-0.1.1-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da248d8484b86cab77c4ceabfadea70704e9530b651d88c94c12acdf5d55861c
BLAKE2b-256 checksum
How to use checksums
aa418e5971ebd3c22d452e9d9e572b76e1db8b79a17bdfefc09905888cf6f62a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.13

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.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