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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c36e9b650bc5aff6a3b87e2f954ab6b1e21b64dcbf696b6ae94ac920fbc9abb
|
|
| MD5 |
d554e82b7bbd472d7da77578a340c823
|
|
| BLAKE2b-256 |
062bbf2ebc54dc1a516040dd77ed648e25ffb657c04f1560f4e25044ea44c97b
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lil_buff_writer-0.1.1.tar.gz -
Subject digest:
5c36e9b650bc5aff6a3b87e2f954ab6b1e21b64dcbf696b6ae94ac920fbc9abb - Sigstore transparency entry: 176172589
- Sigstore integration time:
-
Permalink:
MatthewAndreTaylor/lil_buff_writer@f438144cad1d9a39beb677bac67c12ef89cb7887 -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/MatthewAndreTaylor
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@f438144cad1d9a39beb677bac67c12ef89cb7887 -
Trigger Event:
release
-
Statement type:
File details
Details for the file lil_buff_writer-0.1.1-py3-none-any.whl.
File metadata
- Download URL: lil_buff_writer-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79ba8f00439626e037a97076e420021e954a490457b8d4bac6d984eecd266a57
|
|
| MD5 |
6eef458f43f1bb9545d9b6b2a7b9b0b2
|
|
| BLAKE2b-256 |
d1735fc0248e6108d44681cb85cacdd69bd1d2fc67567cad2ecdbeaeb8395890
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lil_buff_writer-0.1.1-py3-none-any.whl -
Subject digest:
79ba8f00439626e037a97076e420021e954a490457b8d4bac6d984eecd266a57 - Sigstore transparency entry: 176172590
- Sigstore integration time:
-
Permalink:
MatthewAndreTaylor/lil_buff_writer@f438144cad1d9a39beb677bac67c12ef89cb7887 -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/MatthewAndreTaylor
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@f438144cad1d9a39beb677bac67c12ef89cb7887 -
Trigger Event:
release
-
Statement type: