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 Distribution

pyring_buffer-1.0.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyring_buffer-1.0.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file pyring_buffer-1.0.1.tar.gz.

File metadata

  • Download URL: pyring_buffer-1.0.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for pyring_buffer-1.0.1.tar.gz
Algorithm Hash digest
SHA256 dc913eea1ea0c9ea05ffe0fbb41cfe45d13b821667d687cb1576b37e97dd4c1b
MD5 d1babdbaee88c25b56fa32293cc611d6
BLAKE2b-256 04e8e787ba1d863d12e4c4162709e37e7fa66d5061e497079d98d56f6f67836d

See more details on using hashes here.

File details

Details for the file pyring_buffer-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pyring_buffer-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for pyring_buffer-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f1dd23904fe1f7684b2c3aadb1067bc62f05288174b1f59850120fe325d6b103
MD5 80430d7c13fd22b685278b683d115fe6
BLAKE2b-256 2341de35c72e5a68c630d652f9858cb8ca3213843eb4a166358b2d634191ba4f

See more details on using hashes here.

Supported by

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