piecewise-rational
Shape-preserving piecewise rational cubic interpolation (Delbourgo-Gregory algorithm)
Decision gist · record as of 2026-08-14
Yes, if you need shape-preserving rational cubic interpolation and have endpoint derivatives available. The package is lightweight, permissively licensed, and implements a well-established algorithm. However, it is aging (no updates since initial release) and has minimal adoption; consider it only if standard cubic splines or other interpolation libraries do not meet your shape-preservation requirements.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later (supports 3.9, 3.10, 3.11, 3.12, 3.13).
- Low install friction; pure Python wheel with no runtime dependencies.
- Package is aging (213 days since release) with no recent commits beyond initial publication, though the repository remains active and unarchived.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions; you must include a copy of the license and retain copyright notices in distributions.
last release 2026-01-13 (213 days) · last repo commit 2026-01-13
0 known vulnerabilities (OSV.dev, 2026-08-14) · 158,134 downloads/mo, #10,734 on PyPI
Alternatives
Verify before relying
from piecewise_rational import rational_cubic_interpolation
# Interpolate at x=0.5 given interval [0.0, 1.0], endpoint values, derivatives, and control parameter
y = rational_cubic_interpolation(0.5, 0.0, 1.0, 0.0, 1.0, 1.0, 1.0, 0.0)- Practical performance characteristics and numerical stability compared to standard cubic spline methods.
- Whether the control parameter r has documented guidance for typical use cases.
- Real-world accuracy and speed on large datasets or high-dimensional problems.
What it is and what it does
piecewise-rational implements the Delbourgo-Gregory algorithm for rational cubic interpolation, a method that constructs smooth curves through data points while preserving shape properties like monotonicity and convexity. Unlike standard polynomial splines, rational cubic interpolation uses rational functions (ratios of polynomials) within each interval, offering better control over curve behavior and the ability to fit second derivatives through a control parameter.
The package provides a single core function, rational_cubic_interpolation, that takes an x-coordinate to evaluate, the interval endpoints, endpoint values, endpoint derivatives, and a control parameter, returning the interpolated y-value. It has no external runtime dependencies and installs as a pure Python wheel, making it lightweight for integration into numerical or scientific workflows where shape preservation matters more than standard smoothing.
Use it for
- Interpolating financial time-series data while preserving monotonicity in yield curves or volatility surfaces.
- Reconstructing smooth curves from scattered measurements in engineering or physics where convexity must be maintained.
- Building smooth interpolants for optimization problems where derivative information is available at sample points.
- Fitting curves through data with known monotonicity constraints, such as cumulative distributions or calibration curves.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need shape-preserving rational cubic interpolation and have endpoint derivatives available.
The package is lightweight, permissively licensed, and implements a well-established algorithm. However, it is aging (no updates since initial release) and has minimal adoption; consider it only if standard cubic splines or other interpolation libraries do not meet your shape-preservation requirements.
Install
piecewise-rational on PyPI
Before you install
Low install friction; pure Python wheel with no runtime dependencies. Package is aging (213 days since release) with no recent commits beyond initial publication, though the repository remains active and unarchived.
Requires Python 3.9 or later (supports 3.9, 3.10, 3.11, 3.12, 3.13).
License in practice
MIT license permits commercial and private use with minimal restrictions; you must include a copy of the license and retain copyright notices in distributions.
Quickstart
from piecewise_rational import rational_cubic_interpolation
# Interpolate at x=0.5 given interval [0.0, 1.0], endpoint values, derivatives, and control parameter
y = rational_cubic_interpolation(0.5, 0.0, 1.0, 0.0, 1.0, 1.0, 1.0, 0.0)
Verify before relying
- Practical performance characteristics and numerical stability compared to standard cubic spline methods.
- Whether the control parameter r has documented guidance for typical use cases.
- Real-world accuracy and speed on large datasets or high-dimensional problems.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release <4.0,>=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Aging 213 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 158,134 / month, #10,734 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9 |
Evidence: piecewise_rational-1.0.0-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 › “rational cubic interpolation”
- piecewise-rationalPerforms shape-preserving piecewise rational cubic interpolation…
- resize-rightResizes images or tensors in NumPy or PyTorch with differentiable…
- pytweeningPyTweening provides a collection of easing (tweening) functions that…
Give your agent the search over MCP, or paste the wish link into any chat.
More Mathematics packages
NetworkX provides data structures and algorithms for creating, analyzing, and manipulating graphs and networks, supporting everything from simple undirected graphs to complex directed and weighted networks.
kiwisolver is a Python binding to a fast C++ implementation of the Cassowary constraint solver, enabling you to solve systems of linear constraints and inequalities.
Install it if you need to solve constraint systems; skip it if you only need simple linear algebra.
SymPy is a Python library for symbolic mathematics, performing algebraic manipulation, calculus, equation solving, and mathematical expression simplification without numerical approximation.
ContourPy calculates contours of 2D quadrilateral grids using C++11 algorithms wrapped in Python, offering serial and multithreaded implementations without requiring Matplotlib as a dependency.
PyTorch provides GPU-accelerated tensor computation and automatic differentiation for building and training deep neural networks in Python.
onnxruntime loads and executes Open Neural Network Exchange (ONNX) models with a focus on inference performance across CPUs and accelerators.
Install it if you have ONNX models to run in production or development.
See also py-lets-be-rational · ropwr · cu2qu · pytweening · piecewise-regression · quadprog · pwlf · scs · pyclothoids