Skip to main content

A dice rolling parser with a surprising number of features.

Project description

Rolling Dice

A dice rolling library written in Python that uses lark to parse dice rolls with a surprising number of features!

Installation

From PyPI

Simply add the diceparse package as a dependency in your project.

From Git

Requirements

  • Python version 3.11 or greater
  • The uv dependency manager to handle dependency installation and virtual environment creation

To get everything setup:

$ uv venv
$ uv sync

Usage

A quick example to get rolling:

from diceparser import DiceParser

dice = DiceParser()
result = dice.roll("1d8+3")
print(result)
[
  {
    "_roll": "1d8+3",
    "_total": 4,
    "unknown": 4
  }
]

Documentation

You can view the documentation by either going to the online documentation or by cloning the repo and running it locally on your computer with the following commands. It will be accessible at http://127.0.0.1:8000.

$ uv sync --group docs
$ source .venv/bin/activate
$ mkdocs serve
INFO    -  Building documentation...
INFO    -  Cleaning site directory
INFO    -  Documentation built in 0.14 seconds
INFO    -  [11:41:03] Watching paths for changes: 'docs', 'mkdocs.yml'
INFO    -  [11:41:03] Serving on http://127.0.0.1:8000/

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

diceparse-1.0.8.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

diceparse-1.0.8-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file diceparse-1.0.8.tar.gz.

File metadata

  • Download URL: diceparse-1.0.8.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.0

File hashes

Hashes for diceparse-1.0.8.tar.gz
Algorithm Hash digest
SHA256 8b8ed278f0955bbac773903c5cb8b70866198bf08d5c72ad1e3a27349ac87c5f
MD5 b01113fe41ec1694b7cf02b99b9e7e8b
BLAKE2b-256 5a6d6289e7559e431f15c414e2e5c24177f293bfb021a1fe7b75e6969a2fed74

See more details on using hashes here.

File details

Details for the file diceparse-1.0.8-py3-none-any.whl.

File metadata

  • Download URL: diceparse-1.0.8-py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.0

File hashes

Hashes for diceparse-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 1ab52ca1b17bb4fcef72a85ab959c4694d640e0442ce6768b1c9d9b71bacfb9e
MD5 fc07009f094416818dc835fe7d716898
BLAKE2b-256 421deea7969b14ff728e543164f9bd13cacb91d18a6ef9b345c3685c4d2e01a9

See more details on using hashes here.

Supported by

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