Skip to main content

A powerful game, graphics, and application development library for Python

Project description

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.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

goopylib-2.1.0.tar.gz (7.4 MB view details)

Uploaded Source

Built Distributions

goopylib-2.1.0-cp311-cp311-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.11 Windows x86-64

goopylib-2.1.0-cp311-cp311-macosx_11_0_arm64.whl (3.6 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

goopylib-2.1.0-cp311-cp311-macosx_10_9_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

goopylib-2.1.0-cp310-cp310-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.10 Windows x86-64

goopylib-2.1.0-cp310-cp310-macosx_11_0_arm64.whl (3.6 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

goopylib-2.1.0-cp310-cp310-macosx_10_9_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

goopylib-2.1.0-cp39-cp39-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.9 Windows x86-64

goopylib-2.1.0-cp39-cp39-macosx_11_0_arm64.whl (3.6 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

goopylib-2.1.0-cp39-cp39-macosx_10_9_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

goopylib-2.1.0-cp38-cp38-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.8 Windows x86-64

goopylib-2.1.0-cp38-cp38-macosx_11_0_arm64.whl (3.6 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

goopylib-2.1.0-cp38-cp38-macosx_10_9_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

Details for the file goopylib-2.1.0.tar.gz.

File metadata

  • Download URL: goopylib-2.1.0.tar.gz
  • Upload date:
  • Size: 7.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for goopylib-2.1.0.tar.gz
Algorithm Hash digest
SHA256 93383f312dba09b2eb44c751ce5061574a7d6f791732a8f7a49e01218c720c09
MD5 1f6adfb489a22421da8a7a687883fe81
BLAKE2b-256 71ada205193a7f1ed620504a69b544a7ff4f2e203b18d9dc1bd860a7682d8201

See more details on using hashes here.

File details

Details for the file goopylib-2.1.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for goopylib-2.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 631ea1d06eb2e73e1cd2baf44637cdd718250c3b2c6ea86ba6be384f3cd49911
MD5 5f49dd1fdc8214694ae412779026aac6
BLAKE2b-256 6f085bdbaeaffffcbb923dfb38a91f9082d3d9635deccc2e42f749b9a01a43ff

See more details on using hashes here.

File details

Details for the file goopylib-2.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for goopylib-2.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 24fce9470b2b8ee29485ed34fe1bc046c712bc95ed89c528e45dfb765ea9afb9
MD5 57c48d49c4bc794657482cf6217856fd
BLAKE2b-256 b55b3f7c4cb3a74366eed271fa4b454c48a42539f0afe19956dd31e6f77158ef

See more details on using hashes here.

File details

Details for the file goopylib-2.1.0-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for goopylib-2.1.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 94ae3f816e4b7c500a247353ba0e015a1574e666f26ccca5d4ea58d0076da46c
MD5 7f8742ba1181859d3bf7ee923457ce0f
BLAKE2b-256 d37a0d10e4d49e1d0f929df38f8505f93435698e927e2f8b6803b2b783f51f65

See more details on using hashes here.

File details

Details for the file goopylib-2.1.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for goopylib-2.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 5ef4f263b2ea9ea040a2104b8b65bac3383fcd58ce7b7d88d27d5c1d5cb0f1cf
MD5 36e7516aa282e713f6fd4cc0a6a394b9
BLAKE2b-256 ee31dfc119f7cc9a063646b950266c2d0fdf08a53945eca4a6ec7ee570f641c1

See more details on using hashes here.

File details

Details for the file goopylib-2.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for goopylib-2.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c68b3f4e69dec267681c7bc51a6a75eb73012e653d086f501b7acbace445c2b9
MD5 8413607e4cca1cc67530cff6861ed8d1
BLAKE2b-256 3bdae3087fb36bb598534ba3e9c233ccb05a798e5cc1a09e269c411af308121c

See more details on using hashes here.

File details

Details for the file goopylib-2.1.0-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for goopylib-2.1.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c57615577cc7ed29b2253b1ef26e14e03afbf9bcd8de5232c676206ab9b1e5cb
MD5 709b3b01baf22c509675746398feeae7
BLAKE2b-256 f70bd2e1ddd332c5e89ff22af457149b2c5fe83d0a6d9bb047f3ceafca83d87b

See more details on using hashes here.

File details

Details for the file goopylib-2.1.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: goopylib-2.1.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for goopylib-2.1.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 6c4b7dc0d3184ec03f6419396270aa75ff1f2e8538c2be5eeedef9a53c3efe31
MD5 b9fdd8cea607fa823835ee6009c9414c
BLAKE2b-256 9278ac76d955f837f0908093eb60e7b6d4455596b8ed9a2545736007c74cf104

See more details on using hashes here.

File details

Details for the file goopylib-2.1.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for goopylib-2.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8fb8137e1d658a12f53818bfdd1562c106e1d4c75cb60a3eb6d396c2d25b8459
MD5 7ed8ba0bae8d2e7aac695cc7add30a77
BLAKE2b-256 9977cc741bde26fe4c8e254458ae6dfb2e1b48761793bab24a5b4af391a11e5c

See more details on using hashes here.

File details

Details for the file goopylib-2.1.0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for goopylib-2.1.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 eb26d690ca40c218a731608252c7e24b77a3504b2c42f4bee2a22f7e27498dd6
MD5 70b3ff95cdc7f776c2591a5733158877
BLAKE2b-256 2a81d41828aa8e11dbd8f324261600f39cf6edd98cc27180faa4c9b17836c0ae

See more details on using hashes here.

File details

Details for the file goopylib-2.1.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: goopylib-2.1.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for goopylib-2.1.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 bc9f1dd99807e45c0d0bbfd287cb9bb1d61bf63fe39fe1fe7f332daec9119d7e
MD5 0afab27ba0ac6f09fd9bcfddd8a63ede
BLAKE2b-256 394a725e8857aa284d0055aa5e9f55f25f51fcaed1c9186f50e2d78b846f6c7c

See more details on using hashes here.

File details

Details for the file goopylib-2.1.0-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for goopylib-2.1.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5d50f1c91dc01d04388a17e0d342eaadd539c0ef83a196a442badbaa42929611
MD5 2456054ef44a5caea95ea263666f93a3
BLAKE2b-256 40d8cf4816b93212e8a713d4f80dc7230fe0e781768ca8297b5c0b9223dc93d0

See more details on using hashes here.

File details

Details for the file goopylib-2.1.0-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for goopylib-2.1.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 037ad4b077278e9a2ea128bec2b7bce4978944fbb9432b08fb3adab17af07520
MD5 863ef4adff5c48ad858f65fa7724e201
BLAKE2b-256 a98d5ab6c67d874b4db97c7254ec9a7763ec3604f284dc77fb2b94988f17f85e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page