Skip to content

Minimalistic library for reading files in the kw6 file format

License

Notifications You must be signed in to change notification settings

nextml-code/kw6

Repository files navigation

kw6 reader

Minimalistic library for reading files in the kw6 file format. See the documentation for more information on the API.

Install

pip install kw6

Usage

Iterating over all positions and cameras in a kw6 file:

from pathlib import Path
import kw6

path = Path("...")

for position in kw6.Reader.from_path(path):
    for camera in position.cameras:
        camera.image.save(
            f"{position.header.frame_index}_{camera.header.camera_index}.png"
        )

Accessing specific positions by frame index:

from pathlib import Path
import kw6

reader = kw6.Reader.from_path(Path("..."))

# Access a single position
position = reader[10]

# Access a range of positions
positions = reader[10:20]

# Access specific positions
positions = reader[[5, 7, 9]]

Additional Features

  • 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.

About

Minimalistic library for reading files in the kw6 file format

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages