Metadata-Version: 2.4
Name: pyring_buffer
Version: 1.0.2
Summary: A pure Python ring buffer for bytes
Author-email: Michael Hansen <mike@rhasspy.org>
License: Apache-2.0
Project-URL: Source Code, http://github.com/rhasspy/pyring-buffer
Keywords: ring,circular,buffer
Platform: any
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Text Processing :: Linguistic
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.9.0
Description-Content-Type: text/markdown
License-File: LICENSE.md
Provides-Extra: dev
Requires-Dist: black==22.12.0; extra == "dev"
Requires-Dist: flake8==6.0.0; extra == "dev"
Requires-Dist: isort==5.11.3; extra == "dev"
Requires-Dist: mypy==0.991; extra == "dev"
Requires-Dist: pylint==2.15.9; extra == "dev"
Requires-Dist: pytest==7.4.4; extra == "dev"
Requires-Dist: build==1.2.2; extra == "dev"
Dynamic: license-file

# pyRing Buffer

A pure Python ring/circular buffer for bytes.

``` sh
pip install pyring-buffer
```

``` python
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])
```

