pydartz


Namepydartz JSON
Version 2.3.2 PyPI version JSON
download
home_page
Summarycommand line assistant and library for playing darts
upload_time2024-02-03 19:56:12
maintainer
docs_urlNone
author
requires_python
licenseGPLv3
keywords commandline darts
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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.8 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.

## 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 *d*one.
1. 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.
1. You busted. Type `b` and hit enter.
1. Invalid input is not processed, please enter a correct value the next time.
1. 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
1. `n` (NO) if you want to play again but re-define the settings
1. `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](https://github.com/pylipp/dartbox). 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
- The sound file is generated by [PulseBoy](http://www.pulseboy.com/).
- ASCII art is generated from [this tool](http://patorjk.com/software/taag/#p=display&f=Isometric2&t=pydartz).

## 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`)
1. `make release`

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pydartz",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "commandline darts",
    "author": "",
    "author_email": "Philipp Metzner <beth.aleph@yahoo.de>",
    "download_url": "https://files.pythonhosted.org/packages/be/bf/e125cb95fdd90b0044e304ded6e96861304217268b20baef51e5526f5d36/pydartz-2.3.2.tar.gz",
    "platform": null,
    "description": "# pydartz\n\n>   A Python3 assistant (and library) for playing darts\n\nPlay with your friends and keep track of your darts scores!\n\n## Features\n- arbitrary start value (501, 301, whatever positive number you like, ...)\n- unlimited number of players\n- scores can be passed in sum (i.e. the total visit) or throw by throw\n- finish suggestions\n- player database to keep track of player performance (average, highscore, finishes, etc.)\n- no external dependencies for basic functionality\n\n## Upcoming\n\n## TODO\n- full test coverage\n\n## Installation\n\n`pydartz` requires Python 3.8 or higher.\n\n### From PyPI package\n\n    pip install --user -U pydartz\n\nTo enable sound support, either install additional dependencies\n\n    pip install --user -U pydartz[audio]\n\nor set the `PYDARTZ_MEDIA_PLAYER` environment variable (default: `mpv`).\n\n### Using pipx\n\n    pipx install pydartz\n\n### Backwards compatibility\n\n- `v1.2` is the last version to support Python 2.\n- `v2.1.1` is the last version to support Python 3.6.\n- `v2.2.0` is the last version to support Python 3.7.\n\n## Usage\n\n### Command line assistant\n\nExecute `pydartz` in the command line to start a classic 501 game. The setup instructions should be self-explanatory.\n\nWhen the game starts, the program expects a player's score as an input. There are various options:\n\n1. 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 *d*one.\n1. 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.\n1. You busted. Type `b` and hit enter.\n1. Invalid input is not processed, please enter a correct value the next time.\n1. 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.\n\nWhen 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\n\n1. `y` (YES) if you want a rematch using the same settings\n1. `n` (NO) if you want to play again but re-define the settings\n1. `q` (QUIT) if you want to quit the application\n\n### Library\n\n`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.\n\nExample: I have a Raspberry/Arduino/ROS [project](https://github.com/pylipp/dartbox). 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).\n\nI can see a GUI being built on top of the library.\n\n### IMPORTANT\n\nThe last visit has to be entered throw by throw. Otherwise, the evaluation of the total number of throws per visit is not correct!\n\nFor displaying player statistics, type `pydartz --stats <player_name>`. You can put any number of names. Without any name, information of all players is printed.\n\nAlso, see the output of `pydartz --help`.\n\nHave fun!\n\n## Example\n\nWatch MVG casually nailing a 9 darter:\n\n    > pydartz\n    Nr of players: 1\n    Name of player 1: MVG\n    Start value: 501\n    Nr of legs: 1\n    MVG has 501 and three darts left.\n    MVG's score: 180\n    MVG has 321 and three darts left.\n    MVG's score: 180\n    MVG has 141 and three darts left.\n    Finish options:\n        T20 T19 D12\n    MVG's score: 60\n    MVG has 81 and two darts left.\n    Finish options:\n        T19 D12\n        T15 D18\n    MVG's score: 57\n    MVG has 24 and one dart left.\n    MVG's score: 24\n        MVG:  1\n    ================================================================================\n    > pydartz -s MVG\n    MVG:\n    Legs won: 1\n    Average: 167.00\n    Highscore: 180\n    Finishes:\n        141: 1\n    Darters:\n          9-darter: 1\n\n## Credits\n- The sound file is generated by [PulseBoy](http://www.pulseboy.com/).\n- ASCII art is generated from [this tool](http://patorjk.com/software/taag/#p=display&f=Isometric2&t=pydartz).\n\n## Development\n\n### Install from source\n\nGet the source code\n\n    git clone https://github.com/pylipp/pydartz\n    cd pydartz\n\nInstall to a virtualenv\n\n    python3 -m venv .venv\n    source .venv/bin/activate\n    make install\n\n### Test suite\n\n    make test\n\n### Coverage analysis\n\n    make coverage\n\n### Style checks\n\n    make style-check\n\n### Releasing\n\n1. `git tag` with new version number (scheme `vX.Y.Z`)\n1. `make release`\n",
    "bugtrack_url": null,
    "license": "GPLv3",
    "summary": "command line assistant and library for playing darts",
    "version": "2.3.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/pylipp/pydartz/issues",
        "Documentation": "https://github.com/pylipp/pydartz",
        "Homepage": "https://github.com/pylipp/pydartz",
        "Source Code": "https://github.com/pylipp/pydartz"
    },
    "split_keywords": [
        "commandline",
        "darts"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "be0b85ffa49ccd887f5f2cef1da9592ebbc7d3fdc30b1a5929fb80c212c5ea54",
                "md5": "3c4cdd58b394cf1c63a8a352cbe3bc30",
                "sha256": "9443c8b9b1b62ffb6811bb43f04350fa57efe189ef0bf839ee7d4d3b45bd78e3"
            },
            "downloads": -1,
            "filename": "pydartz-2.3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3c4cdd58b394cf1c63a8a352cbe3bc30",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 408552,
            "upload_time": "2024-02-03T19:56:10",
            "upload_time_iso_8601": "2024-02-03T19:56:10.119217Z",
            "url": "https://files.pythonhosted.org/packages/be/0b/85ffa49ccd887f5f2cef1da9592ebbc7d3fdc30b1a5929fb80c212c5ea54/pydartz-2.3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bebfe125cb95fdd90b0044e304ded6e96861304217268b20baef51e5526f5d36",
                "md5": "57706f4286c29744cccb401efe3cbe68",
                "sha256": "a4b337e267ce3b2e15bff1accda8bd713f0b4140e0417c7d7d3212f38a219e14"
            },
            "downloads": -1,
            "filename": "pydartz-2.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "57706f4286c29744cccb401efe3cbe68",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 417332,
            "upload_time": "2024-02-03T19:56:12",
            "upload_time_iso_8601": "2024-02-03T19:56:12.974600Z",
            "url": "https://files.pythonhosted.org/packages/be/bf/e125cb95fdd90b0044e304ded6e96861304217268b20baef51e5526f5d36/pydartz-2.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-03 19:56:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pylipp",
    "github_project": "pydartz",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pydartz"
}
        
Elapsed time: 0.17987s