Python client for Warped Pinball Vector boards (HTTP, USB serial, and UDP discovery)
Project description
warpedpinball
Control real pinball machines from Python.
If a machine has a Warped Pinball Vector board installed, this library lets you talk to it in a few lines of code: watch scores change ball by ball, pull leaderboards, manage players, read and write the game's memory, and push firmware updates. Build a tournament display, a Discord bot that announces high scores, a stats dashboard for your basement, or a game mod that reacts to what's happening on the playfield.
The library finds boards on your network by name, handles authentication for
you, and works the same whether you connect over WiFi or plug in with a USB
cable. You write m.leaderboard(); it takes care of the rest.
Install
Requires Python 3.9+.
pip install warpedpinball
Recommended: install into a virtual environment
A virtual environment keeps warpedpinball and its dependencies isolated from
your system Python, so nothing you install here can interfere with other
projects (or with packages your OS manages). This is the recommended way to
install.
# Create a virtual environment in a ".venv" folder
python3 -m venv .venv
# Activate it
source .venv/bin/activate # macOS / Linux
# .venv\Scripts\activate # Windows (PowerShell / cmd)
# Install the library into the active environment
pip install warpedpinball
# Or, to also get USB (serial) support:
pip install "warpedpinball[usb]"
Once activated, python, pip, and the vector CLI all refer to the
environment. Run deactivate to leave it; re-run the source line above to
come back to it in a new shell.
Quickstart
Connect to a machine by name and see what's happening on it:
import warpedpinball
with warpedpinball.connect("elvira") as m:
print(m.leaderboard())
for event in m.watch_game():
if event.type == "score_changed":
print(f"player {event.player}: {event.old} -> {event.new}")
That's a live feed of scores from a real pinball machine, in ten lines.
connect() finds the board on your LAN by name (partial names work), and
read-only calls like these need no password. When you're ready to change
things, pass password= to connect() and the same object can update
players, reset leaderboards, write memory, and more.
What you can do
- Follow games live.
watch_game()yields events as games start and end, balls drain, and scores change. See working with a machine. - Manage scores and players. Leaderboards, tournaments, player rosters, score claiming, import/export. Also covered in working with a machine.
- Read and write game memory. Peek at credits, scores, and settings in the machine's battery-backed SRAM, or change them. See reading and writing memory.
- Reach any firmware route.
m.call()gives you the whole HTTP API, even routes that don't have a wrapper yet. See the HTTP API reference. - Skip the network entirely. Plug in a USB cable and
connect_usb()gives you the same interface with no WiFi and no password. - Script from the shell. The
vectorCLI covers discovery, status, leaderboards, memory access, and firmware updates without writing any Python. See the CLI guide.
Documentation
Full guides live in the documentation index:
- Working with a machine: connecting, authentication, the wrapper methods, live game events, and error handling
- Reading and writing memory: memory reads/writes, snapshots, and finding addresses
- HTTP API reference: the raw firmware routes
- CLI guide:
the
vectorcommand - Examples: runnable scripts, including a live animated ELVIRA hurry-up display
The complete API reference
is generated from the source docstrings and published to GitHub Pages on every
push to main. See
docs/api-reference.md
for how it is built and how to enable Pages.
Curious about the hardware itself? Vector boards and the machines they fit are at warpedpinball.com.
Development
git clone https://github.com/warped-pinball/python-library
cd python-library
pip install -e ".[dev,usb]"
pytest # run the tests
ruff check . # lint
pytest --cov --cov-report=term-missing # run the tests with a coverage report
CI measures test coverage on every pull request and compares it against the
base branch. Pull requests that lower total coverage are flagged: the
coverage job posts a comment with the change and fails the check.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file warpedpinball-0.2.1.tar.gz.
File metadata
- Download URL: warpedpinball-0.2.1.tar.gz
- Upload date:
- Size: 69.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c15e2e840bd9311e064f242701b9fb761ac439e036a241b4af6196c67577dda7
|
|
| MD5 |
13b5573ef812d8c50d1a0490d8075629
|
|
| BLAKE2b-256 |
8c7c2fee172e4c15c7ac5f3d18d3f494624c23e8d4e77f43db29595ce5603e26
|
Provenance
The following attestation bundles were made for warpedpinball-0.2.1.tar.gz:
Publisher:
publish.yml on warped-pinball/python-library
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
warpedpinball-0.2.1.tar.gz -
Subject digest:
c15e2e840bd9311e064f242701b9fb761ac439e036a241b4af6196c67577dda7 - Sigstore transparency entry: 2195006867
- Sigstore integration time:
-
Permalink:
warped-pinball/python-library@30b16a22f023e5f4f4eba0f5ee6c31fa485f3999 -
Branch / Tag:
refs/tags/0.2.1 - Owner: https://github.com/warped-pinball
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@30b16a22f023e5f4f4eba0f5ee6c31fa485f3999 -
Trigger Event:
release
-
Statement type:
File details
Details for the file warpedpinball-0.2.1-py3-none-any.whl.
File metadata
- Download URL: warpedpinball-0.2.1-py3-none-any.whl
- Upload date:
- Size: 32.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
264b2a18b6335ba167d96d7a8e5a5a00634b7e20825267777c2c1524bcbcd10d
|
|
| MD5 |
f60c8dcaf7d590432d875f32c6b5bbe5
|
|
| BLAKE2b-256 |
1298a634992365c74f00749a4f7aca804e7e4cb49adba8b7ec0ecf2e3693001b
|
Provenance
The following attestation bundles were made for warpedpinball-0.2.1-py3-none-any.whl:
Publisher:
publish.yml on warped-pinball/python-library
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
warpedpinball-0.2.1-py3-none-any.whl -
Subject digest:
264b2a18b6335ba167d96d7a8e5a5a00634b7e20825267777c2c1524bcbcd10d - Sigstore transparency entry: 2195006873
- Sigstore integration time:
-
Permalink:
warped-pinball/python-library@30b16a22f023e5f4f4eba0f5ee6c31fa485f3999 -
Branch / Tag:
refs/tags/0.2.1 - Owner: https://github.com/warped-pinball
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@30b16a22f023e5f4f4eba0f5ee6c31fa485f3999 -
Trigger Event:
release
-
Statement type: