pyglm
OpenGL Mathematics library for Python
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 pyglmuv
uv add pyglmpoetry
poetry add pyglmInstalling 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
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
euclid3Provides 2D and 3D vector, matrix, quaternion,…
unclear · top 15,000 on PyPI
transformationsCalculates 4x4 homogeneous transformation…
permissive · top 5,000 on PyPI
PyOpenGLPyOpenGL provides standard OpenGL bindings for…
permissive · top 5,000 on PyPI
spglmFits Gaussian, Poisson, QuasiPoisson, and…
permissive · top 15,000 on PyPI
modernglModernGL is a Python wrapper over OpenGL Core…
permissive · top 15,000 on PyPI
PyGEL3DPyGEL3D provides Python bindings for a C++…
permissive · top 15,000 on PyPI
glfwPython bindings for GLFW 3 that wrap the C…
permissive · top 5,000 on PyPI
pygletpyglet is a cross-platform windowing and…
unclear · top 5,000 on PyPI
glumglum is a high-performance Python library for…
permissive · top 15,000 on PyPI
wgpuwgpu-py provides a Python binding to WebGPU, a…
permissive · top 15,000 on PyPI