--- id: glfw version: "2.10.2" license: MIT license_treatment: permissive maintenance: active --- # glfw — A ctypes-based wrapper for GLFW3. License: permissive · Maintenance: active · Downloads: 3.6M/mo ## What it is and what it does glfw is a ctypes-based wrapper around GLFW 3, a C library for creating windows, handling input, and managing OpenGL contexts across Windows, macOS, and Linux. It translates the GLFW C API into pythonic function names and replaces low-level constructs (pointers, structs) with Python sequences and namedtuples, making it easier to use from Python code. The package bundles pre-compiled GLFW libraries in wheels for common platforms, though you can override them with custom builds or system libraries via environment variables. Typical use is to initialize GLFW, create a window with an OpenGL context, then poll events in a render loop while your graphics code draws. It has no runtime dependencies beyond the GLFW library itself (which is bundled), so it's lightweight once installed. Error handling can be configured to report GLFW errors as warnings, exceptions, or log messages, and it supports both the original GLFW naming convention and a pythonic alternative. Use it for: - Building 3D graphics applications with OpenGL by managing windows and input events - Creating cross-platform desktop tools that need windowing and keyboard/mouse input - Prototyping interactive visualizations or scientific simulations with graphics output - Wrapping or extending GLFW functionality in Python without writing C bindings yourself - Running frozen executables (cx_Freeze, PyInstaller) that require windowing on multiple platforms ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Python bindings for GLFW 3 that wrap the C library via ctypes, providing window creation, input handling, and OpenGL context management with a pythonic API. Yes, if you need to build OpenGL applications or interactive graphics tools in Python. The package is actively maintained, has no known vulnerabilities, uses a permissive license, and pre-built wheels eliminate most installation friction. Medium friction remains due to native library dependencies, but this is inherent to GLFW itself, not the wrapper. Not necessary if you only need 2D graphics or don't require low-level window control. ## Install pip install glfw uv add glfw poetry add glfw ## Installing glfw Before you install: Medium install friction due to native library dependencies, but wheels are pre-built for Windows, macOS (Intel and ARM), and Linux (x86_64 and aarch64). Active maintenance with a release 24 days ago. License in practice: MIT license is permissive; you can use, modify, and distribute this package freely in commercial or private projects with minimal restrictions. Quickstart: pip install glfw import glfw if glfw.init(): window = glfw.create_window(640, 480, "Hello", None, None) glfw.make_context_current(window) glfw.terminate() Requires GLFW shared library; wheels include it for Windows, macOS, and Linux, but custom builds or system libraries may be needed on some platforms. Set PYGLFW_LIBRARY to override the bundled library path. Verify before relying: - Whether the package supports modern Python versions beyond 2 and 3 (classifiers list both but requires_python is unspecified) - Performance characteristics and latency for real-time graphics applications - Compatibility with Wayland on Linux (description mentions detection but not guarantees) ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: medium - Maintenance: active - Downloads: 3.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags glfw python bindings, window creation opengl, cross-platform windowing library, glfw3 ctypes wrapper, opengl context management, input handling keyboard mouse, graphics window management, opengl, windowing, graphics [View on SkillFed](https://skillfed.io/packages/glfw) · [View on PyPI](https://pypi.org/project/glfw/)