Minimalistic library for reading files in the kw6 file format. See the documentation for more information on the API.
pip install kw6
Iterating over all positions and cameras in a kw6 file:
frompathlibimportPathimportkw6path=Path("...")
forpositioninkw6.Reader.from_path(path):
forcamerainposition.cameras:
camera.image.save(
f"{position.header.frame_index}_{camera.header.camera_index}.png"
)Accessing specific positions by frame index:
frompathlibimportPathimportkw6reader=kw6.Reader.from_path(Path("..."))
# Access a single positionposition=reader[10]
# Access a range of positionspositions=reader[10:20]
# Access specific positionspositions=reader[[5, 7, 9]]- Supports reading from file-like objects and file paths
- Efficient indexing and slicing of positions
- Automatic handling of file versions and headers
- Built-in error handling for corrupt or incomplete files
For more detailed information on the API and advanced usage, please refer to the full documentation.