Skip to main content

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


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

pyring_buffer-1.0.0-py3-none-any.whl (6.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page