Skip to main content

Zero-copy non-blocking pipe-like structure

Project description

streamview

Zero-copy non-blocking pipe-like structure

Install

Production

pip install streamview

Development

git clone https://github.com/hpca-uji/streamview.git
cd streamview
pip install -e .

Documentation

Classes

  • Stream()

    Zero-copy non-blocking pipe-like

    Interface mimics a non-blocking BufferedIOBase, but operations return memoryviews instead of bytes.

    Operations consume the stream. Operations are not thread-safe. Reader is responsible of releasing buffers. Writer hands off responsibility over buffers.

    Stream has with, bytes, bool, copy and deepcopy support.

    Extends: BufferedIOBase

    • __len__() -> int

      Number of buffers held in stream

    • nbytes -> int

      Number of bytes held in stream

    • buffers -> Iterable[memoryview]

      Peeking iterator over buffers

    • __getitem__(index) -> memoryview

      Peek a buffer from the stream

    • unreadbuffer(b: memoryview) -> int

      Unread a buffer into the stream

    • readbuffer() -> memoryview

      Read a buffer from stream

    • readbuffers() -> Iterable[memoryview]

      Read all buffers from stream

    • unwritebuffer() -> memoryview

      Unwrite a buffer from the stream

    • writebuffer(b: memoryview) -> int

      Write a buffer into the stream

    • writebuffers(bs: Iterable[memoryview]) -> int

      Write many buffers into the stream

    • frombuffer(b: Buffer) -> Stream

      Construct a stream from a buffer

    • tobuffer() -> memoryview

      Transform stream to contiguous buffer (may copy)

    • copy() -> Stream

      Shallow copy of stream

Functions

  • byteview(b: Buffer) -> memoryview

    Return a byte view of a buffer

Acknowledgments

The library has been partially supported by:

  • Project PID2023-146569NB-C22 "Inteligencia sostenible en el Borde-UJI" funded by the Spanish Ministry of Science, Innovation and Universities.
  • Project C121/23 Convenio "CIBERseguridad post-Cuántica para el Aprendizaje FEderado en procesadores de bajo consumo y aceleradores (CIBER-CAFE)" funded by the Spanish National Cybersecurity Institute (INCIBE).

Project details


Download files

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

Source Distribution

streamview-2.0.0.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streamview-2.0.0-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file streamview-2.0.0.tar.gz.

File metadata

  • Download URL: streamview-2.0.0.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for streamview-2.0.0.tar.gz
Algorithm Hash digest
SHA256 c1c98b76910728214a93c847bd989481e0e5cdc2dc07c44f56ae1adf73c4d117
MD5 917828de0f9fbbeb9478eb80f7cb2e01
BLAKE2b-256 3d061acb73faf9b068ab9c53ca434310ea4ae356c1af5af14af46d7be42036cb

See more details on using hashes here.

File details

Details for the file streamview-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: streamview-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for streamview-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e570fc230ea78589d730cceeb96ab8c008bd1b510c21a7c086a0b2cb44490e9f
MD5 434c7f83bf14f7dd68191755518015d3
BLAKE2b-256 99c79dd1728028593e1b176f9c311d035aba7e70c0a82e9f8e0f27fd5ed34f0d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page