# 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
```sh
pip install lil_buff_writer
```
## Usage
### Writing Messages
Using Python
```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
```bash
python -m lil_buff_writer test.bin --encode file0.txt file1.md ...
```
### Reading Messages
Using Python
```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
```bash
python -m lil_buff_writer test.bin --decode [output_dir]
```
## License
Apache-2.0
Raw data
{
"_id": null,
"home_page": null,
"name": "lil-buff-writer",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "writing, buffer, utility",
"author": null,
"author_email": "Matthew Taylor <matthew.taylor.andre@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/06/2b/bf2ebc54dc1a516040dd77ed648e25ffb657c04f1560f4e25044ea44c97b/lil_buff_writer-0.1.1.tar.gz",
"platform": null,
"description": "# lil_buff_writer\n\nA simple writing utility for storing and retrieving messages.\n\nMessages are formated as such `<name: bytes><delimiter: bytes><size: u32><content: bytes>`\nThis archive format aims to be light weight and easy to use.\n\nInstead of writing out many files, you can pack them into one file.\nWriting out a stream of messages to a single blob allows you to write to a single destination instead of searching for files later.\n\n\n## Features\n- Write messages to a file with labeled names and content.\n- Parse each of the messages from a stream.\n\n## Installation\n```sh\npip install lil_buff_writer\n```\n\n## Usage\n\n### Writing Messages\n\nUsing Python\n\n```python\nfrom lil_buff_writer import write_messages\n\nmessages = [(b\"greeting\", b\"Hello, World!\"), (b\"farewell\", b\"Goodbye!\")]\nawait write_messages(messages, \"messages.dat\")\n```\n\nUsing the Command Line\n\n```bash\npython -m lil_buff_writer test.bin --encode file0.txt file1.md ...\n```\n\n\n### Reading Messages\n\nUsing Python\n\n```python\nfrom lil_buff_writer import read_messages\n\nwith open(\"messages.dat\", \"rb\") as f:\n for name, content in read_messages(f):\n print(f\"{name.decode()}: {content.decode()}\")\n```\n\nUsing the Command Line\n\n```bash\npython -m lil_buff_writer test.bin --decode [output_dir]\n```\n\n## License\nApache-2.0\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Buffer writing utility package",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://github.com/MatthewAndreTaylor/lil_buff_writer"
},
"split_keywords": [
"writing",
" buffer",
" utility"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "d1735fc0248e6108d44681cb85cacdd69bd1d2fc67567cad2ecdbeaeb8395890",
"md5": "6eef458f43f1bb9545d9b6b2a7b9b0b2",
"sha256": "79ba8f00439626e037a97076e420021e954a490457b8d4bac6d984eecd266a57"
},
"downloads": -1,
"filename": "lil_buff_writer-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6eef458f43f1bb9545d9b6b2a7b9b0b2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 8091,
"upload_time": "2025-03-03T05:43:47",
"upload_time_iso_8601": "2025-03-03T05:43:47.450093Z",
"url": "https://files.pythonhosted.org/packages/d1/73/5fc0248e6108d44681cb85cacdd69bd1d2fc67567cad2ecdbeaeb8395890/lil_buff_writer-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "062bbf2ebc54dc1a516040dd77ed648e25ffb657c04f1560f4e25044ea44c97b",
"md5": "d554e82b7bbd472d7da77578a340c823",
"sha256": "5c36e9b650bc5aff6a3b87e2f954ab6b1e21b64dcbf696b6ae94ac920fbc9abb"
},
"downloads": -1,
"filename": "lil_buff_writer-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "d554e82b7bbd472d7da77578a340c823",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 8167,
"upload_time": "2025-03-03T05:43:49",
"upload_time_iso_8601": "2025-03-03T05:43:49.250593Z",
"url": "https://files.pythonhosted.org/packages/06/2b/bf2ebc54dc1a516040dd77ed648e25ffb657c04f1560f4e25044ea44c97b/lil_buff_writer-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-03-03 05:43:49",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "MatthewAndreTaylor",
"github_project": "lil_buff_writer",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "lil-buff-writer"
}