Skip to main content

A library to emulate rolling dice

Project description

Dragn

PyPI version Supported Python versions Build Status codecov License Downloads Code style: Black

Dice system library (aka random.randint as dice).

A library that makes something simple like a random integer even simpler.

Or at least, makes it look a bit more like rolling dice.

How to install

$ pip install dragn

How to use

>> from dragn.dice import D6
>>> D6()
1
>>> from dragn.dice import D8
>>> f"You roll the die and the result is {D8()}"
'You roll the die and the result is 4'
>>> f"You roll 3 dice and you get {[D8() for _ in range(3)]}"
>>> 'You roll 3 dice and you get [3, 1, 8]'
>>> from dragn.dice import D4
>>> four_dice = D4 * 4
>>> f"You roll 4 dice and the sum is {four_dice()}"
'You roll 4 dice and the sum is 15'
>>> f"You roll 4 dice again and the sum is {four_dice()}"
'You roll 4 dice again and the sum is 13'

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

dragn-0.0.9.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

dragn-0.0.9-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page