Skip to main content

Create helper cards for Cold War Commander from list of units and pictures

Project description

cwc-cartes

Generate printable unit cards for the Cold War Commander tabletop game.

Given a folder of unit photos and a units.json file, the tool composites card images and saves them as PNGs.

Example output

AMX AuF1 card

Installation

pip install cwc-cartes

Or from source:

pip install -e .

Requires Python 3.9+.

Usage

Generate cards

python -m cwc_cartes.main <folder>

The folder must contain a units.json file and the background images it references. Cards are written to <folder>/generated/.

Options:

Flag Description
-rotate Rotate each card 90°
-no-bleeding-margins Omit the 36 px bleeding margin added around cards by default

Convert a raw army list to JSON

python -m cwc_cartes.converter <raw_file> <country_code> <army_name> <output.json>

The raw file must be a plain-text list where every 9 consecutive lines describe one unit: name, arm, move, combat (attacks/range), hits, save, (blank), (blank), notes.

units.json format

[
  {
    "country": "FR",
    "army": "French Army, Cold War/1st Gulf War/Modern (46+)",
    "name": "AMX AuF1",
    "arm": "artillery",
    "move": "30",
    "attacks": "4",
    "range": "-",
    "hits": "5",
    "save": "6",
    "notes": "Heavy Artillery: 5/100(H) attacks using direct fire while on-table",
    "flavour": "",
    "images": ["FR/7274.jpg"]
  }
]
  • country — uppercase ISO country code; must match a file in cwc_cartes/images/country_flags/
  • arm — unit type; must match a file in cwc_cartes/images/unit_icons/ (without .png)
  • images — paths relative to the folder, or http(s):// URLs
  • "invisible": true — skip card generation for this unit

License

MIT

Project details


Download files

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

Source Distribution

cwc_cartes-1.0.0.tar.gz (2.5 MB view details)

Uploaded Source

Built Distribution

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

cwc_cartes-1.0.0-py3-none-any.whl (2.6 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cwc_cartes-1.0.0.tar.gz
  • Upload date:
  • Size: 2.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cwc_cartes-1.0.0.tar.gz
Algorithm Hash digest
SHA256 256fee715091c48f36236a1a7102464c86f32d2f4b40ed40afadecc75825374d
MD5 9c3002e6fad6a940fedf8f6a95b8cd37
BLAKE2b-256 9679ba83d6f6f7eb4593087eded1e12468bd876d0c02f30a7807083375944a1e

See more details on using hashes here.

Provenance

The following attestation bundles were made for cwc_cartes-1.0.0.tar.gz:

Publisher: publish.yml on aubustou/cwc-cartes

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: cwc_cartes-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cwc_cartes-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6316fe858a2dc1e69f3d1a44e2a6bfcbe012e1654bdc2073bee21d1e4fd2de71
MD5 8f07bc8354cac649ac422412ed4187c6
BLAKE2b-256 a11f61f9fb0978553e16582c6969138b7b4a3e57031bbe2b97294831d3b5ad92

See more details on using hashes here.

Provenance

The following attestation bundles were made for cwc_cartes-1.0.0-py3-none-any.whl:

Publisher: publish.yml on aubustou/cwc-cartes

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page