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><delimiter: bytes><size: u32><content: bytes> This archive format aims to be light weight and easy to use.

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

Using Python

from lil_buff_writer import write_messages

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

Using the Command Line

python -m lil_buff_writer test.bin --encode file0.txt file1.md ...

Reading Messages

Using Python

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()}")

Using the Command Line

python -m lil_buff_writer test.bin --decode [output_dir]

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.1.tar.gz (8.2 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.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lil_buff_writer-0.1.1.tar.gz
  • Upload date:
  • Size: 8.2 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.1.tar.gz
Algorithm Hash digest
SHA256 5c36e9b650bc5aff6a3b87e2f954ab6b1e21b64dcbf696b6ae94ac920fbc9abb
MD5 d554e82b7bbd472d7da77578a340c823
BLAKE2b-256 062bbf2ebc54dc1a516040dd77ed648e25ffb657c04f1560f4e25044ea44c97b

See more details on using hashes here.

Provenance

The following attestation bundles were made for lil_buff_writer-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for lil_buff_writer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 79ba8f00439626e037a97076e420021e954a490457b8d4bac6d984eecd266a57
MD5 6eef458f43f1bb9545d9b6b2a7b9b0b2
BLAKE2b-256 d1735fc0248e6108d44681cb85cacdd69bd1d2fc67567cad2ecdbeaeb8395890

See more details on using hashes here.

Provenance

The following attestation bundles were made for lil_buff_writer-0.1.1-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