Skip to main content

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).
  • Physical unit conversions (absorbance, transmittance, reflectance, Kubelka-Munk, pseudoabsorbance).
  • Adaptation methods for calibration transfer between instruments (DS, PDS, x-axis interpolation).
  • 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 for common tasks:

Setup & Validation

task install     # install all dependencies
task check       # run formatting, linting, typing, and tests
task test        # quick test run in the current environment
task coverage    # run tests with coverage reporting

Testing

Run tests in your current environment:

task test           # quick test
task test:quick     # same as task test

Run tests across the compatibility matrix using nox:

task test:nox:list              # list available nox sessions
task test:nox:core              # core tests (no plotting/inspector)
task test:nox:full              # full Python 3.10-3.14 matrix
task test:nox:min-sklearn       # minimum scikit-learn compatibility tests
task test:nox:all               # run all test matrices

Benchmarking

Profile performance of estimators:

task benchmark:list             # list available benchmarks
task benchmark:list:all         # show detailed benchmark registry
task benchmark:run -- --estimator adaptation.direct_standardization
task benchmark:run -- --estimator baseline.air_pls --profile regular

Building & Documentation

task build              # build the package
task docs:html          # build English documentation
task docs:html-all      # build all language variants

For more control, use nox directly:

uv run nox --list                       # show all available sessions
uv run nox -s tests-3.12               # run tests on a specific Python version
uv run nox -s tests-min-sklearn-3.12   # test minimum scikit-learn version

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.

Release files for chemotools 0.4.4

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

Source distribution (sdist)

Source distribution for chemotools 0.4.4
File Size Uploaded
chemotools-0.4.4.tar.gz 48.2 MB Details

Built distribution (wheel)

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

Total release size: 55.9 MB

Release files / chemotools-0.4.4.tar.gz

Download URL chemotools-0.4.4.tar.gz
Size 48.2 MB
Tags Source
SHA-256 checksum
How to use checksums
e356af2dec718b5dd059f7701d90aaf0fad2239b0ad001e4a42688e29701830c
BLAKE2b-256 checksum
How to use checksums
b07fe137442f10e8e2c3fed7b550ef6bd3f82819e715d9503ff64e93fc4ef645
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 Sep 8, 2026.

Transparency log

Release files / chemotools-0.4.4-py3-none-any.whl

Download URL chemotools-0.4.4-py3-none-any.whl
Size 7.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
a6fb7b46478b1222f1a22eb894cbd9a114731e26bc90a4fc22b845b48312843d
BLAKE2b-256 checksum
How to use checksums
6b0b475437df58cc6b52038ff6cbce480f1754e459f9fdd3aa8d8a810e06711d
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 Sep 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.4 This release

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.0

2 release files

0.1.22

2 release files

0.1.20

2 release files

0.1.19

2 release files

0.1.18

2 release files

0.1.17

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.28

2 release files

0.0.27

2 release files

0.0.26

2 release files

0.0.25

2 release files

0.0.24

2 release files

0.0.23

2 release files

0.0.22

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

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