This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

This notation is widely used on tabletop games, such as wargames or RPGs, and was created on the late 70s for Dungeons & Dragons, as a way to allow generating random values in specific distributions.

With the pass of years it has evolved, and while it never underwent a formal standarization process a core set of rules is kept among all the variations, mostly representing dice in a format such as ‘1d6’, and the use of algebra operations like addition and subtraction.

This project aims to give support to the dice notation, allowing parsing and operating with it on any Python application.

Features

  • Ply-based parser to generate objects for dice notation
  • Easy-to-use objects to handle the notation, just call the ‘roll’ method
  • Classes to support plain dice

Documentation

Documentation sources are included with the project, and used to generate the documentation sites:

  • The latest docs are always generated for the latest release, kept in the ‘master’ branch
  • The development docs are generated from the latest code in the ‘develop’ branch

You can also create the documentation from the source files, kept in the ‘docs’ folder, with the help of Sphinx. For this use the makefile, or the make.bat file, contained on that folder.

Prerequisites

The project has been tested in the following versions of the interpreter:

  • Python 2.7
  • Python 3.3
  • Python 3.4
  • Python 3.5
  • Pypy
  • Pypy 3

All other dependencies are indicated on the requirements.txt file. The included makefile can install them with the command:

$ make requirements

Installing

The project is offered as a Pypi package, and using pip is the preferred way to install it. For this use the following command;

$ pip install dice-notation

If manual installation is required, the project includes a setup.py file, along a makefile allowing direct installation of the library, which can be done with the following command:

$ make install

Usage

The application has been coded in Python, and does not require any particular framework.

To use it just import the parser:

from dice_notation.parser import DiceParser

And then use it to parse a dice notation expression:

parser = DiceParser()
dice = parser.parse('1d6+2')

The result can be accessed just by calling the ‘roll’ method as many times as needed, which will generate a new random value each time it is called:

print(dice.roll())
print(dice.roll())

Collaborate

Any kind of help with the project will be well received, and there are two main ways to give such help:

  • Reporting errors and asking for extensions through the issues management
  • or forking the repository and extending the project

Issues management

Issues are managed at the GitHub project issues tracker, where any Github user may report bugs or ask for new features.

Getting the code

If you wish to fork or modify the code, visit the GitHub project page, where the latest versions are always kept. Check the ‘master’ branch for the latest release, and the ‘develop’ for the current, and stable, development version.

License

The project has been released under the MIT License.

Release History

Release History

1.0.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
dice-notation-1.0.0.tar.gz (47.5 kB) Copy SHA256 Checksum SHA256 Source Oct 23, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting