Skip to main content

Game Boy emulator written in Python

Project description

If you have any questions, or just want to chat, join us on Discord.

It is highly recommended to read the report to get a light introduction to Game Boy emulation. But do be aware, that the Python implementation has changed a lot. The report is relevant, eventhough you want to contribute to another emulator, or create your own.

If you've read the report and want more explicit details, have a look at the Pan Docs.

If you are looking to make a bot or AI, you can find all the external components in the PyBoy Documentation. There is also a short example on our Wiki page Scripts, AI and Bots as well as in the examples directory. If more features are needed, or if you find a bug, don't hesitate to make an issue here on GitHub, or post on our Discord channel.


Rewind any game
Beat world records
Train with Reinforcement Learning

Installation

The instructions are simple if you already have a functioning Python environment on your machine.

  1. Install PyBoy using pip install pyboy (add --user if your system asks)
  2. If your system isn't supported by pysdl2-dll, you'll need to install SDL2 from your package manager.

If you need more details, or if you need to compile from source, check out the detailed installation instructions. We support: macOS, Raspberry Pi (Raspbian), Linux (Ubuntu), and Windows 10.

Now you're ready! Either use PyBoy directly from the terminal $ pyboy file.rom or use it in your Python scripts:

from pyboy import PyBoy
pyboy = PyBoy('ROMs/gamerom.gb')
while not pyboy.tick():
    pass
pyboy.stop()

Or using the context manager:

from pyboy import PyBoy
with PyBoy('ROMs/gamerom.gb') as pyboy:
    while not pyboy.tick():
        pass

When the emulator is running, you can easily access PyBoy's API:

from pyboy import WindowEvent

pyboy.send_input(WindowEvent.PRESS_ARROW_DOWN)
pyboy.tick() # Process one frame to let the game register the input
pyboy.send_input(WindowEvent.RELEASE_ARROW_DOWN)

pil_image = pyboy.screen_image()
pil_image.save('screenshot.png')

The Wiki shows how to interface with PyBoy from your own project: Wiki.

Contributors

Thanks to all the people who have contributed to the project!

Original Developers

GitHub Collaborators

Student Projects

  • Rewind Time: Jacob Olsen - JacobO1
  • Link Cable: Jonas Flach-Jensen - thejomas
  • Game Boy Color: Christian Marslev and Jonas Grønborg - CKuke and kaff3

Contribute

Any contribution is appreciated. The currently known problems are tracked in the Issues tab. Feel free to take a swing at any one of them.

For the more major features, there are the following that you can give a try. They are also described in more detail in the project list in the Wiki:

  • Link Cable
  • (Experimental) AI - use the botsupport or game wrappers to train a neural network
  • (Experimental) Game Wrappers - make wrappers for popular games

If you want to implement something which is not on the list, feel free to do so anyway. If you want to merge it into our repo, then just send a pull request and we will have a look at it.

Project details


Download files

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

Source Distribution

pyboy-1.6.14.tar.gz (7.3 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyboy-1.6.14-cp312-cp312-win_amd64.whl (11.0 MB view details)

Uploaded CPython 3.12Windows x86-64

pyboy-1.6.14-cp312-cp312-musllinux_1_2_x86_64.whl (31.4 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

pyboy-1.6.14-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (31.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

pyboy-1.6.14-cp312-cp312-macosx_10_9_universal2.whl (16.6 MB view details)

Uploaded CPython 3.12macOS 10.9+ universal2 (ARM64, x86-64)

pyboy-1.6.14-cp311-cp311-win_amd64.whl (11.0 MB view details)

Uploaded CPython 3.11Windows x86-64

pyboy-1.6.14-cp311-cp311-musllinux_1_2_x86_64.whl (31.7 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

pyboy-1.6.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (31.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

pyboy-1.6.14-cp311-cp311-macosx_10_9_universal2.whl (16.7 MB view details)

Uploaded CPython 3.11macOS 10.9+ universal2 (ARM64, x86-64)

pyboy-1.6.14-cp310-cp310-win_amd64.whl (11.0 MB view details)

Uploaded CPython 3.10Windows x86-64

pyboy-1.6.14-cp310-cp310-musllinux_1_2_x86_64.whl (29.7 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

pyboy-1.6.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (29.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

pyboy-1.6.14-cp310-cp310-macosx_11_0_x86_64.whl (12.3 MB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

pyboy-1.6.14-cp39-cp39-win_amd64.whl (11.0 MB view details)

Uploaded CPython 3.9Windows x86-64

pyboy-1.6.14-cp39-cp39-musllinux_1_2_x86_64.whl (29.8 MB view details)

Uploaded CPython 3.9musllinux: musl 1.2+ x86-64

pyboy-1.6.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (29.9 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

pyboy-1.6.14-cp39-cp39-macosx_11_0_x86_64.whl (12.4 MB view details)

Uploaded CPython 3.9macOS 11.0+ x86-64

pyboy-1.6.14-cp38-cp38-win_amd64.whl (11.0 MB view details)

Uploaded CPython 3.8Windows x86-64

pyboy-1.6.14-cp38-cp38-musllinux_1_2_x86_64.whl (30.3 MB view details)

Uploaded CPython 3.8musllinux: musl 1.2+ x86-64

pyboy-1.6.14-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (30.5 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

pyboy-1.6.14-cp38-cp38-macosx_11_0_x86_64.whl (12.6 MB view details)

Uploaded CPython 3.8macOS 11.0+ x86-64

File details

Details for the file pyboy-1.6.14.tar.gz.

File metadata

  • Download URL: pyboy-1.6.14.tar.gz
  • Upload date:
  • Size: 7.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for pyboy-1.6.14.tar.gz
Algorithm Hash digest
SHA256 a7b5b925e5465b8cb210ec04a56aa0ae512ca5a875a5ff090654e4dad5555a68
MD5 b3054e6117312d3f2f12c959b5a78650
BLAKE2b-256 37ca908d3e106158fc5ec3c50f669af9506b72b09fbcb3f6fd84af7240e7cbba

See more details on using hashes here.

File details

Details for the file pyboy-1.6.14-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pyboy-1.6.14-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 11.0 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for pyboy-1.6.14-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e434dacbf504f43e3f10abe3f5b2439ec14827c9403211ace29600dbc9d4824a
MD5 04fdae2bc62538b9eb5a81e67320e09b
BLAKE2b-256 480ec4053e6b4d4463a73e58d8cc1990fa4feeeee82679b9d6c31fd7869e7a10

See more details on using hashes here.

File details

Details for the file pyboy-1.6.14-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyboy-1.6.14-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 2744a1e99b006d7a76209172ad6a1ae5334cab1c833b85feeff262b6b979523e
MD5 dd999cdbe617b0e97b9f5519746fd723
BLAKE2b-256 5a494db7bed143ba464bea0d03b27c7afafe452cac6d2d05fe3b45b47352e071

See more details on using hashes here.

File details

Details for the file pyboy-1.6.14-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyboy-1.6.14-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 520e4be84ef4c08c1c7d06250e6c31533d5b923ec20759823e51bd6d9356cf16
MD5 e99aa1e85c83ab418a7a8f60a7719d6d
BLAKE2b-256 9c26bea37b6a91507e7f7f6eff56a62cce5f1c507c4949ec65d83723baed66f3

See more details on using hashes here.

File details

Details for the file pyboy-1.6.14-cp312-cp312-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for pyboy-1.6.14-cp312-cp312-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 48039bd2af00ce5126b48140800c77fc39c74f05794369ceba87c884d9e0c72f
MD5 f4fcabf7eed8eaa770981693c7e7f339
BLAKE2b-256 fec15b3103080a1a8112fa6c831f6dc656c4d122eb0e0b081e0fe2f3044f0e43

See more details on using hashes here.

File details

Details for the file pyboy-1.6.14-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pyboy-1.6.14-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 11.0 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for pyboy-1.6.14-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6f10052cdbb4ab21e85e7c73d23140e98e7875dc4d64987392ba56806cacdf3d
MD5 fc566457aa77cc42d4afc7ba2a415052
BLAKE2b-256 19eaf91e5b4b81a04fb4fdc5e29be1ba36b72873b4d78d8b9e7c0ed247384dc6

See more details on using hashes here.

File details

Details for the file pyboy-1.6.14-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyboy-1.6.14-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 5f637faa8349462a74602efc77dbd5f689043cde52cb8019381ea80f8bb30813
MD5 e76e0906aa46f80d343bf6322e2d1df6
BLAKE2b-256 5751c02bd5d3a41d23ec8b85b345477299c928d30960dc22ea1d0ae92370eb1e

See more details on using hashes here.

File details

Details for the file pyboy-1.6.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyboy-1.6.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5ea2f0539670eef7aa8110a611cae1d4ef4771056dfb443df363c54306f02126
MD5 593df911349cd73e95fb418b0eb444b6
BLAKE2b-256 8aa997f4978a379c7642ad3305476f96c7eb8ec0ea51ae6b61761b2e9439ff89

See more details on using hashes here.

File details

Details for the file pyboy-1.6.14-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for pyboy-1.6.14-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 367e4770e0e00bc7ecb7451aefb466697a4b6ad047ca011d3e59e62684d56854
MD5 035bc5614333784ceac90fb22e806d77
BLAKE2b-256 cc5b5f8f283ac1ac2155a793c45a13bf5c6af903c0703f5aa0bc3b537414b3c3

See more details on using hashes here.

File details

Details for the file pyboy-1.6.14-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyboy-1.6.14-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 11.0 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for pyboy-1.6.14-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e28b5c844856b1236bfab948d0cb8d869241e2a152ffba81e5300890331407bb
MD5 4ba478d021af5eea462e8a34df502245
BLAKE2b-256 d58028cc0dde633d1367cad6829a07be7371da210f41451d6d7c7c19ed264772

See more details on using hashes here.

File details

Details for the file pyboy-1.6.14-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyboy-1.6.14-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 50c6e64abf26761daa2f8640c9e893a5a69a835d887c78a3a7eeae4cf6c16474
MD5 d2162f6eaa1bc8a21c70521b5fa8ee7b
BLAKE2b-256 5caf67df10615a3a1f03a8b51e668dfc9d1ebc979c3509ba23b072fb4cf6048a

See more details on using hashes here.

File details

Details for the file pyboy-1.6.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyboy-1.6.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 881fcf256aca38049251094a792c71c9fec79a89da3b5a2197f306222d956064
MD5 db8692f52fe73a0f04a7a7387c698090
BLAKE2b-256 3484d6332d54dcba156d2b0fee037b064469c858ec7ffce2258845f741dc17d2

See more details on using hashes here.

File details

Details for the file pyboy-1.6.14-cp310-cp310-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for pyboy-1.6.14-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 e69c77a874e403c009d38f3476490480862deabbad2789812f7582aeb8bc7cfd
MD5 5e64a65cad3330aa2b48bb984a13369f
BLAKE2b-256 c846001ff3e37428eb9122217a6a02df95b5e9eeb00623e341ebba2eec9f8908

See more details on using hashes here.

File details

Details for the file pyboy-1.6.14-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pyboy-1.6.14-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 11.0 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for pyboy-1.6.14-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 116c9382c47d4b82cedfedd9c92a6586054f3e76399d5a7a1cdf907a52969112
MD5 42ea144a042858b0d00a70a0b0e91016
BLAKE2b-256 3eafbfa496867d86e86db0d25fc296ec693409846953d55c79e3f607646696e1

See more details on using hashes here.

File details

Details for the file pyboy-1.6.14-cp39-cp39-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyboy-1.6.14-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 88c3b500a05ee350d6b4d30d09f2eb353a2705385b89cc6ba0d80d1bce785cb9
MD5 650aac47029ee67fe68429d2ebbe1355
BLAKE2b-256 9d1c9eac40f7a38d7ca0fe59121075f55e6f4072900914e3c7f790001cdb931e

See more details on using hashes here.

File details

Details for the file pyboy-1.6.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyboy-1.6.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7c7c9da4d145f30b008234420e353c28ad6c86139733ed2276fc4fd6a24bf8a4
MD5 fb44e675993ff7e67c083dbceb3ec842
BLAKE2b-256 6548fb15d40234e2fa8288cd6981650b470ba7c4c19f4f41a464f63a60fec399

See more details on using hashes here.

File details

Details for the file pyboy-1.6.14-cp39-cp39-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for pyboy-1.6.14-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 dc28e7fb6405b7784316cd2408276a956172f148fe7c638b69b5aad5fb658a46
MD5 961ae69be9dd9ee2889769e754775170
BLAKE2b-256 4fc8cb3471e34999b9dc84a4ef7c6ff11d9baad14fa83a51bbd3a79e416eea43

See more details on using hashes here.

File details

Details for the file pyboy-1.6.14-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: pyboy-1.6.14-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 11.0 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for pyboy-1.6.14-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 9b1a75938c748fe82a5126d508536ac65cfc8c8877a0b66b7c7d84a191d963d2
MD5 a1ff89616f86110afd4bddcf65342df9
BLAKE2b-256 5c9b0fc22e6d799ede94387c49567cc0975ed07274cc37563b449a186cd917eb

See more details on using hashes here.

File details

Details for the file pyboy-1.6.14-cp38-cp38-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyboy-1.6.14-cp38-cp38-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 605e5d9da1f0d73b6201b357f350e3f0968b7dd26fefcb60886ddfd2ace538a0
MD5 16b0435da8e241f1cd6ad38506ddcd36
BLAKE2b-256 30a9ed08fe9851d94cf4d3b0eb48ed2c08a1ff9c9f914cbbd5d338eb90ef2767

See more details on using hashes here.

File details

Details for the file pyboy-1.6.14-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyboy-1.6.14-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 76df4020dd00d2c81352a5930a3752515e877885ccc4f80aa446d5cdbb4307c0
MD5 d8654b7c91456ec156155c6b6f4681f5
BLAKE2b-256 72c800256a54fe22eb4dae59eff58dc8f052f011fc352445570dc2bd20617efa

See more details on using hashes here.

File details

Details for the file pyboy-1.6.14-cp38-cp38-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for pyboy-1.6.14-cp38-cp38-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 b860a8a8c3440bbd4c8a77671d9d0c35095a61e63a1066b01fc48fbdec74eca3
MD5 cc5922385b106e1343a921a0c3c0661c
BLAKE2b-256 3e56b8e8cfff2cc4f04a0c8d329f4988212bdab44ddb2f588e27ed67a13ab91b

See more details on using hashes here.

Supported by

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