A library and utility for extensive parsing of IFF-based container formats.
Project description
raff is a Python library and command-line utility for extensive reading and parsing of IFF-based container formats.
#: Example usage:
from raff import Container
#: File-like objects, raw bytes, or file paths are all valid inputs.
file = "some_file.iff"
#: Initialize the container reader.
container = Container(file)
#: You can also ignore certain chunks from being read.
#: This can be useful for improving performance in certain situations.
container = Container(file, ignore=["JUNK", "FLLR", "PAD ", "fake", "DGDA"])
#: Iterate over each chunk (excluding the master/header chunk):
for identifier, size, payload in container.get_chunks():
#: Process each chunk (identifier, size, payload)
...
#: Access the master (header) chunk:
print(container.master)
#: Display the master chunk's size.
#: (For standard RIFF files, add 8 to this value to obtain the full file size,
#: unless a .w64 file was provided.)
print(container.master["size"])
#: Display the form type (e.g., file type such as 'WAVE').
print(container.master["type"])
#: List all chunk identifiers encountered.
print(container.chunk_identifiers)
#: NOTE: Some chunk payloads may be very large. When printing, consider omitting the payload.
#: Retrieve data for a specific chunk (e.g., the 'fmt ' chunk).
print(container.chunk("fmt "))
#: Display the full container dictionary, which includes all chunks (excluding ignored ones)
#: along with the master header.
print(container.container)
TODO: Implement Chunk and add as many chunk parsers as possible.
from raff import Chunk
#: Initialize the chunk parser.
chunk = Chunk(file)
#: Iterate over each chunk (excluding the master/header chunk):
for identifier, size, payload in chunk.get_chunks():
#: Chunk().get_chunks() would wrap over the Container() version
#: and return a parsed payload dict rather than the raw bytes.
...
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
raff-0.1.2.tar.gz
(2.9 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
raff-0.1.2-py3-none-any.whl
(3.6 kB
view details)
File details
Details for the file raff-0.1.2.tar.gz.
File metadata
- Download URL: raff-0.1.2.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6d14b6e1a1f803102f9a699b2bc52db9c2b9a26e5dd3bcb34d3a0c1f989c741
|
|
| MD5 |
e03bf42dd6aaaa60874c5f90f01d92a7
|
|
| BLAKE2b-256 |
ccab45a3df435a3e4eeb32774d958e7361e649db6e51b4de7562c268e10aa179
|
File details
Details for the file raff-0.1.2-py3-none-any.whl.
File metadata
- Download URL: raff-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d7a3b7c17b0bf89c9746ea68b504b6fc129f80276e030ab9791cb1faad1be86
|
|
| MD5 |
b1efdbd5d40971c0de0ab5783d5f4c55
|
|
| BLAKE2b-256 |
e07e27d1ccd11f13ad8d46bcccd99a119c5b2cd33463642b7f61fa116779c398
|