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.

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lazydh-1.0.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

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

lazydh-1.0.0-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file lazydh-1.0.0.tar.gz.

File metadata

  • Download URL: lazydh-1.0.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for lazydh-1.0.0.tar.gz
Algorithm Hash digest
SHA256 67635f8092a1db00479a9ba854ef1512dc257bf7cbee1abebb4531ce13599932
MD5 fc1d6548465d0fe45875c497e564ae4b
BLAKE2b-256 a15e8a47be333235a4894d6027f42d60e61cf4de780fd279a67480daecb23877

See more details on using hashes here.

File details

Details for the file lazydh-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: lazydh-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for lazydh-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c01a1b7c606765e00c8acdee7ea7d839a0100d9b52d64bf6709ccd4752c6e933
MD5 7fa2e59432198e7708a35cf0c26cd43b
BLAKE2b-256 99bba8e3d78abae4c1877afc2c3d9c35772db0299fa0a6dd0f12a10309f0cb93

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.1

2 files

This release

1.0.0 This release

2 files

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