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 hashes)
Built Distribution
pychunker-1.4.1-py3-none-any.whl
(10.8 kB
view hashes)
Close
Hashes for pychunker-1.4.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c00962482d00f8c4215fd512b74d131fc82ed179e402bfbe07a0260aeaab358 |
|
MD5 | 30d737889753304e4d091593a167205d |
|
BLAKE2b-256 | 85ac3aa855fb4f4d89fa7a0ed64c04f7aa1abfc81bef2b1b9213b4a560dadf3a |