Metadata-Version: 2.4
Name: openreadout
Version: 0.1.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Typing :: Typed
Requires-Dist: numpy>=1.22
Requires-Dist: dask[array]>=2022.2 ; extra == 'all'
Requires-Dist: xarray>=2022.3 ; extra == 'all'
Requires-Dist: pyarrow>=14 ; extra == 'all'
Requires-Dist: pyarrow>=14 ; extra == 'arrow'
Requires-Dist: dask[array]>=2022.2 ; extra == 'dask'
Requires-Dist: pytest>=7 ; extra == 'test'
Requires-Dist: dask[array]>=2022.2 ; extra == 'test'
Requires-Dist: xarray>=2022.3 ; extra == 'test'
Requires-Dist: tifffile>=2022.2 ; extra == 'test'
Requires-Dist: pyarrow>=14 ; extra == 'test'
Requires-Dist: dask[array]>=2022.2 ; extra == 'xarray'
Requires-Dist: xarray>=2022.3 ; extra == 'xarray'
Provides-Extra: all
Provides-Extra: arrow
Provides-Extra: dask
Provides-Extra: test
Provides-Extra: xarray
License-File: LICENSE-APACHE
License-File: LICENSE-MIT
License-File: NOTICE
Summary: Read raw lab-instrument files without vendor software, from Python
Keywords: microscopy,czi,nd2,lif,ome-tiff,bioimaging,mass-spectrometry,thermo-raw,mzml
Home-Page: https://github.com/openreadout/openreadout
Author-email: The OpenReadout Authors <openreadout@gmail.com>
License-Expression: MIT OR Apache-2.0
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Changelog, https://github.com/openreadout/openreadout/blob/main/CHANGELOG.md
Project-URL: Documentation, https://openreadout.github.io/openreadout/guides/python.html
Project-URL: Homepage, https://github.com/openreadout/openreadout
Project-URL: Repository, https://github.com/openreadout/openreadout

# openreadout (Python)

Read raw lab-instrument files from Python without vendor software, Java or a C toolchain. The package wraps OpenReadout's Rust readers. It returns the same JSON as the `openreadout` command-line tool, and NumPy, dask or xarray arrays for pixels. The formats it reads are listed at <https://openreadout.github.io/openreadout/formats.html>.

```bash
pip install openreadout            # needs only NumPy
pip install 'openreadout[xarray]'  # adds dask and xarray for lazy, labelled arrays
```

One abi3 wheel per platform covers CPython 3.10 and newer on Linux (manylinux and musllinux, x86_64 and aarch64), macOS (x86_64 and arm64) and Windows (x64).

```python
import openreadout

meta = openreadout.info("run42.czi")        # header-only summary, a dict
meta["images"][0]["size_c"], meta["images"][0]["physical_size"]

with openreadout.File("run42.czi") as f:
    plane = f.read_plane(image=0, c=1, z=4)   # np.ndarray (Y, X), or (Y, X, 3) for RGB
    stack = f.read_image(0)                   # np.ndarray (T, C, Z, Y, X[, S])
    lazy = f.to_dask(0)                       # dask array, one chunk per plane, read on demand
    xarr = f.to_xarray(0)                     # labelled: channel names, µm and s coordinates
    f.check()["ok"]                           # integrity report
    f.export("run42.ome.tiff")                # verified OME-TIFF; the source is never modified
```

Tables, traces and spectra (flow cytometry, electrophysiology, chromatography, mass spectrometry) are read with `File.read_table`, `File.read_trace` and `File.read_spectrum`, and convert to Arrow or pandas with `File.to_arrow` and `File.to_pandas`.

Arrays use the dimension order `TCZYX`, with `S` added for interleaved RGB. `File` objects are thread-safe and picklable, so lazy arrays work with dask's threaded, multiprocessing and distributed schedulers.

Every error is an `openreadout.OpenReadoutError` and also the closest built-in exception (for example `FileNotFoundError` or `ValueError`). It carries the command-line tool's `code`, `exit_code` and a `hint`.

[`bioio-openreadout`](https://pypi.org/project/bioio-openreadout/) plugs these readers into `bioio.BioImage`, and [`napari-openreadout`](https://pypi.org/project/napari-openreadout/) into napari.

Guide and full API: <https://openreadout.github.io/openreadout/guides/python.html>. Source: <https://github.com/openreadout/openreadout>. Licensed MIT OR Apache-2.0. OpenReadout is not affiliated with any instrument vendor.

