pyquaternion
A fully featured, pythonic library for representing and using quaternions.
What it is and what it does
Pyquaternion is a pure-Python library for working with quaternions—a mathematical representation of 3D rotations and orientations. It wraps numpy and provides a Pythonic interface for creating quaternions from axes and angles, rotating vectors, and interpolating smoothly between orientations. The library is designed for applications that need to represent and manipulate 3D rotations, such as animation, robotics, and 3D graphics, where quaternions offer numerical stability and smooth interpolation that Euler angles cannot provide.
The package is in Beta development status and has been actively maintained since its first release in 2016. It depends only on numpy for its numerical operations, making installation straightforward. The library supports both Python 2.7 and Python 3.x, though the latest release was in 2020 and the package has not received updates for several years despite the repository remaining active.
Use it for:
- Animate smooth transitions between 3D object orientations by interpolating quaternions rather than Euler angles.
- Represent and compose rotations in robotics or motion-capture systems without gimbal lock issues.
- Rotate 3D vectors or point clouds by quaternion-based transformations in graphics or scientific computing.
- Build pose estimation or orientation tracking systems that need numerically stable rotation representations.
- Perform geometric calculations involving 3D rotations in physics simulations or CAD-like applications.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides quaternion representation, manipulation, and rotation operations for 3D geometry and animation, with support for smooth interpolation between orientations.
Yes. Pyquaternion is a stable, low-friction library with no known vulnerabilities, permissive licensing, and active repository maintenance. It fills a clear niche for quaternion math in Python. The main caveat is that the last release was in 2020; if you need support for very recent Python versions or active feature development, verify compatibility first, but for standard 3D rotation tasks it is a reliable choice.
Install
pyquaternion on PyPI
pip
pip install pyquaternionuv
uv add pyquaternionpoetry
poetry add pyquaternionInstalling pyquaternion
Before you install
Low friction install with a single runtime dependency on numpy. Actively maintained with recent commits; last release was over 5 years ago but the repository remains active and the package is widely used.
License in practice
MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute this package freely provided you include the license notice.
Quickstart
pip install pyquaternion
import pyquaternion
q = pyquaternion.Quaternion(axis=[0, 1, 0], degrees=90)
rotated = q.rotate([0, 0, 4])
Verify before relying
- Whether the package works reliably with Python versions beyond 3.8 (classifiers list 3.8 as the latest tested version).
- Current status of the 2.7 support claim given modern Python ecosystem shifts.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — numpy |
| Maintenance | actively maintained — 2,139 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,939,911/month — #2,441 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyquaternion-0.9.9-py2-none-any.whl; pyquaternion-0.9.9-py3-none-any.whl
Keywords: quaternion, math, maths, physics, orientation, pose, geometry, visualisation, animation
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
pytweeningPyTweening provides a collection of easing…
permissive · top 5,000 on PyPI
transformationsCalculates 4x4 homogeneous transformation…
permissive · top 5,000 on PyPI
euclid3Provides 2D and 3D vector, matrix, quaternion,…
unclear · top 15,000 on PyPI
numpy-quaternionAdds a quaternion dtype to NumPy, enabling…
permissive · top 5,000 on PyPI
magiccubeMagicCube implements NxNxN Rubik cubes with…
permissive · top 15,000 on PyPI
pytransform3dpytransform3d provides operations, conversions,…
permissive · top 15,000 on PyPI
romaRoMa provides differentiable conversions…
permissive · top 15,000 on PyPI
transforms3dConverts between different 3D geometric…
permissive · top 15,000 on PyPI
affineAffine provides a Python class for representing…
permissive · top 5,000 on PyPI
jaxliejaxlie implements Lie groups (SO2, SE2, SO3,…
permissive · top 15,000 on PyPI