This release is a pre-release and may not be stable for production use.
ModernGL
ModernGL is a thin Python layer over OpenGL 3.3 core. It keeps the OpenGL model, removes the boilerplate and checks what can be checked up front. No dependencies, the window comes from your own library of choice, and the same code runs in the browser with Pyodide and WebGL2.
pip install --pre moderngl
Features
- Python 3.11 or newer, the free-threaded build included
- No dependencies, no OpenGL headers or libraries needed to build
- The window comes from your own library of choice (pygame-ce, moderngl-window, pyglet, glfw, ...)
- Headless rendering with
moderngl.headless_context(), no extra package, no display server, see Headless - Compute shaders, storage buffers and indirect drawing on OpenGL 4.3, storage images on OpenGL 4.2
- Newer OpenGL features (mesh shaders, GPU draw counts, queries) through small extension modules
Sample usage
>>> import moderngl
>>> ctx = moderngl.get_context()
>>> buf = ctx.buffer(b'Hello World!') # allocated on the GPU
>>> buf.read().wait()
b'Hello World!'
The examples run from the repository root, their dependencies are pinned in requirements.txt:
pip install -r requirements.txt
python examples/hello_triangle.py
TODO
- Upgrade moderngl-window to ModernGL 6
- Test the Windows and macOS builds
- Test an ANGLE build to run ModernGL on macOS without OpenGL
Citation
If you need to cite this repository in academic research:
@Online{Dombi2020,
author = {Szabolcs Dombi},
title = {ModernGL, high performance python bindings for OpenGL 3.3+},
date = {2020-05-01},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/moderngl/moderngl}},
commit = {<insert hash if needed>}
}
The commit hash can be found in the Releases.
Community
Metadata
Release files for moderngl 6.0.0b2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| moderngl-6.0.0b2.tar.gz | 75.2 kB | Without provenance | Details for moderngl-6.0.0b2.tar.gz |
Built distributions (wheels)
Total release size: 2.8 MB
Release files / moderngl-6.0.0b2.tar.gz
| Download URL | moderngl-6.0.0b2.tar.gz |
|---|---|
| Size | 75.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2d9d4a23f7cb48a7ba9251e2eb9029732b9a320b3f32ba4fa4f808ccc599f9f5
|
|
BLAKE2b-256 checksum How to use checksums |
a3b0b0dacfdbe89237879f0b15d6d05dea40a19872866a940a7b137f551cd018
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Release files / moderngl-6.0.0b2-cp314-cp314t-win_amd64.whl
| Download URL | moderngl-6.0.0b2-cp314-cp314t-win_amd64.whl |
|---|---|
| Size | 67.8 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading Windows x86-64 |
|
SHA-256 checksum How to use checksums |
9aadb73c7384e67f442f4b7c299ed9dd7435111d9abbf1aaccf84dcb049c188b
|
|
BLAKE2b-256 checksum How to use checksums |
e47a23128395b7dc2fae6b75b19b3516cbd1d8969a90d815d2edcb64c5fc37f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Release files / moderngl-6.0.0b2-cp314-cp314t-musllinux_1_2_x86_64.whl
| Download URL | moderngl-6.0.0b2-cp314-cp314t-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 267.2 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
d6ef08ca8b8315d8dbe22c3a598b65748b8e4fc192ad745b67fa3900750be257
|
|
BLAKE2b-256 checksum How to use checksums |
2cf7f588158ebe5a4dd0385b11f27f20f7f18dee34bc9c71485f985f12ea038d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Release files / moderngl-6.0.0b2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | moderngl-6.0.0b2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 272.9 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
e61972e6a25d0e5de2aa6259a1b75d2324f005b6d1438ff0c2d192788db6c09e
|
|
BLAKE2b-256 checksum How to use checksums |
279b5977b0d6e0758bee9e0c0bca6c662fbeb3e0d843471c247d86339f4ab76a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Release files / moderngl-6.0.0b2-cp314-cp314-win_amd64.whl
| Download URL | moderngl-6.0.0b2-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 65.3 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
006b9eef37bc3ab8778892009a96d86b524b72dc0c64f4dcbe347f1c550e98bb
|
|
BLAKE2b-256 checksum How to use checksums |
43dd82aa62f19fb2ac0ed46096999721af7c4c893a918eb22468e9f88504ead2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Release files / moderngl-6.0.0b2-cp314-cp314-musllinux_1_2_x86_64.whl
| Download URL | moderngl-6.0.0b2-cp314-cp314-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 234.5 kB |
| Tags | CPython 3.14 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
b6187db64c85ef2e6c970cccedcc110e9e314e5398ce81b35c77aa65894d0a7b
|
|
BLAKE2b-256 checksum How to use checksums |
291e04ac1700d75cc803d195a0190506e0ae73b058d1445af3e536c72140791c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Release files / moderngl-6.0.0b2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | moderngl-6.0.0b2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 238.5 kB |
| Tags | CPython 3.14 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
61a17321ab8063f6d57267bf89974eadd1d0ded6e8cf12b01642fd01a0d4b8a3
|
|
BLAKE2b-256 checksum How to use checksums |
255d4e0a238edd82302723b34ae52eb76c7c68f952bea2430329ed098f2ba5a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Release files / moderngl-6.0.0b2-cp313-cp313-win_amd64.whl
| Download URL | moderngl-6.0.0b2-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 63.5 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
87dacf3dfbd50d0afb53b881cfb5f1e7138d6861af4bbe17327bc56847cc43d9
|
|
BLAKE2b-256 checksum How to use checksums |
7fe094cccc3455d2757f18e09a11de5b5c850491cea110fd9dd6b85d9a5aad54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Release files / moderngl-6.0.0b2-cp313-cp313-musllinux_1_2_x86_64.whl
| Download URL | moderngl-6.0.0b2-cp313-cp313-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 235.2 kB |
| Tags | CPython 3.13 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
6a5a787c2a6eabbe7e252006f087cd61fb17dba3e365c4c6dffbbd11e71f72d3
|
|
BLAKE2b-256 checksum How to use checksums |
d8bf9f2a82617ae069afc717e19749d7c358873122da6e1e462a7f33c37b0001
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Release files / moderngl-6.0.0b2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | moderngl-6.0.0b2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 239.2 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
0df9450ae4f3c30b0afa2bb0c386f3b227f9fdf22573ea14baaea65b9f524604
|
|
BLAKE2b-256 checksum How to use checksums |
4c08e784ecce80b96f18380d9755dc6122b5239d431ffddf5720ba1e6d7264a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Release files / moderngl-6.0.0b2-cp312-cp312-win_amd64.whl
| Download URL | moderngl-6.0.0b2-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 63.3 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
fb08ecdd5ee4ac23c943109e6ce539439844539fb84d2baa7261c9d45faa499c
|
|
BLAKE2b-256 checksum How to use checksums |
cfc5247a9edfb86fe579c677f8bccd50956c66500c5ae78341ba2442208b87de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Release files / moderngl-6.0.0b2-cp312-cp312-musllinux_1_2_x86_64.whl
| Download URL | moderngl-6.0.0b2-cp312-cp312-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 235.6 kB |
| Tags | CPython 3.12 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
861a0dd2275bdebcc3ef29795e28c7df5c9cd9b8468db93e0d48aa611afffa23
|
|
BLAKE2b-256 checksum How to use checksums |
0bdccba41ba9cdc71757d3cc66f87c683f091f73dd5eb69f063fdfda8feebe71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Release files / moderngl-6.0.0b2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | moderngl-6.0.0b2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 239.5 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
14997d067b94d8e4dab288964699bdd3084f8298a1a6e389bf0a413771da6f6e
|
|
BLAKE2b-256 checksum How to use checksums |
36460a4ccf3ae6155978fccecf2815e2d8706e9c0d12c03267f0d6fb187e7def
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Release files / moderngl-6.0.0b2-cp311-cp311-win_amd64.whl
| Download URL | moderngl-6.0.0b2-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 62.9 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
0362163326f7279fa0cf2b8a7a9b9bc22c2d0804db563cc4969391afc6da819b
|
|
BLAKE2b-256 checksum How to use checksums |
4c463bcaf04c594084392ad54aec49562943d34e63fae7461d3ab0b6fed441d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Release files / moderngl-6.0.0b2-cp311-cp311-musllinux_1_2_x86_64.whl
| Download URL | moderngl-6.0.0b2-cp311-cp311-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 228.1 kB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
a96a98e3e4fa9593d96db5cfb9e54f8365a1e632172b1882bd9d8820f708fe00
|
|
BLAKE2b-256 checksum How to use checksums |
a2ef31f625167c976948b7221467039dc0415328998d1a7a6d7923986da49c3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Release files / moderngl-6.0.0b2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | moderngl-6.0.0b2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 231.7 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
ac05e95be092cd9e188f61d90e6b56f9aa52c8d0e45622180855b58ec54e867e
|
|
BLAKE2b-256 checksum How to use checksums |
d9e8f48a385d904b3483220171cec96dbd0d9487979afa3897acbb92020b51c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Security for moderngl 6.0.0b2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.