zb
zero_buffer
pypi i zero_buffer
zb

zero_buffer

zero_buffer is a high-performance, zero-copy, implementation of a byte-buffer for Python.

by Alex Gaynor

0.5.1 (see all)License:BSD
pypi i zero_buffer
Readme

zero_buffer

.. image:: https://travis-ci.org/alex/zero_buffer.png?branch=master :target: https://travis-ci.org/alex/zero_buffer

zero_buffer is a high-performance, zero-copy, implementation of a byte-buffer for Python.

Documentation_ is available on ReadTheDocs.

.. code-block:: python

from zero_buffer import Buffer

# Create a buffer which has space for 8192 bytes.
b = Buffer.allocate(8192)
with open(path, "rb") as f:
    # Read up to 8192 bytes from the file into the buffer
    b.read_from(f.fileno())
# Create a read-only view of the buffer, this performs no copying.
view = b.view()
# Split the view on colons, this returns a generator which yields sub-views
# of the view.
for part in view.split(b":"):
    print(part)

zero_buffer works on Python 2.6, 2.7, 3.2, 3.3, and PyPy.

.. _Documentation: https://zero-buffer.readthedocs.org/en/latest/

GitHub Stars

135

LAST COMMIT

5yrs ago

MAINTAINERS

1

CONTRIBUTORS

7

OPEN ISSUES

4

OPEN PRs

1
VersionTagPublished
0.5.1
9yrs ago
0.5
9yrs ago
No alternatives found
No tutorials found
Add a tutorial