{"id":24634,"library":"splines","title":"Splines in Euclidean Space and Beyond","description":"A Python library for creating and evaluating splines in Euclidean space and beyond, including B-splines and Bézier curves. Current version is 0.3.3, released in 2021. The library is under active development with irregular release cadence.","status":"active","version":"0.3.3","language":"python","source_language":"en","source_url":"https://github.com/treverhines/splines","tags":["splines","B-splines","Bezier","Catmull-Rom","interpolation"],"install":[{"cmd":"pip install splines","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"note":"Older docs or tutorials might suggest submodule paths","wrong":"from splines.bspline import UnitBSpline","symbol":"UnitBSpline","correct":"from splines import UnitBSpline"},{"note":"Common mistake: trying to import from bezier module","wrong":"from splines.bezier import Bezier","symbol":"Bezier","correct":"from splines import Bezier"},{"note":"Submodule not exposed directly","wrong":"from splines.catmull_rom import CatmullRom","symbol":"CatmullRom","correct":"from splines import CatmullRom"}],"quickstart":{"code":"from splines import UnitBSpline\nimport numpy as np\n\nknots = [0, 0, 0, 1, 2, 3, 4, 4, 4]\ncontrols = [0, 1, 0, 1, 0]\nspline = UnitBSpline(knots, controls)\nprint(spline.evaluate(0.5))","lang":"python","description":"Create a uniform B-spline and evaluate at a parameter value."},"warnings":[{"fix":"Ensure knot vector has multiplicity equal to degree+1 at start and end.","message":"The `UnitBSpline` class expects a specific knot vector format with repeated knots at the ends for clamped splines. Using a non-clamped knot vector may produce unexpected results.","severity":"gotcha","affected_versions":"all"},{"fix":"Update code to handle array output or upgrade to latest version.","message":"Older versions used an `evaluate` method that returned a single point; newer versions may return an array. Check documentation for your version.","severity":"deprecated","affected_versions":"<0.3.0"},{"fix":"Use a different library like `numpy` or `scipy.interpolate` for NURBS.","message":"The library does not support non-uniform rational B-splines (NURBS) out of the box. Attempting to use weights will cause errors.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install splines` in the correct Python environment.","cause":"Library not installed or installed in wrong environment.","error":"ModuleNotFoundError: No module named 'splines'"},{"fix":"Upgrade to version >=0.2.0 with `pip install --upgrade splines` and use `from splines import UnitBSpline`.","cause":"Outdated library version or incorrect import path.","error":"AttributeError: module 'splines' has no attribute 'UnitBSpline'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}