Metadata-Version: 2.1
Name: arkham-utils
Version: 0.1.3
Summary: Arkham Horror LCG utilities
Author: Ian Su
Author-email: iansu1979+github@gmail.com
Requires-Python: >=3.12,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: Pillow (>=12.0.0,<13.0.0)
Requires-Dist: PyMuPDF (>=1.26.6,<2.0.0)
Requires-Dist: fpdf2 (>=2.8.5,<3.0.0)
Requires-Dist: platformdirs (>=4.3.7,<5.0.0)
Requires-Dist: requests (>=2.29.0,<3.0.0)
Requires-Dist: requests-cache (>=1.2.1,<2.0.0)
Description-Content-Type: text/markdown

# Arkham Horror LCG utilities

A simple set of utilities to read from [ArkhamDB](https://arkhamdb.com/) and [OCTGN files](https://github.com/GeckoTH/arkham-horror) mainly used to generate printable proxies in PDF format.

```sh
pip install arkham-utils
```

## Using ArkhamDB images

Note the images from ArkhamDB have an FFG watermark on them.

```py
from arkham_utils.arkhamdb import db
from arkham_utils.pdf.builder import PDFBuilder

cards = [db.search(name) for name in [
  'Blackjack',
  'Guts',
  'Emergency Cache',
  'Elder Sign',
  'Shrivelling',
  'Daisy Walker'
]]
pdf = PDFBuilder(cards)
pdf.write('proxies.pdf')
```

## Using OCTGN images

You will need to first download the image packs from <https://ahlcgoctgn.wordpress.com/image-packs/> into a subfolder named `o8c` in your application support directory (`Library/Application Support/arkham_utils/o8c` on MacOS).

```py
from arkham_utils.octgn import db
from arkham_utils.pdf.builder import PDFBuilder

cards = [db.find(name) for name in [
  'Blackjack',
  'Guts',
  'Emergency Cache',
  'Elder Sign',
  'Shrivelling',
  'Daisy Walker'
]]
pdf = PDFBuilder(cards)
pdf.write('proxies.pdf')
```

### Proxying an entire set

```py
from arkham_utils.octgn import db
from arkham_utils.pdf.builder import PDFBuilder, PDFBuilderConfig

# write all the non-mini cards as a PDF
barkham = db.find_set('Meowlathotep')
PDFBuilder([c for c in barkham.cards if c.type != 'Mini']).write('barkham.pdf')

# write the mini investigator cards
mini_cfg = PDFBuilderConfig()
mini_cfg.cards_per_row = 4
mini_cfg.rows_per_page = 4
mini_cfg.card_height = 2.5
mini_cfg.card_width = 1.625
PDFBuilder([c for c in barkham.cards if c.type == 'Mini'], mini_cfg).write('barkham_minis.pdf')
```

