skillfed

pyquaternion

A fully featured, pythonic library for representing and using quaternions.

pyquaternion v0.9.9 3.9M downloads/30d#2,441 on PyPI366
Permissive license MIT Active released

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 pyquaternion

uv

uv add pyquaternion

poetry

poetry add pyquaternion

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Topic :: Scientific/Engineering :: MathematicsTopic :: Scientific/Engineering :: PhysicsTopic :: Scientific/Engineering :: VisualizationTopic :: Software Development :: Embedded SystemsTopic :: Software Development :: Libraries :: Python Modules

Tags

quaternion rotation library3d orientation representationsmooth rotation interpolationquaternion math python3d animation quaternionsaxis-angle rotationpose representation geometry
3d-geometryrotation-mathanimation

More Python Modules packages