Skip to content
Efficient circular buffer implementation in Python with optional Numba JIT compilation
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows
circular_buffer
.gitignore
LICENSE
MANIFEST.in
README.rst
dev-requirements.txt
requirements.txt
setup.py
version.txt

README.rst

circular-buffer

Tests PyPi

Efficient circular buffer implementation in Python with optional Numba JIT compilation

Usage

import circular_buffer

buffer_of_int_type = circular_buffer.for_instances_like(123)
buf = buffer_of_int_type(size = 10, autoexpand = True)
for i in range(12):
    buf.push_back(i)
assert buf.pop_front() == 0
assert buf.front() == 1
assert buf.back() == 11

Remember to install numba JIT compiler package to get a small extra speedup. numba can be automatically installed if you install this package via pip install circular-buffer[numba].

You can’t perform that action at this time.