Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

engiNIR

DOI Documentation

engiNIR turns near-infrared spectra and hyperspectral images into validated calibration models and property predictions, with every step recorded. It is built for pharmaceutical process analytics.

Workflow

  1. Import EVK EIFF, ENVI, HDF5, CSV/Excel, SPC, SPA and JCAMP-DX data.
  2. Calibrate raw counts with dark and white reference spectra.
  3. Preprocess with strict recipes: Savitzky-Golay, SNV, MSC, EMSC, detrend.
  4. Model with PLS or PCR, cross-validated by region of interest.
  5. Review diagnostics and figures of merit.
  6. Predict properties of new spectra and whole images.

Guarantees

  • Training and prediction run through the same calibration and preprocessing pipeline.
  • Prediction is refused when new data does not match the model's instrument format, number of bands, calibration or signal unit.
  • One project file links data, references, recipes, models and predictions; saved results cannot be altered.

Usage

engiNIR needs Python 3.13. Install it with uv:

git clone https://github.com/TUstudents/engiNIR.git
cd engiNIR
uv sync

Viewer

The desktop viewer runs the whole workflow interactively: inspect images and spectra and draw regions (Explore), assign reference values, fit models and review diagnostics (Model), and map predictions over new scans (Predict). All results are saved to a project file.

uv run enginir-viewer                                  # welcome screen
uv run enginir-viewer scan.eiff --dark dark.eiff --white white.eiff
uv run enginir-viewer project.h5

Library

The library can be used in two ways.

Project mode records every step in a project file, so each result is reproducible and traceable to its data. Recommended unless you know exactly which steps you need:

from enginir import PreprocessingRecipe, Project

project = Project.create("tablets.h5")
scan = project.add_dataset("scan.eiff", dark="dark.eiff", white="white.eiff")
project.add_target("API content", unit="% w/w")
scan.add_roi("tablet 1", frames=(0, 4), rows=(0, 9), values={"API content": 1.0})
# ... more ROIs
model = project.fit("API content", recipe=PreprocessingRecipe(snv=True), n_components=2)
prediction = model.predict("new_scan.eiff")      # prediction.map: one value per pixel

Function mode uses the readers, preprocessing steps, models and validation functions directly on arrays, as scikit-learn estimators:

from sklearn.pipeline import make_pipeline
from enginir.models import PLSRegression
from enginir.preprocessing import SNV
from enginir.validation import cross_validate

model = make_pipeline(SNV(), PLSRegression(n_components=4))
cv = cross_validate(model, X, y, cv="logo", groups=samples)   # cv["rmsecv"], cv["y_pred"]

Documentation

The documentation is at https://enginir.readthedocs.io. To build it locally:

uv sync --extra docs
uv run python -m sphinx -b html docs docs/_build/html

Citation

If you use engiNIR in your work, please cite:

Johannes Poms. (2026). TUstudents/engiNIR: A universal engineering tool for near-infrared spectra and hyperspectral imaging. Zenodo. https://doi.org/10.5281/zenodo.23235907

License

engiNIR © 2026 Johannes Poms and contributors, licensed under CC BY 4.0.

Metadata

Release files for enginir 1.0.0rc4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for enginir 1.0.0rc4
File Size Uploaded Provenance Actions
enginir-1.0.0rc4.tar.gz 231.1 kB With provenance Details for enginir-1.0.0rc4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for enginir 1.0.0rc4
File Interpreter ABI Platform Actions
enginir-1.0.0rc4-py3-none-any.whl Python 3 none any Details for enginir-1.0.0rc4-py3-none-any.whl

Total release size: 493.5 kB

Release files / enginir-1.0.0rc4.tar.gz

Download URL enginir-1.0.0rc4.tar.gz
Size 231.1 kB
Tags Source
SHA-256 checksum
How to use checksums
482874449728c8239e306f155c2c00e60bad154a5409f2fd06cbc609b7ff3c73
BLAKE2b-256 checksum
How to use checksums
37469d76e98ff040601f7d93055c0ca37c3062cd3fb059738e8feceed23242f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / enginir-1.0.0rc4-py3-none-any.whl

Download URL enginir-1.0.0rc4-py3-none-any.whl
Size 262.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b6ee9b5e86bb20fefdf88a4df187e1b8b511f9df498f7d12b644f24a980b0f9
BLAKE2b-256 checksum
How to use checksums
019d2b8cbd60f4c482eb4931127ec6de94daf544830bb2cf45155b6fda621445
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Security for enginir 1.0.0rc4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for enginir-1.0.0rc4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page