| 1 |
Metadata-Version: 2.4 |
| 2 |
Name: pyglet |
| 3 |
Version: 2.1.14 |
| 4 |
Summary: pyglet is a cross-platform games and multimedia package. |
| 5 |
Author-email: Alex Holkner & contributors <[email protected]> |
| 6 |
Requires-Python: >=3.8 |
| 7 |
Description-Content-Type: text/markdown |
| 8 |
License-File: LICENSE |
| 9 |
Project-URL: Home, https://pyglet.org |
| 10 |
|
| 11 |
[](https://pypi.python.org/pypi/pyglet) [](https://pyglet.readthedocs.io) [](https://github.com/pyglet/pyglet/actions/workflows/unittests.yml) |
| 12 |
|
| 13 |
 |
| 14 |
|
| 15 |
# pyglet |
| 16 |
|
| 17 |
*pyglet* is a cross-platform windowing and multimedia library for Python, intended for developing games |
| 18 |
and other visually rich applications. It supports Windowing, input event handling, Controllers & Joysticks, |
| 19 |
OpenGL graphics, loading images and videos, and playing sounds and music. *pyglet* works on Windows, OS X and Linux. |
| 20 |
|
| 21 |
> :exclamation: :exclamation: A major pyglet update has just been released (v2.1). This brings many |
| 22 |
> new exciting features, but also some necessary breaking changes. If your game/application has suddenly |
| 23 |
> stopped working, please read the [migration section in the documentation](https://pyglet.readthedocs.io/en/latest/programming_guide/migration.html) |
| 24 |
> The previous version of pyglet is tracked in the `pyglet-2.0-maintenance` branch. |
| 25 |
> **If you want to do a pull request for the previous release, please target the appropriate branch**. |
| 26 |
|
| 27 |
* pyglet [documentation] |
| 28 |
* pyglet on [PyPI] |
| 29 |
* pyglet [discord] server |
| 30 |
* pyglet [mailing list] |
| 31 |
* pyglet [issue tracker] |
| 32 |
* pyglet [website] |
| 33 |
|
| 34 |
pyglet has an active developer and user community. If you find a bug or a problem with the documentation, |
| 35 |
please [open an issue](https://github.com/pyglet/pyglet/issues). |
| 36 |
Anyone is welcome to join our [discord] server where a lot of the development discussion is going on. |
| 37 |
It's also a great place to ask for help. |
| 38 |
|
| 39 |
Some features of pyglet are: |
| 40 |
|
| 41 |
* **No external dependencies or installation requirements.** For most application and game requirements, *pyglet* |
| 42 |
needs nothing else besides Python, simplifying distribution and installation. It's easy to package and distribute |
| 43 |
your project with [Nuitka](https://nuitka.net) or [PyInstaller](https://pyinstaller.org). |
| 44 |
* **Take advantage of multiple windows and multi-monitor desktops.** *pyglet* allows you to use multiple |
| 45 |
platform-native windows, and is fully aware of multi-monitor setups for use with fullscreen games. |
| 46 |
* **Load images, sound, music and video in almost any format.** *pyglet* can optionally use FFmpeg to play back |
| 47 |
audio formats such as MP3, OGG/Vorbis and WMA, and video formats such as MPEG2, H.264, H.265, WMV and Xvid. |
| 48 |
Without FFmpeg, *pyglet* contains built-in support for standard formats such as wav, png, bmp, and others. |
| 49 |
* **pyglet is written entirely in pure Python**, and makes use of the *ctypes* module to interface with system |
| 50 |
libraries. You can modify the codebase or make a contribution without any second language compilation steps or |
| 51 |
compiler setup. Despite being pure Python, *pyglet* has excellent performance thanks to advanced batching for |
| 52 |
drawing thousands of objects. |
| 53 |
* **pyglet is provided under the BSD open-source license**, allowing you to use it for both commercial and other |
| 54 |
open-source projects with very little restriction. |
| 55 |
|
| 56 |
## Requirements |
| 57 |
|
| 58 |
pyglet runs under Python 3.8+. Being written in pure Python, it also works on other Python interpreters such as PyPy. Supported platforms are: |
| 59 |
|
| 60 |
* Windows 7 or later |
| 61 |
* Mac OS X 10.3 or later |
| 62 |
* Linux, with the following libraries (most recent distributions will have |
| 63 |
these in a default installation): |
| 64 |
* OpenGL and GLX |
| 65 |
* GDK 2.0+ or Pillow (required for loading images other than PNG and BMP) |
| 66 |
* OpenAL or Pulseaudio (required for playing audio) |
| 67 |
|
| 68 |
**As of pyglet 2.0, OpenGL 3.3+ is required**. |
| 69 |
|
| 70 |
To play a large variety of compressed audio and video files, |
| 71 |
pyglet can optionally take advantage of [FFmpeg](https://ffmpeg.org/). |
| 72 |
|
| 73 |
## Installation |
| 74 |
|
| 75 |
pyglet is installable from PyPI: |
| 76 |
|
| 77 |
pip install --upgrade --user pyglet |
| 78 |
|
| 79 |
## Installation from source |
| 80 |
|
| 81 |
If you're reading this `README` from a source distribution, you can install pyglet with: |
| 82 |
|
| 83 |
pip install --upgrade --user . |
| 84 |
# or |
| 85 |
python setup.py install --user |
| 86 |
|
| 87 |
You can also install the latest development version directly from Github: |
| 88 |
|
| 89 |
pip install --upgrade --user https://github.com/pyglet/pyglet/archive/master.zip |
| 90 |
|
| 91 |
For local development install pyglet in editable mode: |
| 92 |
|
| 93 |
```bash |
| 94 |
# with pip |
| 95 |
pip install -e . |
| 96 |
# with setup.py |
| 97 |
python setup.py develop |
| 98 |
``` |
| 99 |
|
| 100 |
There are no compilation steps during the installation; if you prefer, |
| 101 |
you can simply add this directory to your `PYTHONPATH` and use pyglet without |
| 102 |
installing it. You can also copy pyglet directly into your project folder. |
| 103 |
|
| 104 |
## Contributing |
| 105 |
|
| 106 |
**A good way to start contributing to a component of pyglet is by its documentation**. When studying the code you |
| 107 |
are going to work with, also read the associated docs. If you don't understand the code with the help of the docs, |
| 108 |
it is a sign that the docs should be improved. If you wish to make large changes to any part of pyglet, it's always |
| 109 |
a good idea to reach out for feedback first. This can avoid wasted effort in cases where someone is already working |
| 110 |
on something similar, or if your idea can't be accepted for any reason. |
| 111 |
|
| 112 |
A basic outline of how to a contribution is as follows: |
| 113 |
|
| 114 |
* Fork the [official repository](https://github.com/pyglet/pyglet/fork). |
| 115 |
* In your fork, checkout the branch you wish to contribute to (such as *pyglet-1.5-maintenance*). |
| 116 |
* Apply your changes to your fork. |
| 117 |
* Submit a [pull request](https://github.com/pyglet/pyglet/pulls) describing the changes you have made. |
| 118 |
* Alternatively you can create a patch and submit it to the issue tracker. |
| 119 |
|
| 120 |
When making a pull request, check that you have addressed its respective documentation, both within the code docstrings |
| 121 |
and the programming guide (if applicable). It is very important to all of us that the documentation matches the latest |
| 122 |
code and vice versa. |
| 123 |
|
| 124 |
Consequently, an error in the documentation, either because it is hard to understand or because it doesn't match the |
| 125 |
code, is a bug that deserves to be reported on a ticket. |
| 126 |
|
| 127 |
## Building Docs |
| 128 |
|
| 129 |
[Documentation and Type Hints]: https://pyglet.readthedocs.io/en/latest/internal/doc.html |
| 130 |
|
| 131 |
To get started quickly: |
| 132 |
|
| 133 |
pip install -r doc/requirements.txt |
| 134 |
python make.py docs |
| 135 |
|
| 136 |
Please check [Documentation and Type Hints][] guide to learn more. |
| 137 |
|
| 138 |
## Testing |
| 139 |
|
| 140 |
pyglet makes use of pytest for its test suite. |
| 141 |
|
| 142 |
```bash |
| 143 |
pip install -r tests/requirements.txt --user |
| 144 |
# Only run unittests |
| 145 |
pytest tests/unit |
| 146 |
``` |
| 147 |
|
| 148 |
Please check the [testing section in the development guide](https://pyglet.readthedocs.io/en/latest/internal/testing.html) |
| 149 |
for more information about running and writing tests. |
| 150 |
|
| 151 |
## Contact |
| 152 |
|
| 153 |
pyglet is developed by many individual volunteers, and there is no central point of contact. If you have a question |
| 154 |
about developing with pyglet, or you wish to contribute, please join the [discord] server, or [subreddit]. |
| 155 |
|
| 156 |
For legal issues, please contact [Alex Holkner](mailto:[email protected]). |
| 157 |
|
| 158 |
[discord]: https://discord.gg/QXyegWe |
| 159 |
[subreddit]: https://www.reddit.com/r/pyglet/ |
| 160 |
[documentation]: https://pyglet.readthedocs.io |
| 161 |
[wiki]: https://github.com/pyglet/pyglet/wiki |
| 162 |
[pypi]: https://pypi.org/project/pyglet/ |
| 163 |
[website]: http://pyglet.org/ |
| 164 |
[issue tracker]: https://github.com/pyglet/pyglet/issues |
| 165 |
|