A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pygfx/pygfx below:

pygfx/pygfx: Powerful and versatile visualization for Python.


Pygfx

The purpose of Pygfx is to bring powerful and reliable visualization to the Python world. 🚀

Pygfx (py-graphics) is built on wgpu, enabling superior performance and reliability compared to OpenGL-based solutions. It is designed for simplicity and versatility: with its modular architecture, you can effortlessly assemble graphical scenes for diverse applications, from scientific visualization to video game rendering.

[User Guide] [Example Gallery] [API Reference]

Need help? We offer professional support.

pip install -U pygfx glfw

To work correctly, Pygfx needs some window to render to. Glfw is one lightweight option, but there are others, too. If you use a different wgpu-compatible window manager or only render offscreen you may choose to omit glfw. Examples of alternatives include: jupyter_rfb (rendering in Jupyter), PyQt, PySide, or wx.

In addition there are some platform requirements, see the wgpu docs. In essence, you need modern (enough) graphics drivers, and pip>=20.3.

We're currently working towards version 1.0, which means that the API can change with each version. We expect to reach 1.0 near July 2026, at which point we start caring about backwards compatibility.

This means that until then, you should probably pin the Pygfx version that you're using, and check the release notes when you update.

Note The example below is designed against the main branch, and may not work on the latest release from pypi, while we're in beta.

Note A walkthrough of this example can be found in the guide.

import pygfx as gfx
import pylinalg as la

cube = gfx.Mesh(
    gfx.box_geometry(200, 200, 200),
    gfx.MeshPhongMaterial(color="#336699"),
)

rot = la.quat_from_euler((0, 0.01), order="XY")

def animate():
    cube.local.rotation = la.quat_mul(rot, cube.local.rotation)

if __name__ == "__main__":
    gfx.show(cube, before_render=animate)

Some of Pygfx's key features are:

And many more! Check out our feature demos in the docs.

Pygfx is licensed under the BSD 2-Clause "Simplified" License. This means:

See CONTRIBUTING.md.

To get a working dev install of Pygfx you can use the following steps:

# Click the Fork button on GitHub and navigate to your fork
git clone <address_of_your_fork>
cd pygfx
# if you use a venv, create and activate it
pip install -e ".[dev,docs,examples]"
pytest tests

The test suite is divided into three parts; unit tests for the core, unit tests for the examples, and screenshot tests for the validation examples.

The screenshot tests are difficult to guarantee across all development platforms and are best run on our CI where more predictable outcomes can be achieved. They can run on a local linux machine by selecting the software rendering adapter and the tests with the command

Note that our pytest.ini file contains the environment variable PYGFX_DISABLE_SYSTEM_FONTS=1 to help ensure consistency across system installations.

Our code of conduct can be found here: Code of Conduct

Spelling and pronunciation

Lowercase "pygfx" is used in code. You can refer to the project in written text using "Pygfx". Pygfx is pronounced as pie-graphics.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4