GitHunt

chemotools

chemotools

PyPI
Python Versions
License
Coverage
Downloads
DOI
CodeFactor


chemotools is a Python library that brings chemometric preprocessing tools into the scikit-learn ecosystem.

It provides modular transformers for spectral data, designed to plug seamlessly into your ML workflows.

Features

  • Preprocessing for spectral data (baseline correction, smoothing, scaling, derivatization, scatter correction).
  • Fully compatible with scikit-learn pipelines and transformers.
  • Simple, modular API for flexible workflows.
  • Open-source, actively maintained, and published on PyPI and Conda.

Installation

Install from PyPI:

pip install chemotools

Install from Conda:

conda install -c conda-forge chemotools

Usage

Example: preprocessing pipeline with scikit-learn:

from sklearn.preprocessing import StandardScaler
from sklearn.pipeline import make_pipeline

from chemotools.baseline import AirPls
from chemotools.scatter import MultiplicativeScatterCorrection

preprocessing = make_pipeline(
    AirPls(),
    MultiplicativeScatterCorrection(),
    StandardScaler(with_std=False),
)

spectra_transformed = preprocessing.fit_transform(spectra)

โžก๏ธ See the documentation for full details.

Development

This project uses uv for dependency management and Task to simplify common development workflows.
You can get started quickly by using the predefined Taskfile, which provides handy shortcuts such as:

task install     # install all dependencies
task check       # run formatting, linting, typing, and tests
task test        # quick test run in the current environment
task test:matrix # run the nox compatibility matrix locally
task coverage    # run tests with coverage reporting
task build       # build the package for distribution

For compatibility testing across supported Python versions, use nox:

uv run nox --list               # show available sessions
uv run nox -s tests-3.12       # run tests on a specific Python version
uv run nox -s tests-min-sklearn-3.10
uv run nox -s tests-min-sklearn-3.12

Contributing

Contributions are welcome!
Check out the contributing guide and the project board.

License

Released under the MIT License.

Compliance and Software Supply Chain Management

This project embraces software supply chain transparency by generating an SBOM (Software Bill of Materials) for all dependencies. SBOMs help organizations, including those in regulated industries, track open-source components, ensure compliance, and manage security risks.

The SBOM file is made public as an asset attached to every release. It is generated using CycloneDX SBOM generator for Python, and can be vsualized in tools like CycloneDX Sunshine.

Languages

Python100.0%

Contributors

MIT License
Created January 26, 2023
Updated March 8, 2026
paucablop/chemotools | GitHunt