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 are not thread-safe. Reader is responsible of releasing chunks. Writer hands off responsibility over chunks.

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

    Extends: BufferedIOBase

    • nbytes -> int

      Number of bytes held in stream

    • nchunks -> int

      Number of chunks held in stream

    • readchunk() -> memoryview

      Read a chunk from stream

    • unreadchunk(chunk: memoryview) -> int

      Unread a chunk into the stream

    • readchunk() -> memoryview

      Read a chunk from stream

    • unwritechunk() -> memoryview

      Unwrite a chunk from the stream

    • writechunk(chunk: memoryview) -> int

      Write a chunk into the stream

    • peekchunk() -> memoryview

      Peek a chunk from stream

    • readchunks() -> Iterable[memoryview]

      Read all chunks from stream

    • writechunks(chunks: Iterable[memoryview]) -> int

      Write many chunks into the stream

    • update(bs: Iterable[Buffer]) -> int

      Write many buffers into the stream

    • clear() -> None

      Release all chunks

    • copy() -> Stream

      Shallow copy of stream

    • tobytes() -> bytes

      Transform stream to bytes (will copy)

    • frombytes(b: Buffer) -> Stream

      Construct a stream from bytes

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-1.0.0.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

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

streamview-1.0.0-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for streamview-1.0.0.tar.gz
Algorithm Hash digest
SHA256 38a68c1482c970b7f94c95bec2c2ee2dabed49e6d98b2d24f4aa3142e6aa2dfa
MD5 a1c98f14d9bad4dbc4071a9da39c77a6
BLAKE2b-256 f5672e7360cb8876b6c8747b1d95bd42a3e2ca437f8f0232f3f2fc79c7e6deba

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for streamview-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dc9a175a1f30304678f40b148d0a5e5b53676a8103d128f8718c71055ade16ab
MD5 5c128e5f4f693ed438508a19ec0f4cc1
BLAKE2b-256 d347070b1da0b897f865bca8457f1666706408b034be3d877418a0cd24655b78

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