Skip to main content

InterpolatePy

Python PyPI Downloads pre-commit ci-test License: MIT

InterpolatePy is a trajectory-planning and interpolation library for robotics, animation, and scientific computing. It includes scalar splines, B-spline curve tools, bounded motion profiles, quaternion interpolation, and 3D path utilities.

The package has a NumPy/SciPy implementation and an optional C++20 backend. Use the public names exported by interpolatepy; they select the available backend at import time.

Installation

python -m pip install InterpolatePy

InterpolatePy 3.2.1 requires Python 3.11 or newer, NumPy 1.26 or newer, SciPy 1.11 or newer, and Matplotlib 3.6 or newer.

Quick start

import numpy as np

from interpolatepy import CubicSpline
from interpolatepy import DoubleSTrajectory
from interpolatepy import StateParams
from interpolatepy import TrajectoryBounds

# A clamped cubic spline: v0 and vn are endpoint velocities.
spline = CubicSpline(
    [0.0, 1.0, 2.0, 3.0],
    [0.0, 1.5, -0.5, 2.0],
    v0=0.0,
    vn=0.0,
)
times = np.linspace(0.0, 3.0, 100)
positions = spline.evaluate(times)
velocities = spline.evaluate_velocity(times)

# A jerk-limited Double-S motion profile.
state = StateParams(q_0=0.0, q_1=10.0, v_0=0.0, v_1=0.0)
bounds = TrajectoryBounds(v_bound=5.0, a_bound=10.0, j_bound=30.0)
motion = DoubleSTrajectory(state, bounds)
sample_times = np.linspace(0.0, motion.get_duration(), 100)
q, qd, qdd, qddd = motion.evaluate_full(sample_times)

DoubleSTrajectory.evaluate() returns position only. Use evaluate_velocity(), evaluate_acceleration(), and evaluate_jerk() for one component, or evaluate_full() for all four.

What is included

Area Public APIs Typical use
Scalar splines CubicSpline, CubicSmoothingSpline, CubicSplineWithAcceleration1, CubicSplineWithAcceleration2 Smooth scalar waypoint trajectories and noisy data
B-splines BSpline, BSplineInterpolator, CubicBSplineInterpolation, ApproximationBSpline, SmoothingCubicBSpline Parametric curves, interpolation, approximation, and smoothing
Motion profiles DoubleSTrajectory, TrapezoidalTrajectory, PolynomialTrajectory, ParabolicBlendTrajectory Bounded or boundary-conditioned scalar motion
Rotations Quaternion, QuaternionSpline, SquadC2, LogQuaternionInterpolation, ModifiedLogQuaternionInterpolation Orientation interpolation without Euler-angle singularities
Paths and utilities LinearPath, CircularPath, Frenet-frame helpers, linear_traj, solve_tridiagonal Geometric paths, moving frames, and numerical helpers

Degrees 3, 4, and 5 of BSplineInterpolator, LogQuaternionInterpolation, and ModifiedLogQuaternionInterpolation support as few as two waypoints in version 3.2.0.

See the algorithm selection guide, the full documentation, and the runnable examples.

Optional C++ backend

The package falls back to Python automatically when the extension is absent:

import interpolatepy

print(interpolatepy.HAS_CPP)

Set INTERPOLATEPY_NO_CPP=1 before importing the package to force the Python implementation. The standard Python package does not need a compiler. Building the native library or Python extension from a source checkout requires CMake 3.21+, a C++20 compiler, and network access for CMake's fetched dependencies; see the installation guide.

Development

This project uses uv:

git clone https://github.com/GiorgioMedico/InterpolatePy.git
cd InterpolatePy
uv sync
uv run pytest
uv run pre-commit run --all-files

Documentation dependencies are in a separate group:

uv sync --group docs
uv run mkdocs serve

Every Python program in examples/ can also be run directly, for example:

uv run python examples/double_s_ex.py

For the complete workflow, see Contributing.

License and citation

InterpolatePy is distributed under the MIT License.

@misc{InterpolatePy,
  author = {Giorgio Medico},
  title  = {InterpolatePy: Trajectory Planning and Interpolation for Python},
  year   = {2026},
  url    = {https://github.com/GiorgioMedico/InterpolatePy}
}

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

interpolatepy-3.2.2.tar.gz (472.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

interpolatepy-3.2.2-py3-none-any.whl (118.7 kB view details)

Uploaded Python 3

File details

Details for the file interpolatepy-3.2.2.tar.gz.

File metadata

  • Download URL: interpolatepy-3.2.2.tar.gz
  • Upload date:
  • Size: 472.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for interpolatepy-3.2.2.tar.gz
Algorithm Hash digest
SHA256 c7e4f9c838b4dc3e361288ef7e3be648951ec77c82c1766736e5183c8889b511
MD5 e19354decb73ab0acd3ab90227340d65
BLAKE2b-256 c164c8e97b594c16a677ec8dd3c745127bf6e2ea88c38682a2fc4154df503f95

See more details on using hashes here.

Provenance

The following attestation bundles were made for interpolatepy-3.2.2.tar.gz:

Publisher: publish.yml on GiorgioMedico/InterpolatePy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file interpolatepy-3.2.2-py3-none-any.whl.

File metadata

  • Download URL: interpolatepy-3.2.2-py3-none-any.whl
  • Upload date:
  • Size: 118.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for interpolatepy-3.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f764a562ab68d2dd8f6b63fca8f0bef0a47c750fbab660ffa39dba411da0c0d0
MD5 3670e1a348e6733f4df0284a5d73309a
BLAKE2b-256 376501a2f60c0d12d93039da69c7ddb2d276a0fbf93282bcd905e02550d4a64c

See more details on using hashes here.

Provenance

The following attestation bundles were made for interpolatepy-3.2.2-py3-none-any.whl:

Publisher: publish.yml on GiorgioMedico/InterpolatePy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

3.2.2 This release

2 files

3.2.1

2 files

3.2.0

2 files

3.1.0

2 files

3.0.1

2 files

3.0.0

2 files

2.0.1

2 files

2.0.0

2 files

1.1.0

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 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