Skip to main content

Downloads PyPI PyPI - Python Version PyPI - Wheel GitHub


What is it?

goopylib is powerful game, graphics, and GUI library for Python and C++ to build cross-platform applications. It allows you to unlock the potential of OpenGL and low-level graphics with a high-level, simple-yet-powerful API.

Key Features:

  • Cross-Platform & Powerful
  • Fast! Built-in batch-rendering & optimizations
  • Accessible through Python & C++
  • Simple code to create, transform, & animate images, quads, triangles, circles, and more
  • Automatic 2D Orthographic Camera & Camera Controller
  • Window & Mouse events: key & button presses, several callbacks, etc.

In Development:

  • Text Rendering
  • GUI Elements
  • Animation Engine
  • Texture Factory
  • Low-Level API Access

Future Plans:

  • 2D Rigid-Body Physics Engine
  • Sound & Lighting Engine
  • Profiling Tools
  • Build & Distribution Tools

Examples

Solar System Simulator:

https://github.com/BhavyeMathur/goopylib-solar-system-simulation

Brick Breaker:

https://github.com/BhavyeMathur/goopylib-brick-breaker

Conway's Game of Life:

https://github.com/BhavyeMathur/goopylib-conways-game-of-life

Installation

Requires Python ≥ 3.8. To install goopylib on Windows or MacOS, use the Python Package Index (PyPI):

pip install goopylib

Wheels for Linux are not currently supported but coming as soon as I can build them!

Tutorial

Let's start by creating a rectangle on an empty window:

import goopylib as gp

window = gp.Window(700, 500)  # width=700, height=500

# centered at (0, 0), width=100, height=50
rect = gp.Rectangle((0, 0), 100, 50).draw(window)

while window.is_open():
    gp.update()

Inside the loop, you can check for events (or define callbacks instead):

while window.is_open():
    if window.check_key(gp.KEY_H):
        rect.hide()
    elif window.check_key(gp.KEY_S):
        rect.show()
    
    mousex, mousey = window.get_mouse_position()
    
    if rect.contains(mousex, mousey):
        print("Hovering over the rectangle!")
        
    gp.update()

Draw other shapes or more complex objects:

img = gp.Image("filepath.png", (0, 0)).draw(window)

Install a simple camera controller that automatically moves, rotates, and zooms in & out!

controller = gp.CameraController(window)

while window.is_open():
    # ...
    controller.update()

Documentation

The documentation for goopylib can be found here. Please submit an issue or email bhavyemathur@gmail.com for any questions!

Contributing & Usage

Contributions to goopylib are absolutely welcome! Please reach out to me if you have an idea or feature request or submit a pull request yourself. I'd love to hear if you've used goopylib for a project—maybe we could even add some screenshots to a gallery.

goopylib is licensed under the Mozilla Public License Version 2.0 which essentially enables you use and modify goopylib (commercially or otherwise) as long as you attribute the project! See choosealicense.com for more details.

Metadata

Release files for goopylib 2.1.0

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

Source distribution (sdist)

Source distribution for goopylib 2.1.0
File Size Uploaded
goopylib-2.1.0.tar.gz 7.4 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for goopylib 2.1.0
File
goopylib-2.1.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
goopylib-2.1.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
goopylib-2.1.0-cp311-cp311-macosx_10_9_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.9+ x86-64 Details
goopylib-2.1.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
goopylib-2.1.0-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details
goopylib-2.1.0-cp310-cp310-macosx_10_9_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64 Details
goopylib-2.1.0-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
goopylib-2.1.0-cp39-cp39-macosx_11_0_arm64.whl CPython 3.9 CPython 3.9 macOS 11.0+ ARM64 Details
goopylib-2.1.0-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details
goopylib-2.1.0-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
goopylib-2.1.0-cp38-cp38-macosx_11_0_arm64.whl CPython 3.8 CPython 3.8 macOS 11.0+ ARM64 Details
goopylib-2.1.0-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details

Total release size: 41.6 MB

Release files / goopylib-2.1.0.tar.gz

Download URL goopylib-2.1.0.tar.gz
Size 7.4 MB
Tags Source
SHA-256 checksum
How to use checksums
93383f312dba09b2eb44c751ce5061574a7d6f791732a8f7a49e01218c720c09
BLAKE2b-256 checksum
How to use checksums
71ada205193a7f1ed620504a69b544a7ff4f2e203b18d9dc1bd860a7682d8201
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / goopylib-2.1.0-cp311-cp311-win_amd64.whl

Download URL goopylib-2.1.0-cp311-cp311-win_amd64.whl
Size 1.3 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
631ea1d06eb2e73e1cd2baf44637cdd718250c3b2c6ea86ba6be384f3cd49911
BLAKE2b-256 checksum
How to use checksums
6f085bdbaeaffffcbb923dfb38a91f9082d3d9635deccc2e42f749b9a01a43ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / goopylib-2.1.0-cp311-cp311-macosx_11_0_arm64.whl

Download URL goopylib-2.1.0-cp311-cp311-macosx_11_0_arm64.whl
Size 3.6 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
24fce9470b2b8ee29485ed34fe1bc046c712bc95ed89c528e45dfb765ea9afb9
BLAKE2b-256 checksum
How to use checksums
b55b3f7c4cb3a74366eed271fa4b454c48a42539f0afe19956dd31e6f77158ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / goopylib-2.1.0-cp311-cp311-macosx_10_9_x86_64.whl

Download URL goopylib-2.1.0-cp311-cp311-macosx_10_9_x86_64.whl
Size 3.7 MB
Tags CPython 3.11 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
94ae3f816e4b7c500a247353ba0e015a1574e666f26ccca5d4ea58d0076da46c
BLAKE2b-256 checksum
How to use checksums
d37a0d10e4d49e1d0f929df38f8505f93435698e927e2f8b6803b2b783f51f65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / goopylib-2.1.0-cp310-cp310-win_amd64.whl

Download URL goopylib-2.1.0-cp310-cp310-win_amd64.whl
Size 1.3 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
5ef4f263b2ea9ea040a2104b8b65bac3383fcd58ce7b7d88d27d5c1d5cb0f1cf
BLAKE2b-256 checksum
How to use checksums
ee31dfc119f7cc9a063646b950266c2d0fdf08a53945eca4a6ec7ee570f641c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / goopylib-2.1.0-cp310-cp310-macosx_11_0_arm64.whl

Download URL goopylib-2.1.0-cp310-cp310-macosx_11_0_arm64.whl
Size 3.6 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c68b3f4e69dec267681c7bc51a6a75eb73012e653d086f501b7acbace445c2b9
BLAKE2b-256 checksum
How to use checksums
3bdae3087fb36bb598534ba3e9c233ccb05a798e5cc1a09e269c411af308121c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / goopylib-2.1.0-cp310-cp310-macosx_10_9_x86_64.whl

Download URL goopylib-2.1.0-cp310-cp310-macosx_10_9_x86_64.whl
Size 3.7 MB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
c57615577cc7ed29b2253b1ef26e14e03afbf9bcd8de5232c676206ab9b1e5cb
BLAKE2b-256 checksum
How to use checksums
f70bd2e1ddd332c5e89ff22af457149b2c5fe83d0a6d9bb047f3ceafca83d87b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / goopylib-2.1.0-cp39-cp39-win_amd64.whl

Download URL goopylib-2.1.0-cp39-cp39-win_amd64.whl
Size 1.3 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
6c4b7dc0d3184ec03f6419396270aa75ff1f2e8538c2be5eeedef9a53c3efe31
BLAKE2b-256 checksum
How to use checksums
9278ac76d955f837f0908093eb60e7b6d4455596b8ed9a2545736007c74cf104
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / goopylib-2.1.0-cp39-cp39-macosx_11_0_arm64.whl

Download URL goopylib-2.1.0-cp39-cp39-macosx_11_0_arm64.whl
Size 3.6 MB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8fb8137e1d658a12f53818bfdd1562c106e1d4c75cb60a3eb6d396c2d25b8459
BLAKE2b-256 checksum
How to use checksums
9977cc741bde26fe4c8e254458ae6dfb2e1b48761793bab24a5b4af391a11e5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / goopylib-2.1.0-cp39-cp39-macosx_10_9_x86_64.whl

Download URL goopylib-2.1.0-cp39-cp39-macosx_10_9_x86_64.whl
Size 3.7 MB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
eb26d690ca40c218a731608252c7e24b77a3504b2c42f4bee2a22f7e27498dd6
BLAKE2b-256 checksum
How to use checksums
2a81d41828aa8e11dbd8f324261600f39cf6edd98cc27180faa4c9b17836c0ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / goopylib-2.1.0-cp38-cp38-win_amd64.whl

Download URL goopylib-2.1.0-cp38-cp38-win_amd64.whl
Size 1.3 MB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
bc9f1dd99807e45c0d0bbfd287cb9bb1d61bf63fe39fe1fe7f332daec9119d7e
BLAKE2b-256 checksum
How to use checksums
394a725e8857aa284d0055aa5e9f55f25f51fcaed1c9186f50e2d78b846f6c7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / goopylib-2.1.0-cp38-cp38-macosx_11_0_arm64.whl

Download URL goopylib-2.1.0-cp38-cp38-macosx_11_0_arm64.whl
Size 3.6 MB
Tags CPython 3.8 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
5d50f1c91dc01d04388a17e0d342eaadd539c0ef83a196a442badbaa42929611
BLAKE2b-256 checksum
How to use checksums
40d8cf4816b93212e8a713d4f80dc7230fe0e781768ca8297b5c0b9223dc93d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / goopylib-2.1.0-cp38-cp38-macosx_10_9_x86_64.whl

Download URL goopylib-2.1.0-cp38-cp38-macosx_10_9_x86_64.whl
Size 3.7 MB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
037ad4b077278e9a2ea128bec2b7bce4978944fbb9432b08fb3adab17af07520
BLAKE2b-256 checksum
How to use checksums
a98d5ab6c67d874b4db97c7254ec9a7763ec3604f284dc77fb2b94988f17f85e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release history Release notifications | RSS feed

This release

2.1.0 This release

13 release files

2.0.0

13 release files

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