Metadata-Version: 2.4
Name: die
Version: 1.0.0
Summary: Library for simulating dice, dice rolls, and stats on dice.
Project-URL: Homepage, https://github.com/njharman/die
Project-URL: Repository, https://github.com/njharman/die
Project-URL: Issues, https://github.com/njharman/die/issues
Author-email: "Norman J. Harman Jr." <njharman@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: board-game,dice,probability,random,rpg,simulation,tabletop
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Games/Entertainment :: Board Games
Classifier: Topic :: Games/Entertainment :: Role-Playing
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Description-Content-Type: text/x-rst

die
===

About
-----
die is a dice library, for RPG and Board Game games, tools, whatever.

Emphasizes flexibility over speed.


Installing
----------
via pip::

    pip install die

via uv::

    uv add die


Using
-----
::

    import die

    d6 = die.Standard(6)
    d6.roll()          # -> single roll, e.g. 4
    d6 + 3              # -> roll + 3

    roll = die.Roll((die.Standard(6), die.Standard(6)))
    roll.roll()         # -> sum of both dice

See ``examples/demo.py`` for a fuller walkthrough.


Testing
-------
Requires uv_. ::

    uv sync
    uv run pytest
    uv run ruff check .
    uv run ruff format --check .

Unittests run against Python 3.11, 3.12, 3.13 via GitHub Actions.


History
-------

1.0.0
  Modernized packaging: src-layout, pyproject.toml/hatchling, uv, MIT license,
  GitHub Actions CI. No API changes.

0.4.0
  Backwards incompatible.
  Operators, coercions, comparisons roll die, str() no longer does)

0.3.0
  Merged rolls() into roll(), renamed tuple_* to, added die.items property.
  str() rolls die,

0.2.0
  Updated to modern style, pep8, tests, docs, travis-ci, more unittests.
  Py3.x support.

0.1.0
  Initial release.


.. _uv: https://docs.astral.sh/uv/
