https://github.com/paucablop/chemotools
Integrate your chemometric tools with the scikit-learn API 🧪 🤖
https://github.com/paucablop/chemotools
artificial-intelligence autoencoders chemometrics deep-learning hacktoberfest ir-spectroscopy machine-learning multivariate-analysis nir-spectroscopy python raman-spectroscopy scikit-learn sklearn spectra spectroscopy
Last synced: 3 months ago
JSON representation
Integrate your chemometric tools with the scikit-learn API 🧪 🤖
- Host: GitHub
- URL: https://github.com/paucablop/chemotools
- Owner: paucablop
- License: mit
- Created: 2023-01-26T18:25:00.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-26T22:08:22.000Z (over 1 year ago)
- Last Synced: 2025-03-30T06:04:20.106Z (about 1 year ago)
- Topics: artificial-intelligence, autoencoders, chemometrics, deep-learning, hacktoberfest, ir-spectroscopy, machine-learning, multivariate-analysis, nir-spectroscopy, python, raman-spectroscopy, scikit-learn, sklearn, spectra, spectroscopy
- Language: Python
- Homepage: https://paucablop.github.io/chemotools/
- Size: 30.2 MB
- Stars: 51
- Watchers: 4
- Forks: 6
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README

# chemotools
[](https://pypi.org/project/chemotools)
[](https://pypi.org/project/chemotools)
[](https://github.com/paucablop/chemotools/blob/main/LICENSE)
[](https://codecov.io/github/paucablop/chemotools)
[](https://pepy.tech/project/chemotools)
[](https://doi.org/10.21105/joss.06802)
[](https://www.codefactor.io/repository/github/paucablop/chemotools/overview/main)
---
`chemotools` is a Python library that brings **chemometric preprocessing tools** into the [`scikit-learn`](https://scikit-learn.org/) 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](https://pypi.org/project/chemotools/) and [Conda](https://anaconda.org/conda-forge/chemotools).
## Installation
Install from PyPI:
```bash
pip install chemotools
````
Install from Conda:
```bash
conda install -c conda-forge chemotools
```
## Usage
Example: preprocessing pipeline with scikit-learn:
```python
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](https://paucablop.github.io/chemotools/) for full details.
## Development
This project uses [uv](https://github.com/astral-sh/uv) for dependency management and [Task](https://taskfile.dev) to simplify common development workflows.
You can get started quickly by using the predefined [Taskfile](./Taskfile.yml), which provides handy shortcuts such as:
```bash
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`](https://nox.thea.codes/):
```bash
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](CONTRIBUTING.md) and the [project board](https://github.com/users/paucablop/projects/4).
## License
Released under the [MIT License](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](https://github.com/CycloneDX/cyclonedx-python), and can be vsualized in tools like [CycloneDX Sunshine](https://cyclonedx.github.io/Sunshine/).