Skip to main content

Efficient circular buffer implementation in Python with optional Numba JIT compilation

Project description

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].

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for circular-buffer, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size circular_buffer-0.2.0-py3-none-any.whl (4.5 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size circular-buffer-0.2.0.tar.gz (3.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page