Skip to main content


SpectroChemPy

Tests Actions Status codecov Conda PyPI version Documentation DOI Conda

What is SpectroChemPy?

SpectroChemPy (SCPy) is a framework for processing, analyzing, and modeling spectroscopic data for chemistry with Python. It is cross-platform (Linux, Windows, macOS) and combines a lightweight scientific core with optional plugins for domain-specific workflows.

Its central object, NDDataset, provides numerical data together with coordinates, units, masks, labels, history, and metadata, making it easier to build reproducible spectroscopy workflows in Python.

Quick Start

Create and smooth a synthetic spectrum using only the core package; no plugin or data download is needed. Run this in a Python script or Jupyter notebook:

import spectrochempy as scp

wavenumbers = scp.Coord.linspace(1800, 1400, 401, units="cm^-1", title="wavenumber")
profile = scp.gaussian(wavenumbers, pos=1650, width=30, normalized=False)
spectrum = scp.NDDataset(profile, coordset=[wavenumbers], title="absorbance")
spectrum += 0.03 * scp.random(spectrum.shape, seed=42)
smoothed = spectrum.smooth(size=11)

_ = scp.plot_multiple(
    [spectrum, smoothed], method="pen", labels=["Original", "Smoothed"],
    legend="upper right", ylabel="absorbance", figsize=(7, 3.5),
)
scp.show()

Synthetic spectrum before and after smoothing

For measured data, start with dataset = scp.read("path/to/spectrum.spa"). See the reader catalog for supported formats and required plugins, and the quickstart tutorial for a complete workflow.

Key Features

  • Core Data Structure: NDDataset with coordinates, units, masks, labels, history, and metadata
  • Project Management: Organize and manipulate multiple datasets within a Project
  • Data Processing:
    • Unit-aware mathematical operations
    • Baseline correction, automatic subtraction, smoothing, denoising, despiking
    • Coordinate alignment, interpolation, integration, peak finding, FFT workflows
    • Core processing with plugin-specific extensions where appropriate
  • Analysis Tools:
    • SVD, PCA, MCR-ALS, EFA, PLS, fitting, and related result objects
  • I/O and Interoperability:
    • Import from major spectroscopy and scientific data formats
    • Export to lightweight interchange formats such as CSV, JCAMP-DX, and minimal MATLAB .mat exchange files
    • Portable NDDataset ↔ xarray.Dataset ↔ NetCDF round-trips for the maintained portable subset (requires optional xarray and a NetCDF backend)
    • Safe native .scp / .pscp persistence by default, with explicit legacy opt-in only for historical trusted archives
  • Plugin System:
    • Automatic discovery of optional plugins
    • Namespaced APIs: scp.nmr.read_topspin(...), scp.iris.IRIS()
    • Dataset accessors for plugin-bound operations

The history records participating operations on a dataset. It is inspectable, but it is not a complete provenance record; reproducibility also requires the originating script or notebook, inputs, environment, and parameters.

Installation

SpectroChemPy requires Python 3.11 or newer.

The recommended way to install SpectroChemPy is with uv. Once uv is installed:

uv venv scpy --python 3.13
# Linux / macOS:
source scpy/bin/activate
# Windows PowerShell:
# .\scpy\Scripts\Activate.ps1
uv pip install spectrochempy

Alternatively, with mamba / conda:

mamba install -c conda-forge -c spectrocat spectrochempy

Or with pip:

python -m pip install spectrochempy

See the full installation guide for platform-specific instructions, optional dependencies, and development setup.

Official Plugins

Extend SpectroChemPy with official plugins (installed separately):

Plugin Install What it provides
spectrochempy-carroucell uv pip install spectrochempy-carroucell Carroucell experiment reader
spectrochempy-iris uv pip install spectrochempy-iris Regularized inversion for adsorption and diffusion studies
spectrochempy-nmr uv pip install spectrochempy-nmr NMR readers (Bruker, Agilent/Varian, JEOL, SIMPSON) and processing
spectrochempy-perkinelmer uv pip install spectrochempy-perkinelmer PerkinElmer .sp IR file reader
spectrochempy-tensor uv pip install spectrochempy-tensor TensorLy-backed tensor decompositions, including CP/PARAFAC

python -m pip install works as well if you are not using uv. You can also install the core and selected plugins together using extras:

uv pip install "spectrochempy[nmr]"       # or [iris], [tensor]
uv pip install "spectrochempy[plugins]"   # all official plugins

For optional xarray/NetCDF interoperability, install xarray and a NetCDF backend such as netCDF4 in the same environment.

Plugins are also available via conda from the spectrocat channel:

mamba install -c conda-forge -c spectrocat spectrochempy-nmr

Plugins are discovered automatically once installed — no manual loading step required.

Experimental plugins

spectrochempy-cantera is available as an experimental plugin. It is not officially supported, not included in aggregate extras, and must be installed manually:

python -m pip install spectrochempy-cantera

For contributors

If you want to contribute, start with:

Maintainer release procedures live in maintainers/. Architecture, RFCs, and roadmap discussions are maintained in the SpectroChemPy Maintainer Repository.

License

CeCILL-B FREE SOFTWARE LICENSE AGREEMENT

Metadata

Release files for spectrochempy 1.4.0

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

Source distribution (sdist)

Source distribution for spectrochempy 1.4.0
File Size Uploaded Provenance Actions
spectrochempy-1.4.0.tar.gz 6.6 MB With provenance Details for spectrochempy-1.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 7.7 MB

Release files / spectrochempy-1.4.0.tar.gz

Download URL spectrochempy-1.4.0.tar.gz
Size 6.6 MB
Tags Source
SHA-256 checksum
How to use checksums
283fd5c7c837b63158db0766c2fb060638aeea1797cc4a1ae09f856cf498597b
BLAKE2b-256 checksum
How to use checksums
6fd71a3643f43f10b5e9d6c9ef38ffdb5ff060f09ecb3892b5140c57974f5c6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 20, 2026.

Transparency log

Release files / spectrochempy-1.4.0-py3-none-any.whl

Download URL spectrochempy-1.4.0-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
9ecd7959fb3120a589f29bd2bac12918fa16ce8acf32e3db269e0c3e9da82162
BLAKE2b-256 checksum
How to use checksums
be7237eff1d5cae0c85b5bec2c406cea5cc91c837582742091ed5cf5bef35721
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 20, 2026.

Transparency log

Security for spectrochempy 1.4.0

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 spectrochempy-1.4.0.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 Nov 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.

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 release files Full provenance

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