Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

preview

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
  • Newer OpenGL features (compute, mesh shaders, indirect drawing, 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()
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.0b1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for moderngl 6.0.0b1
File Size Uploaded Provenance Actions
moderngl-6.0.0b1.tar.gz 63.2 kB Without provenance Details for moderngl-6.0.0b1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for moderngl 6.0.0b1
File Actions
moderngl-6.0.0b1-cp314-cp314t-musllinux_1_2_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ x86-64 Details for moderngl-6.0.0b1-cp314-cp314t-musllinux_1_2_x86_64.whl
moderngl-6.0.0b1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for moderngl-6.0.0b1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
moderngl-6.0.0b1-cp314-cp314-musllinux_1_2_x86_64.whl CPython 3.14 CPython 3.14 Linux musl 1.2+ x86-64 Details for moderngl-6.0.0b1-cp314-cp314-musllinux_1_2_x86_64.whl
moderngl-6.0.0b1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for moderngl-6.0.0b1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
moderngl-6.0.0b1-cp313-cp313-musllinux_1_2_x86_64.whl CPython 3.13 CPython 3.13 Linux musl 1.2+ x86-64 Details for moderngl-6.0.0b1-cp313-cp313-musllinux_1_2_x86_64.whl
moderngl-6.0.0b1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for moderngl-6.0.0b1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
moderngl-6.0.0b1-cp312-cp312-musllinux_1_2_x86_64.whl CPython 3.12 CPython 3.12 Linux musl 1.2+ x86-64 Details for moderngl-6.0.0b1-cp312-cp312-musllinux_1_2_x86_64.whl
moderngl-6.0.0b1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details for moderngl-6.0.0b1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
moderngl-6.0.0b1-cp311-cp311-musllinux_1_2_x86_64.whl CPython 3.11 CPython 3.11 Linux musl 1.2+ x86-64 Details for moderngl-6.0.0b1-cp311-cp311-musllinux_1_2_x86_64.whl
moderngl-6.0.0b1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details for moderngl-6.0.0b1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Total release size: 2.3 MB

Release files / moderngl-6.0.0b1.tar.gz

Download URL moderngl-6.0.0b1.tar.gz
Size 63.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d23d8483067b9926af33e746ee2c47f851ba87261876b51879c5481af1b598a3
BLAKE2b-256 checksum
How to use checksums
7ec207d085b5cb7b4213c12ac08712f95e8fec941e7ac272d4eab63a61e15770
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.0b1-cp314-cp314t-musllinux_1_2_x86_64.whl

Download URL moderngl-6.0.0b1-cp314-cp314t-musllinux_1_2_x86_64.whl
Size 238.6 kB
Tags CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
5be962b7dfddfd50f01f766f3baf646cfcccefd46ad4d40df3bf02bcd90d061c
BLAKE2b-256 checksum
How to use checksums
8ee43cb183fd0c79dddc7c33d2c8cac5ca1703fd5143dd885f73b4290fbbc6cb
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.0b1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL moderngl-6.0.0b1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 244.0 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
5329650a2ec75e5ef796d44acf8dd44c7eb1110c885ead15ebe2f810ce94f3a2
BLAKE2b-256 checksum
How to use checksums
61686fa6889eb795a801426acc3ac51078faa25838bfa9ab51f242b9cf42d750
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.0b1-cp314-cp314-musllinux_1_2_x86_64.whl

Download URL moderngl-6.0.0b1-cp314-cp314-musllinux_1_2_x86_64.whl
Size 212.7 kB
Tags CPython 3.14 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
ee48ef6efe2b289739c3142af8f3e1f5c38e06ca6c36d3a7aa292f59246cda85
BLAKE2b-256 checksum
How to use checksums
57386945ed091305aaa9a9f49e2f552d5f94481a5c1698a45c45f7e00d28c451
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.0b1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL moderngl-6.0.0b1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 216.3 kB
Tags CPython 3.14 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
62d0c2c3885f682f15e11ac6a597d73b7536c01cd6273c90cf68e69c8744c8e7
BLAKE2b-256 checksum
How to use checksums
bc83d9100f97c4ce557d3881f1086a58c6e42635d0728bd397a88cc88b299b5d
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.0b1-cp313-cp313-musllinux_1_2_x86_64.whl

Download URL moderngl-6.0.0b1-cp313-cp313-musllinux_1_2_x86_64.whl
Size 213.5 kB
Tags CPython 3.13 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
5015533396a06736bddd4248b9cb7f51b09d0eef7ff515d57ea9a048d9bdeab3
BLAKE2b-256 checksum
How to use checksums
a870529de3dd2ba25ad485a60d1fd6f2911f416eb9382758800497dc3b4e5e26
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.0b1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL moderngl-6.0.0b1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 217.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
ed149fa6b3f516410c38c6b84bd675ce969bf217086654c399825126846c835e
BLAKE2b-256 checksum
How to use checksums
268aa57a695a6db5ff3cbbd8d940248b639fc71464dbc5f57cfc159d3ad3e2e4
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.0b1-cp312-cp312-musllinux_1_2_x86_64.whl

Download URL moderngl-6.0.0b1-cp312-cp312-musllinux_1_2_x86_64.whl
Size 214.1 kB
Tags CPython 3.12 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
595ad355b57717718ec5b4e8cc8b015f52be7f05fd4189200d7f7c8243ab70c3
BLAKE2b-256 checksum
How to use checksums
38c93d6e5145d61753551e146f6db7c2c98e2f37d0e964945e7bbbb0a2d52e76
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.0b1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL moderngl-6.0.0b1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 217.6 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
78500d9fecaaf7c9bd40e161acbb50bd32f6f87970668f5a4d0dcf06a642556b
BLAKE2b-256 checksum
How to use checksums
1d5f29b91aebb026f8850f985326d025af67b1d0aa00e1166c60f955baa3e155
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.0b1-cp311-cp311-musllinux_1_2_x86_64.whl

Download URL moderngl-6.0.0b1-cp311-cp311-musllinux_1_2_x86_64.whl
Size 207.2 kB
Tags CPython 3.11 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
a20880e6fd23a9b3c6f61096fe5a198ddfd4b3a60f04b9621a24fb0e5c4668f4
BLAKE2b-256 checksum
How to use checksums
215b0f3c19a487cb7c98e43b02d39cb96af3be1ab52c27918d07ba68e9264d90
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.0b1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL moderngl-6.0.0b1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 210.4 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
6b9756b395c23dbaa741feac0c7e71f101279b649253f336c66d3b963a80b8bb
BLAKE2b-256 checksum
How to use checksums
8a61f13737ef7744321622b938faa07534fc8ddcf2fc6c100b0c2104a90b2123
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.0b1

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.

Release history Release notifications | RSS feed

This release

0.8.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page