Skip to main content

Dominion Divider Generation

Tests

Introduction

This is a script and library to generate card dividers for storing cards for the game Dominion. If you are just looking go generate some dominion dividers, there is no need to install this script as I host a live version of this generator code. However, if you want to use arguments that I don't expose on that page, or change the code, or contribute to the project the full generation code (not the web interface or the fonts) is included here, and contributions are more than welcome.

Again, to generate tabs go to the Online Generator.

Installation

If you do need to install the package locally (the script provides a lot more options than the web-based generator), a simple pip install domdiv should suffice, providing a command by the name of dominion_dividers. However, see the note under Prerequisites->Fonts below as the default install will fall back on a font that doesn't match the cards (though most people don't notice). Run dominion_dividers <outfile> to get a pdf of all dividers with the default options, or run dominion_dividers --help to see the (extensive) list of options.

Additionally, to ensure the card dividers are generated sorted by correct alphabetical order (especially for languages with many accented characters (e.g. Czech)), you are advised to install the optional PyICU library. If PyICU is installed (instructions), the script will sort the card dividers based on selected language alphabet (e.g. in Czech z < ž). Otherwise, default sorting will be used (the cards beginning with accented characters will be at the end of the sorted set).

Documentation

The script has an extensive set of options that are relatively well documented via dominion_dividers --help. Some are hard to describe unless you see output samples, so we recommend running the script with various options to see which configuration you like. The help output is replicated here for reference.

Translations

When changing any of the card database files you should run the language update tool via doit update_languages. This produces the package version of the card db from the card db source. This will also be run automatically and checked into git when you push to github. You should make sure that the resulting changes to the package are what you intend by generating dividers in the relevant languages.

If you would like to help with translations to new (or updating existing) languages, please see instructions here.

Fonts

There are a number of fonts used in Dominion and many of them we cannot distribute with the package. We use fallbacks to commonly distributed fonts that work fine if you don't care the match the game exactly. If you do want to match, the script prints the preferred fonts if it uses fallbacks. Some come with programs like Adobe Reader and you can grab them from there.

Sadly, many of these fonts use features that are not support by the reportlab package. Thus, they need to first be converted to ttf (TrueType) format. I used the open source package fontforge to do the conversion. Included as 'tools/convert_font.ff' is a script for fontforge to do the conversion, on Mac OS X with fontforge installed through macports or homebrew you can just run commands like ./tools/convert_font.ff MinionPro-Regular.otf.

If you select language in domdiv options which is not supported in ISO/IEC 8859-1:1998 (Latin1) (e.g. Czech), you will have to obtain Times Roman TTF fonts as well (see ./src/domdiv/fonts/README.md for details).

To supply fonts locally, put them in a directory and supply the relative path to it to the script via the --font-dir option. Alternatively you can copy the converted .ttf files to the fonts directory in the domdiv package/directory, then perform the package install below.

Using as a library

The library will be installed as domdiv with the main entry point being domdiv.main.generate(options). It takes a Namespace of options as generated by python's argparser module. You can either use domdiv.main.parse_opts(cmdline_args) to get such an object by passing in a list of command line options (like sys.argv), or directly create an appropriate object by assigning the correct values to its attributes, starting from an empty class or an actual argparse Namespace object.

Developing

Install requirements via pip install -r requirements.txt. Then, run pre-commit install. You can use pip install -e .[dev] to install the dominion_dividers script so that it calls your checked out code, enabling you to run edited code without having to perform an install every time. This also installs needed dev dependencies, or if you want the pinned versions use pip install -r dev-requirements.txt instead.

Feel free to comment on boardgamegeek at https://boardgamegeek.com/thread/926575/web-page-generate-tabbed-dividers or file issues on github (https://github.com/sumpfork/dominiontabs/issues).

Tests can be run (and their dependencies installed) via pip install .[dev] and then doit test. They will also run if/when you push a branch or make a PR.

Image Sources

There is a separate repo for the image sources. While these are optional, they can be useful reference and/or used for creating new or recreating old tab banners, icons, etc. Many of these were originally scans of the physical game. Some of them have a lot of layers and are approaching 1GB in size, so they are hosted via Git LFS. As the Github version of that incurs a higher monthly cost, I instead host them on a private LFS server. If you would like the images or would like to contribute images let me know and I can make you an account on said server, or you I can copy them for you for easier access.

Docker

The project can be compiled into a container:

docker build . -t dominiontabs

Once you have the dominiontabs container you can run it from your CLI and pass it arguments like so, mapping the local directory to where the script will run so you can use local fonts and access the output file (example produces German dividers for Seaside 2nd edition):

docker run -v .:/app dominiontabs --language=de --expansions=seaside2ndEdition

  1. Bind mount to an output directory (-v) and tell the script to output there so that we get a PDF in the local filesystem when things are done (--outfile ./output/foo.pdf).
  2. Add the --rm argo to tell docker not to save a container each time it runs.
  3. Point to the fonts built in to the image with --font-dir /fonts
  4. Add a few CLI args to reduce the runtime and file size (--expansions cornucopia).

So now we have

docker run -v $PWD/output:/app/output --rm dominiontabs --font-dir /fonts --expansions cornucopia --outfile ./output/dominion_dividers_docker.pdf

(Replace $PWD with %cd% on Windows OS)

Once that runs you should have under your current directory:

./output/dominion_dividers_docker.pdf

From there you feel free to add other arguments as you like!

Metadata

Release files for domdiv 4.9.3

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

Source distribution (sdist)

Source distribution for domdiv 4.9.3
File Size Uploaded
domdiv-4.9.3.tar.gz 26.0 MB Details

Built distribution (wheel)

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

Total release size: 51.2 MB

Release files / domdiv-4.9.3.tar.gz

Download URL domdiv-4.9.3.tar.gz
Size 26.0 MB
Tags Source
SHA-256 checksum
How to use checksums
dbf8fdcfa267872931459bd9cf30799cacc08d506704407711a3ac0966be0f41
BLAKE2b-256 checksum
How to use checksums
a0873c764b9a798c1b1350b47f84433db9e26649a11af07a4b57aea24abcd147
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Jul 18, 2025.

Transparency log

Release files / domdiv-4.9.3-py3-none-any.whl

Download URL domdiv-4.9.3-py3-none-any.whl
Size 25.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
16309b675c085d5a7cf853c3255145685335f2bbeab4f5cf8b90c0d74044610f
BLAKE2b-256 checksum
How to use checksums
048509da8297d9684900000d832742b4c3e467763a2785cf85f6dd7b85bad530
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Jul 18, 2025.

Transparency log
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