Metadata-Version: 2.4
Name: esrf-loadfile
Version: 0.2.3
Summary: Generic loaders for ESRF useful files
Author-email: Charles ROMAIN <charles.romain@protonmail.com>
License: # MIT License
        
        **Copyright (c) 2025 European Synchrotron Radiation Facility**
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of
        this software and associated documentation files (the "Software"), to deal in
        the Software without restriction, including without limitation the rights to
        use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
        the Software, and to permit persons to whom the Software is furnished to do so,
        subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
        FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
        COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
        IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
        CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        
Project-URL: Homepage, https://gitlab.esrf.fr/graintracking/loadfile
Project-URL: Source, https://gitlab.esrf.fr/graintracking/loadfile
Project-URL: Issues, https://gitlab.esrf.fr/graintracking/loadfile/-/issues
Project-URL: Changelog, https://gitlab.esrf.fr/graintracking/loadfile/-/blob/main/CHANGELOG.md
Keywords: esrf,hdf5,tomography,diffraction,materials,loader
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: h5py
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: silx
Requires-Dist: esrf-pathlib>=0.6.0
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: pytest-mock; extra == "test"
Requires-Dist: pytest-profiling!=1.8.0; extra == "test"
Requires-Dist: pytest-rerunfailures; extra == "test"
Requires-Dist: pytest-xvfb; extra == "test"
Provides-Extra: dev
Requires-Dist: bandit; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: flake8-pep585; extra == "dev"
Requires-Dist: mypy>=1.8.0; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: ruff>=0.4.0; extra == "dev"
Requires-Dist: scriv>=1.3.1; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: esrf_loadfile[test]; extra == "dev"
Requires-Dist: isort; extra == "dev"
Dynamic: license-file

# esrf-loadfile

[![GitLab Repo](https://img.shields.io/badge/repo-GitLab-lightgrey?logo=gitlab)](https://gitlab.esrf.fr/graintracking/loadfile)

Standalone re-usable loader utilities for ESRF DCT and tomography data formats.
These helpers were extracted from the StatusGUI code base so that other tools can
inspect `.h5`, `.mat`, `.cif`, and reflection files without depending on the GUI.

## Installation

```bash
pip install esrf-loadfile
```

### Mamba environment

```bash
module load mamba  # on ESRF systems
mamba create -n esrf_loadfile -c conda-forge python pip setuptools
mamba activate esrf_loadfile
pip install esrf_loadfile
```

For local development inside the StatusGUI monorepo you can install it in editable
mode:

```bash
pip install -e loadfile
```

## Usage

```python
from esrf_loadfile import loadFile

handler = loadFile("/path/to/parameters.h5")
print(handler.get_keys("entry/detector"))

# Nested keys work end-to-end:
dataset = handler.get_value("entry/detector/data")
print(handler.get_size("entry/detector/data"))
print(handler.get_description("entry/detector/data"))

# Inline dataset specs return the value directly:
dataset = loadFile("/path/to/parameters.h5::/entry/detector/data")
```

Inline specs are useful when you want a one-liner that returns the dataset directly.

## Development

Install the project in editable mode together with its test dependencies and run the
test-suite:

```bash
pip install -e .[test]
PYTHONPATH=src pytest
```

To run the code-coherency checks (imports/formatting/linting) install the dev extras
and run Ruff on the sources:

```bash
pip install -e .[dev]
ruff check src tests
```
