Skip to main content

Buffer writing utility package

Project description

lil_buff_writer

A simple writing utility for storing and retrieving messages.

Messages are formated as such <name: bytes>/<size: u32><content: bytes>

Instead of writing out many files, you can pack them into one file. Writing out a stream of messages to a single blob allows you to write to a single destination instead of searching for files later.

Features

  • Write messages to a file with labeled names and content.
  • Parse each of the messages from a stream.

Installation

pip install lil_buff_writer

Usage

Writing Messages

from lil_buff_writer import write_messages

messages = [(b"greeting", b"Hello, World!"), (b"farewell", b"Goodbye!")]
await write_messages(messages, "messages.dat")

Reading Messages

from lil_buff_writer import read_messages

with open("messages.dat", "rb") as f:
    for name, content in read_messages(f):
        print(f"{name.decode()}: {content.decode()}")

License

Apache-2.0

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

lil_buff_writer-0.1.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

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

lil_buff_writer-0.1.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file lil_buff_writer-0.1.0.tar.gz.

File metadata

  • Download URL: lil_buff_writer-0.1.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for lil_buff_writer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ca04c7e480c6ba01a87d07cdc3af9a424fd162788b570cc6fe7f07fe1afe3d5c
MD5 89527e057743db1119c651e07929737f
BLAKE2b-256 d6af535f7607ab8688449cca7c8c87521e741ce67e625dfa9ee69abc7bda6a82

See more details on using hashes here.

Provenance

The following attestation bundles were made for lil_buff_writer-0.1.0.tar.gz:

Publisher: python-publish.yml on MatthewAndreTaylor/lil_buff_writer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lil_buff_writer-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for lil_buff_writer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc1e6d9be85ac2f68e76af2be37e641a885844df37c7a97133fe8eacd3d48927
MD5 10327bf5d1874a67c883935d8f77e7a6
BLAKE2b-256 4fefb5aeffff2cbb8eb78c33ad5806dbf6501578550de09198b96145ce871a4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for lil_buff_writer-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on MatthewAndreTaylor/lil_buff_writer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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