DMing
DMing is a CLI (command-line interface) collection useful when running a TTRPG (tabletop role-playing game).
Installation
pipx install dming
Usage
DMing provides a grouped command for all tools. The standalone roll command
remains available as a shortcut for dming roll. Every leaf command supports
--format rich|plain|json|csv; the default is rich. The option can appear on
the root command or the leaf command, and the leaf value takes precedence.
$ dming --format json rules advancement
$ dming chance d20 --format csv
Roll Dice
Use the command roll <dice>.
Examples:
roll 1d20: roll a d20 dieroll 1d100: roll a d100 dieroll 2d20kh1: roll with advantageroll 2d20kl1: roll with disadvantageroll 2d20dl1: roll with advantageroll 2d20dh1: roll with disadvantageroll 1d20+4: roll a d20 die with a +4 modifierroll 1d20-4: roll a d20 die with a -4 modifier
Add -d or --details to show every die, which dice were selected by a keep or
drop filter, and the complete calculation. Use --plain as a shortcut
for --format plain. JSON emits one object; CSV emits one result row and stores
detailed groups as compact JSON in a quoted cell.
$ roll --details 2d20kh1
🎲 2d20kh1
├─ 2d20kh1: 19, 9 → 19 (keep highest 1)
├─ Calculation: 19
└─ Result: 19
$ roll --details 2d20
🎲 2d20
├─ 2d20: 4, 4
├─ Calculation: 4 + 4
└─ Result: 8
$ roll --details --plain 2d20
Roll: 2d20
2d20: 4, 4
Calculation: 4 + 4
Result: 8
Chance Tables
Use dming chance <die> to show the chance of meeting or exceeding each target
with a standard roll, advantage, or disadvantage. Tables support one die with
an optional modifier. The Roll Needed column shows the lowest natural roll
that reaches each target.
$ dming chance d20
$ dming chance d20+5
$ dming chance d20-3 --min-target 5 --max-target 30
The default range starts at target 1 and ends at the greater of the die size or
the highest modified total. Override either boundary with --min-target and
--max-target. Percentages use ordinary threshold rules; natural minimum and
maximum rolls do not introduce automatic failure or success rules.
Unit Conversions
Use a unit-specific dming convert command to convert common US customary
measurements to metric units.
$ dming convert inches
$ dming convert feet
$ dming convert miles
$ dming convert pounds
The Squares column expresses each distance as a number of 5-foot grid spaces.
Pounds are converted to kilograms. Measurement units appear in the table
headers, such as (ft.), (m.), (lb.), and (kg.).
Supply one or more values as positional arguments to build a custom table. Values must be positive and are sorted and deduplicated.
$ dming convert feet 5 30
$ dming convert inches 6 12
$ dming convert pounds 2.5 10
SRD 5.2.1 Rules References
Use dming rules for fifth-edition reference tables from SRD 5.2.1.
$ dming rules abilities
$ dming rules advancement
$ dming rules carrying
$ dming rules difficulty
$ dming rules proficiency
$ dming rules sizes
The source tables are available in the System Reference Document 5.2.1. Character Advancement includes levels 1–20, cumulative XP thresholds, and proficiency bonuses.
Creature sizes also include metric dimensions. Carrying-capacity entries also include kilogram equivalents for carrying and for dragging, lifting, or pushing.
Using the Library
from dming.dice import roll
operation, result = roll("1d20+2")
Alternatives
- JavaScript: Dice Roller & Parser.
Development
For development instructions, see the DMing development guide.
Releases
GitHub Releases are the canonical release history. See DMing releases for release notes and downloadable artifacts.
Licensing
DMing's original code is available under the MIT License. SRD-derived reference data is available under CC BY 4.0; see NOTICE.md for attribution and details about modifications.
This work includes material from the System Reference Document 5.2.1 (“SRD 5.2.1”) by Wizards of the Coast LLC, available at https://www.dndbeyond.com/srd. The SRD 5.2.1 is licensed under the Creative Commons Attribution 4.0 International License, available at https://creativecommons.org/licenses/by/4.0/legalcode.
AI Assistance
This project uses AI-assisted development tools. Some code and documentation may be generated or revised with AI assistance. All AI-assisted changes are reviewed and tested by the maintainer before they are included.
Metadata
Release files for dming 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dming-1.0.0.tar.gz | 62.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dming-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 86.1 kB
Release files / dming-1.0.0.tar.gz
| Download URL | dming-1.0.0.tar.gz |
|---|---|
| Size | 62.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a421e5076c7625aae6bbcd146d1c36f260b83e0813a2a470b9f0cbb8a752da8d
|
|
BLAKE2b-256 checksum How to use checksums |
a599264577f3cd556ad2ab7f453570edbb12978dd856356b6e3bf89732f2e4cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.
Transparency logRelease files / dming-1.0.0-py3-none-any.whl
| Download URL | dming-1.0.0-py3-none-any.whl |
|---|---|
| Size | 24.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e8a8e583ba6e2378115af9d67ee8e8232a3731607eff2eea7049fa77a807b491
|
|
BLAKE2b-256 checksum How to use checksums |
8b2d9a606112339c0c7046d2352aac4d6ed8363241c99cc0dca2ac77582d8827
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.
Transparency log