pybaselines
A library of algorithms for the baseline correction of experimental data.
Decision gist · record as of 2026-08-14
Yes. pybaselines is a mature, actively maintained library with no known vulnerabilities, low installation friction, and a permissive license. Install it if you work with spectroscopy or analytical data requiring baseline correction—the breadth of algorithms and unified API make it the natural choice for this task.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later.
- Low friction installation with only numpy and scipy as runtime dependencies.
- Actively maintained with recent commits and stable production status.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause permissive license allows use in commercial and proprietary projects with minimal restrictions.
last release 2025-08-10 (369 days) · last repo commit 2026-08-14 · 193 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 128,730 downloads/mo, #11,697 on PyPI
Alternatives
Verify before relying
pip install pybaselines
import numpy as np
from pybaselines import Baseline
x = np.linspace(1, 1000, 1000)
y = np.random.normal(0, 1, 1000) # your measured data
baseline_fitter = Baseline(x_data=x)
bkg, params = baseline_fitter.asls(y, lam=1e7, p=0.02)- Whether the 50+ algorithms cover all common spectroscopy techniques mentioned (Raman, FTIR, NMR, XRD, XRF, PIXE, MALDI-TOF, LIBS).
- Performance characteristics and computational cost for large datasets or real-time processing.
- Availability and scope of optional dependencies referenced in the documentation.
What it is and what it does
pybaselines is a Python library for baseline correction—the removal of background signal from experimental measurements in spectroscopy and analytical chemistry. It implements over 50 algorithms including well-known methods like AsLS, airPLS, ModPoly, and SNIP, as well as specialized variants unique to the library. The library targets practitioners working with data from techniques such as Raman, FTIR, NMR, XRD, and similar analytical methods.
The main interface is the Baseline class for 1D data and Baseline2D for 2D data. Each algorithm returns both the calculated baseline and a dictionary of parameters, allowing users to quickly test multiple approaches on the same dataset to find the best fit. The library depends only on numpy and scipy, making it lightweight and easy to integrate into existing scientific Python workflows.
Use it for
- Remove background noise from Raman spectroscopy measurements to isolate peak signals for chemical identification.
- Correct baseline drift in FTIR spectra before performing quantitative analysis or peak fitting.
- Compare multiple baseline correction algorithms on the same dataset to determine which produces the best result for your material.
- Preprocess XRD or XRF data to improve signal-to-noise ratio before downstream analysis.
- Integrate baseline correction into automated spectroscopy data pipelines for batch processing.
- Develop custom baseline correction workflows by combining different algorithms and parameters.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
pybaselines is a mature, actively maintained library with no known vulnerabilities, low installation friction, and a permissive license. Install it if you work with spectroscopy or analytical data requiring baseline correction—the breadth of algorithms and unified API make it the natural choice for this task.
Install
pybaselines on PyPI
Before you install
Low friction installation with only numpy and scipy as runtime dependencies. Actively maintained with recent commits and stable production status.
Requires Python 3.9 or later.
License in practice
BSD-3-Clause permissive license allows use in commercial and proprietary projects with minimal restrictions.
Quickstart
pip install pybaselines
import numpy as np
from pybaselines import Baseline
x = np.linspace(1, 1000, 1000)
y = np.random.normal(0, 1, 1000) # your measured data
baseline_fitter = Baseline(x_data=x)
bkg, params = baseline_fitter.asls(y, lam=1e7, p=0.02)
Verify before relying
- Whether the 50+ algorithms cover all common spectroscopy techniques mentioned (Raman, FTIR, NMR, XRD, XRF, PIXE, MALDI-TOF, LIBS).
- Performance characteristics and computational cost for large datasets or real-time processing.
- Availability and scope of optional dependencies referenced in the documentation.
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesnumpyscipy |
| Maintenance | Actively maintained 369 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 128,730 / month, #11,697 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Scientific/EngineeringTopic :: Scientific/Engineering :: ChemistryTopic :: Scientific/Engineering :: Information AnalysisTopic :: Scientific/Engineering :: Physics |
Evidence: pybaselines-1.2.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “baseline correction algorithms”
- pybaselinesProvides 50+ baseline correction algorithms for experimental data…
- arm-pyartPy-ART provides weather radar data processing, analysis, and…
- stable-baselines3Stable Baselines3 provides PyTorch implementations of reinforcement…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also PeakUtils · libhreels · specutils · pyhdfe · mypy_baseline · patch · stable-baselines3 · colour-science · arm-pyart