Package: pydartz
pydartzA Python3 assistant (and library) for playing dartsPlay with your friends and keep track of your darts scores!Featuresarbitrary start value (501, 301, whatever positive number you like, ...)unlimited number of playersscores can be passed in sum (i.e. the total visit) or throw by throwfinish suggestionsplayer database to keep track of player performance (average, highscore, finishes, etc.)no external dependencies for basic functionalityUpcomingTODOfull test coverageInstallationpydartzrequires Python 3.8 or higher.From PyPI packagepip install --user -U pydartzTo enable sound support, either install additional dependenciespip install --user -U pydartz[audio]or set thePYDARTZ_MEDIA_PLAYERenvironment variable (default:mpv).Using pipxpipx install pydartzBackwards compatibilityv1.2is the last version to support Python 2.v2.1.1is the last version to support Python 3.6.v2.2.0is the last version to support Python 3.7.UsageCommand line assistantExecutepydartzin 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:You sum up the three throws of your visit yourself. Say you score 60, 5 and 1, i.e. a total of 66. You type66dand hit enter. The suffixdindicates that yourdone.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.You busted. Typeband hit enter.Invalid input is not processed, please enter a correct value the next time.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. Answery(YES) if you want a rematch using the same settingsn(NO) if you want to play again but re-define the settingsq(QUIT) if you want to quit the applicationLibrarypydartzprovides an API to include the dart assisting functionality into custom projects. Subclasscommunication.CommunicatorBase, create agame.Gameobject andrun()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/ROSproject. 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.IMPORTANTThe 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, typepydartz --stats <player_name>. You can put any number of names. Without any name, information of all players is printed.Also, see the output ofpydartz --help.Have fun!ExampleWatch 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: 1CreditsThe sound file is generated byPulseBoy.ASCII art is generated fromthis tool.DevelopmentInstall from sourceGet the source codegit clone https://github.com/pylipp/pydartz
cd pydartzInstall to a virtualenvpython3 -m venv .venv
source .venv/bin/activate
make installTest suitemake testCoverage analysismake coverageStyle checksmake style-checkReleasinggit tagwith new version number (schemevX.Y.Z)make release