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.11.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.11-cp312-cp312-win_amd64.whl (11.0 MB view details)

Uploaded CPython 3.12Windows x86-64

pyboy-1.6.11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (31.6 MB view details)

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

pyboy-1.6.11-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.11-cp311-cp311-win_amd64.whl (11.0 MB view details)

Uploaded CPython 3.11Windows x86-64

pyboy-1.6.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (31.7 MB view details)

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

pyboy-1.6.11-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.11-cp310-cp310-win_amd64.whl (11.0 MB view details)

Uploaded CPython 3.10Windows x86-64

pyboy-1.6.11-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.11-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (27.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.12+ x86-64manylinux: glibc 2.5+ x86-64

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

Uploaded CPython 3.10macOS 11.0+ x86-64

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

Uploaded CPython 3.9Windows x86-64

pyboy-1.6.11-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.11-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (27.9 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.12+ x86-64manylinux: glibc 2.5+ x86-64

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

Uploaded CPython 3.9macOS 11.0+ x86-64

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

Uploaded CPython 3.8Windows x86-64

pyboy-1.6.11-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.11-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (29.1 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64manylinux: glibc 2.5+ x86-64

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

Uploaded CPython 3.8macOS 11.0+ x86-64

pyboy-1.6.11-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (28.4 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

pyboy-1.6.11-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (26.2 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64manylinux: glibc 2.5+ x86-64

File details

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

File metadata

  • Download URL: pyboy-1.6.11.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.11.tar.gz
Algorithm Hash digest
SHA256 bbcb9db10a46d69074b5b4cbf5e22ee8e3fb084d8420310efb9e08fea44cba7d
MD5 ec4900e39dbc3442d61b07a64d740dfe
BLAKE2b-256 52f02b8398f5b9dcbbee66821f11f1cdc5fa26bf2465368cb685cdb7cfa26cca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyboy-1.6.11-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.11-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1df4482d51b81bbdcc8584dbe950585aa399e561c3af113484ab2593ccb3015b
MD5 a77086683209f2102af36381eb7c7ce9
BLAKE2b-256 cda5ff2e9ef4e8cac6f9ec531b674df80187565e1da6c67380530b25f37148d1

See more details on using hashes here.

File details

Details for the file pyboy-1.6.11-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.11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 376fb6c74dec7dfbe4f0bab7f45f1a9687dc43d1524dee0cfcb7a2176bf049ba
MD5 abdadb887ac8edf7e8b82d4ccf78b23e
BLAKE2b-256 b78a1ff5bfb4dd381229bec2b5529e0a2695d566a168abb30c4dd1928004ecd5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyboy-1.6.11-cp312-cp312-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 0eaac4803a702787f8f55324ebbf493338ea96a1ac1721e2243da9405de59e29
MD5 907cf6e0df50b18e38bd374f4438bd9e
BLAKE2b-256 dacdfa2c4dc2fae53ff03aaa69e393b28f22af85fb6ef8bdd8455f1e7bb5d6f0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyboy-1.6.11-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.11-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0389a81166def715ecf8f180ea0ba703d54c4d85bab40df428b6b12fad7d5615
MD5 b3de6613e06763362a59b3582449c53b
BLAKE2b-256 2684862c9cfbf6871efdafe8ea1884aee4efff0f6b6d2c563805c62aa8ee1f90

See more details on using hashes here.

File details

Details for the file pyboy-1.6.11-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.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ad2f64183b250e19aeaa678e1adce002333e1b096405bda95a1daa74cc51eecb
MD5 393be238ff25887fbecf2a6bfad177d3
BLAKE2b-256 1723b2cbca5cfbc67576776e92586b1f84815d39b11ccc2a399823db962796d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyboy-1.6.11-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 ec025d372b535436443bbd57c52303c7d68f446415ce82954414a3fc53a974db
MD5 172c892e412fb1e65eb52415f9b2b01a
BLAKE2b-256 0ca23d92e5a30924fb584a7b33f778f877f1479172e77c0d4b0e3571ba3aa3f8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyboy-1.6.11-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.11-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 616fb0feffe0dcf1f8e890b71e51ace9c1aceac63631ae3b4ab26a6963933562
MD5 88d5bf66788a90ae8c8c62184a749aad
BLAKE2b-256 76112e1819419aa43d6a6e8e8f82913d69bab407608ed4864417858fc778e1d2

See more details on using hashes here.

File details

Details for the file pyboy-1.6.11-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.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fd76f797f596db7f8f2e3f8bd969828fc25e7b292519f42f8b0312819e2785e4
MD5 7945b82193e195358043c06a2eb346b5
BLAKE2b-256 8e0f3948f495a849bf395528d356cd508530555027816e959e51f66053521df1

See more details on using hashes here.

File details

Details for the file pyboy-1.6.11-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for pyboy-1.6.11-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 24eb47ff6fbdd2879feb9b416713df32566e53997d2b5b013000f1960c5386e9
MD5 d64082bfc2725e823df78e5c0649d83b
BLAKE2b-256 623178fb38d7e71851240af489846a4ea5640b106eafc63a50186fbfccc8ea1a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyboy-1.6.11-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 ae0fb88153fa105dcf9f166515ede9ffa2bbb1197a2c22d8ee78469c254869ca
MD5 3b6bd18f28553d11589c3dd4eae503c6
BLAKE2b-256 9691a6eecd416065949658f74fa6be7057fde3b83216372f3786651b2c18a556

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyboy-1.6.11-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.11-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 84677852ee29741c6558b5f408407a3a765eefd557480a9c83df25cf3fbc0dd9
MD5 9b8bed0efc3c9e5b90bb1f96f708053b
BLAKE2b-256 4a9244253ff144fec42294cad10bbb7a4ed1c7412794d246fe6c7fd90f5d36a9

See more details on using hashes here.

File details

Details for the file pyboy-1.6.11-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.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 03066895d33427e10573a43178d5498a88cecc888641a994835ffb252c5c544a
MD5 91729f63a15a81f86125b4962d850e1a
BLAKE2b-256 423e245ce089ce737c708e3fcc2c97b0a60f263f0fa72285300724975d3f26af

See more details on using hashes here.

File details

Details for the file pyboy-1.6.11-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for pyboy-1.6.11-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 eceb377b0b1ff1bc9d69fa46cbb2e09a9a62db8626bac1f1e45d43f9641a9127
MD5 c709ed674de7fb2f4a6d69e75042c4a6
BLAKE2b-256 7029aee04603222c241e8fb482bfddbdccf8e5d2f810151b44c7c0c764ac7c4c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyboy-1.6.11-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 cd7343a671c1f7bb8f674b42cbe54b377479622f4acd25e5a6d521c7adf6d8b0
MD5 947fbd27ff0170327662ddd3fdf5f8a1
BLAKE2b-256 a5acd39585326332ae6b47a3aa9653fb6b26b507f5074d90a48bcf42f79bd2f8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyboy-1.6.11-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.11-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 3adf6437685289cc91a0791d8b22fa92d22c71a52482d312ddba15808402c112
MD5 daf1147f8bfb7fb41799fa1fdb6047de
BLAKE2b-256 cf84600fc4bf143b1e0139bc854e1823f41ce3340781789b85fbb96b749944fd

See more details on using hashes here.

File details

Details for the file pyboy-1.6.11-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.11-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bcd9d259c3d51607a717aab8df6b4a81fe56dd4fa3f214d650c3bdbb55763f1b
MD5 47033017a50c907a147e27ffdd7e77c5
BLAKE2b-256 e4af9efd71e00965acd4c8ef93d7b433c3e1ba48118ba0cd2d8ea0461f2bfedc

See more details on using hashes here.

File details

Details for the file pyboy-1.6.11-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for pyboy-1.6.11-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 02d212b59931133a6b5f22f6db7176aa78377cfbee650b20a7b2e543d533a291
MD5 ec1dbb70a602d37cb67ebf6c422b4683
BLAKE2b-256 42f828af71b6c60ae85908f4dda56b726eea5a2d86d134fcc16fb7fd95e209a2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyboy-1.6.11-cp38-cp38-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 a0b7419ccb6fe84b06b59b08bed555e5b41a9887a6a2b5ce0f5bee3c41a5bae9
MD5 f6565d3713fab51ecdc544305d7c6aed
BLAKE2b-256 88f04db97a7a146f2a692a4cd2ebee7b574fc4e927d8fda817c459c8636df9f4

See more details on using hashes here.

File details

Details for the file pyboy-1.6.11-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyboy-1.6.11-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 df8bca1f8b414686301217e24b2a6ed458852ce915097a8b260eb57b77875678
MD5 123d1e47b88cc8c6f5f66eeded48e821
BLAKE2b-256 a002aac7fd44899e3cb6726d42d03e36c0bd6e42829f44220537339cbde816aa

See more details on using hashes here.

File details

Details for the file pyboy-1.6.11-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for pyboy-1.6.11-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 be4a2190bb3e1350bfb95e565d15d5bf3772ed0a9296ba07bfd97c234030629b
MD5 45d73ba7f2a0ac34cb4e7b8d5cdfead2
BLAKE2b-256 919d633e99e5c225930c1f8658d059c24693fd62980852c0cf033d2768d39987

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