Module for reading/writing chunk files.
Project description
Chunker
Description
Module for reading/writing chunk files.
Installation
pip install pychunker
Using
example.py:
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:
[Chunk(name='DDAT', mode='r', size=10), Chunk(name='SDAT', mode='r', size=12)]
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
pychunker-1.4.1.tar.gz
(7.0 kB
view details)
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
pychunker-1.4.1-py3-none-any.whl
(10.8 kB
view details)
File details
Details for the file pychunker-1.4.1.tar.gz.
File metadata
- Download URL: pychunker-1.4.1.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.9.13 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ee8f081fe85848009d8c1f5a0571fa04cb6fb0c802a458a182b5333b6c741c7
|
|
| MD5 |
e2c7ed2da1cbcfba95147be714df9a08
|
|
| BLAKE2b-256 |
b34e93975a20e141a6ce5d8fda7aaad5598c84006d83f9e70df35bf84175d079
|
File details
Details for the file pychunker-1.4.1-py3-none-any.whl.
File metadata
- Download URL: pychunker-1.4.1-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.9.13 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c00962482d00f8c4215fd512b74d131fc82ed179e402bfbe07a0260aeaab358
|
|
| MD5 |
30d737889753304e4d091593a167205d
|
|
| BLAKE2b-256 |
85ac3aa855fb4f4d89fa7a0ed64c04f7aa1abfc81bef2b1b9213b4a560dadf3a
|