A neat generic dice API.
Project description
Angda
Angda (A Neat Generic Dice API) is a dice-rolling API created in Python by Stephen Malone.
- See changes.md for a complete changelog.
- See license.md for licensing information.
Installation
- Install Python 3.7 or higher.
- Run
pip install angda.
Usage
Angda can be used on the command-line or imported as a Python library.
Command-Line
Run angda --help to see all available options.
$ angda 2d6+1
#1: 2d6+1 = 7.
$ angda 2d6+1 --quiet
7
$ angda 2d6+1 --details
Dice #1:
- String: 2d6+1.
- Fields: Dice=2, Size=6, Plus=1.
- Result: [4, 2] + 1 = 7.
Python Library
Use angda.roll for simple rolls, or the Dice class for more complex cases.
>>> import angda
>>> angda.roll('2d6+1')
7
>>> angda.roll('2d6+1', objects=True)
{'dice': Dice(2, 6, 1), 'roll': Roll(7, 1, [4, 2])}
>>> dice = angda.Dice(dice=4, size=6, plus=0)
>>> dice.roll()
Roll(7, 1, [4, 2])
Credits
Angda uses the following third-party libraries:
Project details
Release history Release notifications | RSS feed
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 angda-0.1.0.tar.gz.
File metadata
- Download URL: angda-0.1.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e9cacf589732881602da32efe360e675e7125e1239c8d718093a3188d32992c
|
|
| MD5 |
b2b8a70579a561e65af5729d7e3d7047
|
|
| BLAKE2b-256 |
8a1469be04d8ce1037fbb7aeff3d412c90955305b796ac0661605c90e12e6027
|
File details
Details for the file angda-0.1.0-py3-none-any.whl.
File metadata
- Download URL: angda-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25c22c147cfadcde1d47394134c19132023528d83160f63a43486fdbd66148e5
|
|
| MD5 |
856b7e030f1ef340ab662aea508e365a
|
|
| BLAKE2b-256 |
42dca33b04d95136d175aaee5cdff41d50b602efad444c4911f5da434ea5d092
|