native-fisher-py is a self-contained alternative to the fisher-py reader. While fisher-py requires a local .NET runtime and pythonnet, this package bundles the necessary components using .NET NativeAOT and Rust to provide a consistent binary bridge.
- Drop-in Compatible: Designed to match the
fisher_py.RawFileAPI for simplified migration. - Bundled .NET Components: No separate .NET runtime installation is required on the host system.
- Cross-Platform: Pre-built binaries for macOS (ARM64/x64), Linux (x64), and Windows (x64).
- Reliable Deployment: Easier integration into CI/CD pipelines and specialized Linux environments.
This project provides a native bridge to the official Thermo Fisher libraries using a three-layer approach:
- Official DLLs: Uses the original
.dllassemblies provided by Thermo Fisher Scientific. - C# NativeAOT Wrapper: A compiled transition layer (
ThermoNativeReader) that interfaces with those DLLs. - Rust PyO3 Layer: A Rust bridge (
native-fisher-py) that provides the final Python bindings.
This approach ensures stability and parity with the official reader while providing a dependency-free experience for Python users.
# Just change the import, the rest of your code stays the same!
from native_fisher_py import RawFile
with RawFile("data.raw") as raw:
print(f"Number of scans: {raw.number_of_scans}")
# Get spectral data as high-speed NumPy arrays
m, i, c, meta = raw.get_scan_from_scan_number(1)
print(f"First peak at {m[0]} m/z with intensity {i[0]}")If you are currently using fisher-py, migration is as simple as:
pip install native-fisher-py- Update your imports:
- from fisher_py import RawFile
+ from native_fisher_py import RawFile- (Optional) Uninstall
fisher-py:pip uninstall fisher-py
All core methods (get_scan_from_scan_number, get_spectrum, get_chromatogram, get_ms2_scan_number_from_retention_time, etc.) are implemented with identical signatures and return types.
For convenience, you can run the included build.sh script to build both parts of the project:
./build.shTo build the project from source, you need .NET 8 SDK, Rust (cargo/maturin), and clang.
Navigate to the C# project and publish the NativeAOT shared library for your platform:
cd native/ThermoNativeReader
# Example for Apple Silicon (macOS arm64)
dotnet publish -r osx-arm64 -c Release -p:PublishAot=true
# Example for Linux (x64)
# dotnet publish -r linux-x64 -c Release -p:PublishAot=trueThe output will be in publish/ThermoNativeReader.dylib (or .so / .dll).
Navigate to the native_fisher_py folder and use maturin to build and install the Python package. You must point to the location of the C# library.
cd native_fisher_py
# Point to your build from Step 1
export THERMO_NATIVE_LIB=$(pwd)/../native/ThermoNativeReader/bin/Release/net8.0/osx-arm64/publish/ThermoNativeReader.dylib
maturin developThis project is powered by the Thermo Fisher Scientific RawFileReader (copyright © 2016-2026 Thermo Fisher Scientific, Inc.). All rights reserved.
The native-fisher-py package includes the official RawFileReader libraries, which remain the property of Thermo Fisher Scientific. By using this software, you agree to the terms specified in their license.
Releases are fully automated via GitHub Actions (release.yml), but the workflow requires that the git tag strictly matches the version in native_fisher_py/Cargo.toml.
To trigger a new release and publish to PyPI:
- Update the version in
native_fisher_py/Cargo.toml. - Commit the version bump.
- Create and push a matching git tag:
git tag vX.Y.Z
git push origin vX.Y.ZThe GitHub Action will automatically:
- Verify that the git tag version matches the
Cargo.tomlversion (failing otherwise). - Build the native wheels across all platforms (macOS, Linux, Windows).
- Publish the final artifacts to PyPI.