Skip to main content

lazydh

lazydh converts pdf files of Daggerheart-compatible Adversary and Environment statblocks to text-based formats to meet GMs where they prep.

lazydh extracts text using Optical Character Recognition (OCR) via pymupdf, and then performs a best-faith reconstruction of each entity. This best-faith reconstruction leverages the predictable structure of Daggerheart-comptabile statblocks to parse extracted text. However, OCR is not perfect, so some errors of varying degrees are likely. If ever lazydh is not able to assign an expected trait (e.g. attack mod, environmental impulses, features, etc.) it will throw a warning calling out the specific adversary and attribute it was unable to represent.

lazydh is generally robust to art and additional text on statblock-containing pages. Documentation outlining the overall specifications and assumptions are forthcoming.

The currently supported output formats are:

Requirements

lazydh is Python package/cli tool and thus requires Python. The project was built using uv, and while it should function without it (using pip and pipx for library and tool installation, respectively). This document will assume uv usage.

lazydh has been tested on linux, MacOS, and Windows.

Installation

# command line tool only, exposes the `lazydh` executable to your PATH
uv tool install lazydh

or

# command line tool AND Python package, might need to append `uv run` before each `lazydh` command.
uv add lazydh

or

# will not expose the `lazydh` cli tool
pip install lazydh

Local Build

git clone https://github.com/dakota-hawkins/lazydh
cd lazydh
pip install ./

Development Version

uv add lazydh[dev]

Extracting Statblocks

To extract statblocks from a .pdf, simply invoke the lazydh command from the command line while pointing the tool to your .pdf of interest:

# get your favorite set of statblocks
wget https://www.daggerheart.com/wp-content/uploads/2025/09/Adversaries-Environments-v1.5-.pdf
# convert statblocks
lazydh Adversaries-Environments-v1.5-.pdf --outdir output/void-v1-5 --source "Void 1.5"

Alternative Formats

By default, lazydh writes statblocks to individual markdown files. Two other json-based outputs are also supported in the form of "json" and "fantasy_statblock" options.

lazydh Adversaries-Environments-v1.5-.pdf --outdir output/void-v1-5 --source "Void 1.5 --output" json
lazydh Adversaries-Environments-v1.5-.pdf --outdir output/void-v1-5 --source "Void 1.5"
--output fantasy_statblock

By default, markdown files contain .yaml front matter for use in Obsidian. You can disable this by using the --no-frontmatter flag

lazydh Adversaries-Environments-v1.5-.pdf --outdir output/void-v1-5 --source "Void 1.5" --no-frontmatter

Only Parsing Specific Pages

If you would like to only extract statblocks from specific pages, use the --pages argument to specify the desired ranges.

lazydh Adversaries-Environments-v1.5-.pdf --outdir output/void-v1-5 --source "Void 1.5" --pages 1-2,5-6

For full options, run:

lazydh --help

Python Library

lazydh is not only a command line utility, but also a fully-fleged Python package. There is more flexibility in the Python package than is exposed to the command line tool. For example, you can extend the base PdfLoader class to support new output formats.

from lazydh.reader import PdfLoader
from pathlib import Path

class MyReader(PdfLoader):

    def to_text(self, out_file: Path | None = None):
        if out_file is None:
            out_file = self.pdf.with_suffix(".txt")
        self._get_statblocks()
        lines = "\n".join([str(x) for x in self.statblocks_])
        with open(out_file, 'w') as f:
            f.writelines(lines)

reader = MyReader("Adversaries-Environments-v1.5-.pdf")
reader.to_text(out_file = "statblocks.txt")

Roadmap

  • Development Docs
  • Expanded Tests

Additional Features and Contributing

If you would like to request an in-scope additional feature (e.g. additional output formats), feel free to open an issue. This is a passion project I work on when I have time, so no guarantee on an immediate response.

If you have a bug to report, again feel free to open an issue, but be aware I can only test on .pdfs I have legal access to.

If you would like to contribute a feature, feel free to fork the repository, implement your feature, and then open a pull request. Requirements for pull requests:

  • Full explanation and overview of the new feature.
  • All new functionality must be unit tested with all previous tests passing.
    • Tests should be written in pytest and executable with uv run pytest.
  • Developer documentation and fully typed functions.
  • No AI generated code. If you can't bother to write the code, I won't bother to review it. This is a passion project: lean into the friction and enjoy the meaning generating process.

Disclaimer

lazydh is a tool to extract and format text of .pdf files you already have legal access to. Respect the copyright and terms of all content you plan to convert.

Metadata

Release files for lazydh 1.0.1

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

Source distribution (sdist)

Source distribution for lazydh 1.0.1
File Size Uploaded Provenance Actions
lazydh-1.0.1.tar.gz 11.3 kB Without provenance Details for lazydh-1.0.1.tar.gz

Built distribution (wheel)

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

Total release size: 25.1 kB

Release files / lazydh-1.0.1.tar.gz

Download URL lazydh-1.0.1.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0325c843123e49e129ea0512270b7891ee53d09c90c7349e0a1c86df15f25e10
BLAKE2b-256 checksum
How to use checksums
51c9da74dfb696205f826017877098eaa19eb374f516a0be2c1829440404c0af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / lazydh-1.0.1-py3-none-any.whl

Download URL lazydh-1.0.1-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b0268b067c1e4e54b9e93518c148e9d1eb51eaff0540d8ab36d8933ad074d974
BLAKE2b-256 checksum
How to use checksums
6bbb79b8c45e04fd986301282744b8a5e8e0b514dc3cd23a42967785d07aa344
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for lazydh 1.0.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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