Skip to main content

pypi Python: 3.11+ Downloads Build Status

pydartz

A Python3 assistant (and library) for playing darts

Play with your friends and keep track of your darts scores!

Features

  • arbitrary start value (501, 301, whatever positive number you like, ...)
  • unlimited number of players
  • scores can be passed in sum (i.e. the total visit) or throw by throw
  • finish suggestions
  • player database to keep track of player performance (average, highscore, finishes, etc.)
  • no external dependencies for basic functionality

Upcoming

TODO

  • full test coverage

Installation

pydartz requires Python 3.11 or higher.

From PyPI package

pip install --user -U pydartz

To enable sound support, either install additional dependencies

pip install --user -U pydartz[audio]

or set the PYDARTZ_MEDIA_PLAYER environment variable (default: mpv).

Using pipx

pipx install pydartz

Backwards compatibility

  • v1.2 is the last version to support Python 2.
  • v2.1.1 is the last version to support Python 3.6.
  • v2.2.0 is the last version to support Python 3.7.
  • v2.3.3 is the last version to support Python 3.8.
  • v2.4.0 is the last version to support Python 3.9.
  • v2.5.0 is the last version to support Python 3.10.

Usage

Command line assistant

Execute pydartz in the command line to start a classic 501 game. The setup instructions should be self-explanatory.

When the game starts, the program expects a player's score as an input. There are various options:

  1. You sum up the three throws of your visit yourself. Say you score 60, 5 and 1, i.e. a total of 66. You type 66d and hit enter. The suffix d indicates that your done.
  2. You directly enter after each throw. Say you score a triple 19, so you type 57 and hit enter. The prompt shows that you have two darts left. Repeat or use method 1.
  3. You busted. Type b and hit enter.
  4. Invalid input is not processed, please enter a correct value the next time.
  5. The program takes some constraints into account to check if your input is valid (e.g. total visit sum <= 180). Try to trick it and submit an issue if you found a glitch.

When the game is finished (i.e. one player has won the specified number of legs), the program asks whether you want to play again. Answer

  1. y (YES) if you want a rematch using the same settings
  2. n (NO) if you want to play again but re-define the settings
  3. q (QUIT) if you want to quit the application

Library

pydartz provides an API to include the dart assisting functionality into custom projects. Subclass communication.CommunicatorBase, create a game.Game object and run() it! Note that this call blocks until the user decides to quit. You might decide to execute it in a separate thread.

Example: I have a Raspberry/Arduino/ROS project. The custom communicator uses a ROS publisher to forward information to an LCD, taking the limited character width into account. Input requests are implemented using ROS client calls to the server (the Arduino listening for keypresses).

I can see a GUI being built on top of the library.

IMPORTANT

The last visit has to be entered throw by throw. Otherwise, the evaluation of the total number of throws per visit is not correct!

For displaying player statistics, type pydartz --stats <player_name>. You can put any number of names. Without any name, information of all players is printed.

Also, see the output of pydartz --help.

Have fun!

Example

Watch MVG casually nailing a 9 darter:

> pydartz
Nr of players: 1
Name of player 1: MVG
Start value: 501
Nr of legs: 1
MVG has 501 and three darts left.
MVG's score: 180
MVG has 321 and three darts left.
MVG's score: 180
MVG has 141 and three darts left.
Finish options:
    T20 T19 D12
MVG's score: 60
MVG has 81 and two darts left.
Finish options:
    T19 D12
    T15 D18
MVG's score: 57
MVG has 24 and one dart left.
MVG's score: 24
    MVG:  1
================================================================================
> pydartz -s MVG
MVG:
Legs won: 1
Average: 167.00
Highscore: 180
Finishes:
    141: 1
Darters:
      9-darter: 1

Credits

Development

Install from source

Get the source code

git clone https://github.com/pylipp/pydartz
cd pydartz

Install to a virtualenv

python3 -m venv .venv
source .venv/bin/activate
make install

Test suite

make test

Coverage analysis

make coverage

Style checks

make style-check

Releasing

  1. git tag with new version number (scheme vX.Y.Z)
  2. make release

Metadata

Release files for pydartz 2.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydartz 2.6.0
File Size Uploaded Provenance Actions
pydartz-2.6.0.tar.gz 418.6 kB With provenance Details for pydartz-2.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pydartz 2.6.0
File Interpreter ABI Platform Actions
pydartz-2.6.0-py3-none-any.whl Python 3 none any Details for pydartz-2.6.0-py3-none-any.whl

Total release size: 827.4 kB

Release files / pydartz-2.6.0.tar.gz

Download URL pydartz-2.6.0.tar.gz
Size 418.6 kB
Tags Source
SHA-256 checksum
How to use checksums
bb9bc438700371017dacc1ebb4c077149162705bcb467c1c27ed633bf5b18e61
BLAKE2b-256 checksum
How to use checksums
67961e36f33a21be68922961f45dc4cf58479549d45a970cd770d1f2a3b03679
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Release files / pydartz-2.6.0-py3-none-any.whl

Download URL pydartz-2.6.0-py3-none-any.whl
Size 408.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd7a0a1dd8dc9153de5dc39fff7e3d41a667a6ae5eb36a40836cfb8680ec6674
BLAKE2b-256 checksum
How to use checksums
8db92e3119804404df6877278fc2a68468586db3bfc27e24d496dfa43fb18960
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Security for pydartz 2.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pydartz-2.6.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page