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.1.tar.gz (472.3 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.1-py3-none-any.whl (118.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: interpolatepy-3.2.1.tar.gz
  • Upload date:
  • Size: 472.3 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.1.tar.gz
Algorithm Hash digest
SHA256 f4e538acd1da5ef822437add4bb78e7962719b98df53a1f46fbb718c290608e4
MD5 1cebae7a1c3184b7994d2c6a7610c6b1
BLAKE2b-256 5b52a5d07c37cd267f5a46b4677a5b58c879729cd623fa597226ff837a74f8c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for interpolatepy-3.2.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: interpolatepy-3.2.1-py3-none-any.whl
  • Upload date:
  • Size: 118.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0077f3644eceeac9e3096b0875c3312053717b74715698c4ae17c60b0a47a1b2
MD5 b13716b585dfab27ae8979283f064492
BLAKE2b-256 a5a13f19f7e170b3933d6a08f83af8ae3dc389be32830b605904d6d04b34bf36

See more details on using hashes here.

Provenance

The following attestation bundles were made for interpolatepy-3.2.1-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

3.2.2

2 files

This release

3.2.1 This release

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