Skip to main content

PyRoll20

An easy to use, Roll20 syntax compatible,python dice roller.

Installing

pip3 install pyroll20

Usage Example

from pyroll20.pyroll20 import roll

print(roll(user_input="2d20"))

>> [12,8]

or with a modifier

from pyroll20.pyroll20 import roll

print(roll(user_input="2d20+5"))

>> 23 

Modifiers

'h' # Highest Rolls - 5d20h3 returns the 3 highest rolls from the five d20 that were rolled.
'l' # Lowest Rolls - 5d20l3 returns the 3 lowest rolls from the five d20 that were rolled.
'+' # Adds to sum - 5d20+3 adds 3 to the sum of the five d20 that were rolled, always returns a single integer.
'-' # Subtracts from sum - 5d20-3 subtracts 3 from the sum of the five d20 that were rolled, always returns a single integer.
'.-' # Subtracts from each individual roll - 5d20.-3 subtracts 3 from each of the five d20 that were rolled.
'.+' # Adds to each individual roll - 5d20.+3 adds 3 to each of the five d20 that were rolled.
't' # Sum of all rolls - 5d20t returns the sum of the five d20 that were rolled.
'e' # "Exploding dice - 5d20e if any of the five rolls goes critical, it gets re-rolled and added to the individual roll.

Notes

If sides are provided but no roll number, the roll number defaults to 1, for example d20 is a valid input.

License

This project is licensed under the GNU GENERAL PUBLIC LICENSE v3.

TODO

Advantage and disadvantage[Not working] Wrap it in some sort of gui for a standalone app.[Maybe]

Release files for pyroll20 0.1.9

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

Source distribution (sdist)

Source distribution for pyroll20 0.1.9
File Size Uploaded
pyroll20-0.1.9.tar.gz 2.8 kB Details

Built distribution (wheel)

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

Total release size: 18.1 kB

Release files / pyroll20-0.1.9.tar.gz

Download URL pyroll20-0.1.9.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9561b5f245aad6f509c24ccf7d9e8c2ffad22f42d9ae6936d6db6c8eb6c4002a
BLAKE2b-256 checksum
How to use checksums
06846f7d02420ff3e82cc2829cc4a3c2ca776ee01b8b9fb2962d2746a0bebeb9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

Release files / pyroll20-0.1.9-py3-none-any.whl

Download URL pyroll20-0.1.9-py3-none-any.whl
Size 15.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ffeda2703a307f029398a4c787e461f35a832f92348d3416504cca222e84604b
BLAKE2b-256 checksum
How to use checksums
f954dc5f53e4aabd9fd71d9c34c6a4f5497f189ebb26133ba7b203c198663272
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

Release history Release notifications | RSS feed

This release

0.1.9 This release

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

1 release file

0.1.3

2 release files

0.1.1

1 release file

0.1.0

1 release file

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