# Chunker
## Description
Module for reading/writing chunk files.
## Installation
```
pip install pychunker
```
## Using
- `example.py`:
```python
import pychunker
with pychunker.open("chunkfile.bin", "w") as cf:
# The chunk can be used via `with'.
with cf.chunk("DDAT") as ddat:
ddat.write(b'1234567890')
# Or by contacting the key (name of the chunk).
cf["SDAT"].write(b'Hello World!')
# !!! Attention !!!
# Both types of treatment use the same methods,
# namely that if you open a chunk file in read-only mode,
# and if the chunk is not in the chunk file,
# he will try to create a chunk,
# but he will not be able to do this and will give a `IONotWritableError`.
with pychunker.open("chunkfile.bin") as cf:
print(cf.chunks)
```
- `Output`:
```python
[Chunk(name='DDAT', mode='r', size=10), Chunk(name='SDAT', mode='r', size=12)]
```
Raw data
{
"_id": null,
"home_page": "https://github.com/romanin-rf/pychunker",
"name": "pychunker",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "pychunker,chunker,chunkfile,io,file,chunk,read,write",
"author": "Romanin",
"author_email": "semina054@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/b3/4e/93975a20e141a6ce5d8fda7aaad5598c84006d83f9e70df35bf84175d079/pychunker-1.4.1.tar.gz",
"platform": null,
"description": "# Chunker\n## Description\nModule for reading/writing chunk files.\n\n## Installation\n```\npip install pychunker\n```\n\n## Using\n- `example.py`:\n```python\nimport pychunker\n\nwith pychunker.open(\"chunkfile.bin\", \"w\") as cf:\n # The chunk can be used via `with'.\n with cf.chunk(\"DDAT\") as ddat:\n ddat.write(b'1234567890')\n \n # Or by contacting the key (name of the chunk).\n cf[\"SDAT\"].write(b'Hello World!')\n\n# !!! Attention !!!\n# Both types of treatment use the same methods,\n# namely that if you open a chunk file in read-only mode,\n# and if the chunk is not in the chunk file,\n# he will try to create a chunk,\n# but he will not be able to do this and will give a `IONotWritableError`.\n\nwith pychunker.open(\"chunkfile.bin\") as cf:\n print(cf.chunks)\n```\n\n- `Output`:\n```python\n[Chunk(name='DDAT', mode='r', size=10), Chunk(name='SDAT', mode='r', size=12)]\n```",
"bugtrack_url": null,
"license": "MIT",
"summary": "Module for reading/writing chunk files.",
"version": "1.4.1",
"project_urls": {
"Homepage": "https://github.com/romanin-rf/pychunker",
"Repository": "https://github.com/romanin-rf/pychunker"
},
"split_keywords": [
"pychunker",
"chunker",
"chunkfile",
"io",
"file",
"chunk",
"read",
"write"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "85ac3aa855fb4f4d89fa7a0ed64c04f7aa1abfc81bef2b1b9213b4a560dadf3a",
"md5": "30d737889753304e4d091593a167205d",
"sha256": "6c00962482d00f8c4215fd512b74d131fc82ed179e402bfbe07a0260aeaab358"
},
"downloads": -1,
"filename": "pychunker-1.4.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "30d737889753304e4d091593a167205d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 10787,
"upload_time": "2024-01-06T03:57:29",
"upload_time_iso_8601": "2024-01-06T03:57:29.273502Z",
"url": "https://files.pythonhosted.org/packages/85/ac/3aa855fb4f4d89fa7a0ed64c04f7aa1abfc81bef2b1b9213b4a560dadf3a/pychunker-1.4.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b34e93975a20e141a6ce5d8fda7aaad5598c84006d83f9e70df35bf84175d079",
"md5": "e2c7ed2da1cbcfba95147be714df9a08",
"sha256": "0ee8f081fe85848009d8c1f5a0571fa04cb6fb0c802a458a182b5333b6c741c7"
},
"downloads": -1,
"filename": "pychunker-1.4.1.tar.gz",
"has_sig": false,
"md5_digest": "e2c7ed2da1cbcfba95147be714df9a08",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 7011,
"upload_time": "2024-01-06T03:57:31",
"upload_time_iso_8601": "2024-01-06T03:57:31.299784Z",
"url": "https://files.pythonhosted.org/packages/b3/4e/93975a20e141a6ce5d8fda7aaad5598c84006d83f9e70df35bf84175d079/pychunker-1.4.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-06 03:57:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "romanin-rf",
"github_project": "pychunker",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pychunker"
}