A pure Python ring buffer for bytes
Project description
pyRing Buffer
A pure Python ring/circular buffer for bytes.
pip install pyring-buffer
from pyring_buffer import RingBuffer
rb = RingBuffer(10) # max 10 bytes
# Put only 5 bytes in
rb.put(bytes([1, 2, 3, 4, 5]))
# Everything is there
assert rb.getvalue() == bytes([1, 2, 3, 4, 5])
# Put a total of 12 bytes in
rb.put(bytes([6, 7, 8, 9, 10, 11, 12]))
# First 2 bytes are gone
assert rb.getvalue() == bytes([3, 4, 5, 6, 7, 8, 9, 10, 11, 12])
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for pyring_buffer-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f63e05307a0412e9dabfa1dad8e7223462153c96f5a1e2759a7316d3aaeeb6e |
|
MD5 | 81b95bcd04e83c81708b26dbe0d7c22e |
|
BLAKE2b-256 | cd3e09b108df06309ecb8eeb012f6206aae7c0d5bc596e8e51fcbe7486c7e30e |