circbuf implements a circular buffer for Python. It allows for zero copy operation, i.e. it uses memoryview to expose consumer and producer buffers. Access to the buffer is synchronised by locks, managed by context managers.
import circbuf
buf = circbuf.CircBuf()
# Produce data
with buf.producer_buf as mv:
mv[0] = 42
buf.produced(1)
print('First entry: {}'.format(next(iter(buf)))) # First entry: 42
Install it with pip:
$ pip install circbuf