Registry / data / rosettasciio

rosettasciio

JSON →
library0.14.0pypypiunverified

RosettaSciIO is a Python library for reading and writing various scientific file formats, designed with a focus on ease of use and integration with scientific data analysis tools like HyperSpy. It supports a wide range of formats including HDF5, TIFF, DigitalMicrograph (DM3/DM4), and more, often leveraging optional backend libraries. The current version is 0.13.0, and new minor releases occur every few months, introducing new features and format support.

pip install rosettasciio
INSTALL
IMPORT
SIG · ROSETTASCIIO
R
rosettasciio
datapythonv0.14.0
Install
24.6s avg
Import
Disk
137MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.14.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
2/4 runs
✓ 25.35s
py 3.11
2/4 runs
✓ 25.45s
py 3.12
2/4 runs
✓ 24.3s
py 3.13
2/4 runs
✓ 23.98s
py 3.9
2/4 runs
✓ 24.03s
137MB installed
● package 137MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

read
from rsciio import read
from rsciio import read
IO_PLUGINS
from rsciio import IO_PLUGINS
set_log_level
from rsciio import set_log_level

This quickstart demonstrates how to save a NumPy array to a common image format (PNG) and then read it back using RosettaSciIO. This leverages the `Pillow` dependency, which is installed by default.

import rsciio import numpy as np import os # Create a dummy NumPy array (e.g., a simple image) data_to_save = np.arange(100).reshape(10, 10).astype(np.uint8) filename_png = "my_dummy_data.png" print(f"Saving data to {filename_png} using rsciio.write...") # rsciio.write handles numpy arrays and uses Pillow (a core dependency) for PNG. rsciio.write(data_to_save, filename_png) print(f"Successfully saved data to {filename_png}") print(f"Reading data from {filename_png} using rsciio.read...") # rsciio.read returns a numpy array by default read_data = rsciio.read(filename_png) print(f"Successfully read data from {filename_png}. Shape: {read_data.shape}") print(f"Data type: {read_data.dtype}") # Clean up the dummy file os.remove(filename_png) print(f"Cleaned up {filename_png}")
Debug
Known issues
gotchaMany advanced features or support for specific file formats (e.g., Gatan DM3/DM4, advanced TIFF, lazy loading with Dask, HyperSpy integration) require *optional* dependencies. These are not installed by default.
fix
Install `rosettasciio` with the necessary extras, for example, `pip install "rosettasciio[gatan-dm]"` for Gatan files, `pip install "rosettasciio[tifffile]"` for advanced TIFF, or `pip install "rosettasciio[all]"` for all optional features.
affects: >=0.1.0
breaking`rosettasciio` requires Python 3.10 or newer. Attempting to use older Python versions will lead to installation failures or runtime errors due to syntax or dependency incompatibilities.
fix
Ensure your Python environment is running Python 3.10 or later. Consider using `pyenv` or `conda` to manage Python versions.
affects: >=0.1.0
gotchaFor efficient handling of very large files and distributed lazy loading, `dask` and often `hyperspy` are required optional dependencies. Without them, large files might be fully loaded into memory, potentially causing memory exhaustion.
fix
Install `rosettasciio` with the `dask` and `hspy` extras (e.g., `pip install "rosettasciio[hspy]"` or `pip install "rosettasciio[all]"`). When reading, check documentation for lazy loading options relevant to your file format.
affects: >=0.12.0
gotchaWhile `rsciio.read` can often return a `numpy.ndarray` by default, full integration with `hyperspy` signals for advanced analysis requires `hyperspy` to be installed.
fix
If you intend to work with `hyperspy` signals, install `hyperspy` as an optional dependency: `pip install "rosettasciio[hspy]"`.
affects: >=0.1.0
Upgrade
Version history
0.14.0latest on PyPI · released May 27, 2026
Audit
Dependencies
h5pyrequiredRequired for HDF5-based formats.
lxmlrequiredRequired for XML-based metadata and formats.
mrczrequiredRequired for MRC/MRCZ file formats.
numpyrequiredFundamental for array manipulation and data representation.
PillowrequiredRequired for common image formats (PNG, JPEG, BMP).
pintrequiredRequired for handling physical units.
scipyrequiredRequired for various scientific computing tasks and some formats (e.g., MAT files).
Agent activity
22 hits · last 30 days
node
18
OpenAI (training)
1
Resources
rosettasciio — pip install rosettasciio · libregistry