skillfed

pyglm

OpenGL Mathematics library for Python

pyglm v2.8.3 304.5K downloads/30d#7,804 on PyPI241
Permissive license Zlib AGING released

What it is and what it does

PyGLM is a Python extension written in C++ that wraps the GLM (OpenGL Mathematics) library, bringing high-performance vector and matrix operations to Python. It provides types like vec2, vec3, vec4, mat2, mat3, mat4, and quaternions, along with functions for geometric operations (cross product, dot product, rotation, perspective transforms) commonly needed in graphics pipelines, physics engines, and 3D applications. The library is designed to be mostly compatible with GLM's C++ API, adapted for Python syntax (using periods instead of double colons for namespacing).

PyGLM supports the buffer protocol, making it interoperable with NumPy arrays and other buffer-compatible objects. It ships with prebuilt wheels for modern Python versions (3.9–3.14) on Windows, macOS, and Linux, reducing installation friction. The package includes typing stubs for IDE support and is marked as Production/Stable, though the last release was several months ago. It has no runtime dependencies, keeping the installation lightweight.

Use it for:

  • Building OpenGL or DirectX rendering pipelines where you need fast matrix transformations and vector math
  • Physics simulations requiring quaternion rotations, cross products, and dot products for collision detection
  • 3D graphics applications needing perspective and view matrix calculations for camera control
  • Game engines or graphics tools where performance-critical math operations must run faster than NumPy equivalents
  • Converting between graphics library APIs (e.g., passing GLM matrices to OpenGL via ctypes pointers)

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

PyGLM provides Python bindings to OpenGL Mathematics (GLM), a C++ library for vector and matrix operations commonly used in graphics programming, physics simulations, and 3D applications.

Yes, if you are building graphics or physics applications in Python and need fast, GLM-compatible math operations. The permissive license, zero runtime dependencies, and broad platform support make it low-friction to adopt. The aging maintenance status (261 days since release) is a minor concern but not a blocker for stable, well-established functionality. Verify that the specific GLM features you need are supported (some experimental extensions are not).

Install

pyglm on PyPI

pip

pip install pyglm

uv

uv add pyglm

poetry

poetry add pyglm

Installing pyglm

Before you install

Medium install friction due to compiled wheels; however, prebuilt binaries are available for Python 3.9–3.14 across Windows, macOS, and Linux. Last release was 261 days ago; repository is not archived but maintenance appears aging.

License in practice

Licensed under Zlib (permissive). The package documentation explicitly requires including the COPYING file in projects using PyGLM, particularly for binary distributions—a distribution obligation that is lighter than copyleft but still requires active compliance.

Quickstart

pip install pyglm
from pyglm import glm

v1 = glm.vec3(1, 2, 3)
v2 = glm.vec3(4, 5, 6)
result = glm.cross(v1, v2)
print(result)

Verify before relying

  • Whether the aging maintenance status (261 days since last release) affects stability or feature completeness for current graphics APIs
  • Performance comparison claims to NumPy are mentioned in the description but specific benchmarks are not provided in the fact sheet

Package facts

License Zlib (permissive)
Python support not specified
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance aging — 261 days since the last release
Last repo commit
First released
Downloads 304,484/month — #7,804 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pyglm-2.8.3-cp310-cp310-macosx_10_9_x86_64.whl; pyglm-2.8.3-cp310-cp310-macosx_11_0_arm64.whl; pyglm-2.8.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; pyglm-2.8.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pyglm-2.8.3-cp310-cp310-manylinux_2_34_aarch64.whl; pyglm-2.8.3-cp310-cp310-manylinux_2_34_x86_64.whl; pyglm-2.8.3-cp310-cp310-musllinux_1_2_aarch64.whl; pyglm-2.8.3-cp310-cp310-musllinux_1_2_x86_64.whl; pyglm-2.8.3-cp310-cp310-win_amd64.whl; pyglm-2.8.3-cp310-cp310-win_arm64.whl; pyglm-2.8.3-cp311-cp311-macosx_10_9_x86_64.whl; pyglm-2.8.3-cp311-cp311-macosx_11_0_arm64.whl; pyglm-2.8.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; pyglm-2.8.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pyglm-2.8.3-cp311-cp311-manylinux_2_34_aarch64.whl; pyglm-2.8.3-cp311-cp311-manylinux_2_34_x86_64.whl; pyglm-2.8.3-cp311-cp311-musllinux_1_2_aarch64.whl; pyglm-2.8.3-cp311-cp311-musllinux_1_2_x86_64.whl; pyglm-2.8.3-cp311-cp311-win_amd64.whl; pyglm-2.8.3-cp311-cp311-win_arm64.whl

Keywords: GLM, OpenGL, matrix, vector, vec, mat, Mathematics, 3D, python, python3, 3, library, python-c-api, c-api, math-library, numpy, pyrr, pip, pypi, matrix-manipulation, matrix-multiplication, matrix-functions, quaternion, c, glsl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: zlib/libpng LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Multimedia :: GraphicsTopic :: Scientific/Engineering :: PhysicsTopic :: Software Development :: LibrariesTyping :: Typed

Tags

opengl mathematics pythonvector matrix operations graphicsglm python bindings3d graphics math libraryquaternion rotation matricesglsl math functions pythonlinear algebra graphics
graphics-mathglm-bindingsperformance-critical

More Libraries packages