Skip to main content

Python utility for designing and creating simple, regular, graphic outputs as PDF/PNG files

Project description

protograf

protograf

protograf is a utility written in Python for creating simple, regular, graphical designs in PDF (or PNG/GIF/SVG) format via a script.

protograf has been primarily created to handle the prototyping of cards, counters, tiles and boards for board games, including hexagonal grids, but can also be used for creating any relatively simple design that has regular or repetitive elements; typically a mix of graphics and text.

You do not need to know the Python language to be able to use protograf but you do need Python installed on your machine!

:notebook: Documentation

The online documentation for protograf is available at Read the Docs; its highly recommended to read the sections in the order presented in the Guide.

If you're not familiar with any kind of programming or scripting, you should at least read some of the introductory sections, and especially the installation before proceeding...

:information_desk_person: Support

News and discussion happens at the BoardGameGeek Guild; the developer is active there and can also be contacted with a request to join the Discord server for support and chats.

:hammer_and_wrench: Requirements

protograf requires Python (version of 3.13 or higher) to be installed and running on your machine.

If this is not your current Python version, or Python is not installed on your machine, you may want to install uv which is a cross-platform tool able to install Python.

If using uv, it is recommended to also create and use a virtual environment.

:toolbox: Quick Start (for the impatient)

Assuming that Python 3.13 or higher is installed on your machine, you can then install protograf via:

pip install protograf

or, if using uv:

uv pip install protograf

To check that protograf is working, you can use one (or more) of the files from any of the various examples sub-directories.

As a quick test, make a copy of example1.py script from the examples/manual directory. To do so, open the example1.py link in your browser, click on the Raw button (near the top right), and then save the web page as a file into a local directory on your machine.

Open a command-line window (also known as a terminal or a console), change to the directory where you saved the above file and type:

python example1.py

and press the Enter key.

This script is very simple - it just contains these lines:

# `example1` script for protograf
# Written by: Derek Hohls
# Created on: 29 February 2016
from protograf import *
Create()
Save()

and is designed to produce a single, blank, A4-sized page in a PDF file.

It should create an output file called example1.pdf, which will appear in the same directory as the script. You should be able to open and view this file using any PDF-capable program or application. (If you run the script in a Python shell, the output file will be called test.pdf)

If this works, then download and try out other scripts from any of the examples sub-directories (note some examples may require additional files such as images, CSV files, or spreadsheets). You can download all the examples in a single ZIP file.

If it does not work, you may want to look at more detail provided in the installation guide.

:handshake: Contributions

Please see the list of contributors.

:flower_playing_cards: Recent Features

This section highlights a few of the more recent features added. The full feature list is available in the documentation.

  • New shapes: Cross and Pod
  • Common gaming objects: Cube, Domino, Die and Pentomino(es)
  • HexHex boards
  • Stripes: interior "areas" for a Rectangle
  • Cards:
    • support for card-back designs
    • grid marks for hexagonal cards
    • corner crosses as grid marks
    • card-specific bleed areas
  • Color support for CYMK

:game_die: Potential Features

Features not yet checked off are not guaranteed to be implemented; they just represent current / potential areas of work or ideas.

  • Common objects:
    • Meeple (Polyshape with curves)
  • Annular Sectors
  • Image alteration operations
  • Hexagon: 18xx tile example
  • Pathways: (arcs and lines) on a Hexagonal grid
  • Cards:
    • extraction as TableTopSimulator deck
    • icon alignment

:jigsaw: Potential Examples

These are possible examples to show board creation based on existing games:

  • Wargame board: Squad Leader with full terrain features (vector and bitmap)
  • Traveller board: show a fully-styled Star System
  • WarpWar board: show a fully-styled example
  • 18xx board: show a basic map with tracks, towns, cities and off-map areas

:mega: Acknowledgements

The world is full of power and energy and a person can go far by just skimming off a tiny bit of it. "Snow Crash", Neal Stephenson, 1992.

As usual, with Python, you are building "on the shoulders of giants". In this case, the pyMuPDF library provides all of the core infrastructure used to do the underlying graphics processing, PDF file creation and images exports; protograf is effectively a highly customised wrapper to simplify common uses around its existing and extensive capabilities. Internal terminology, such as shapes, was developed before the adoption of pyMuPDF and it is just coincidental that these are similar!

Earlier versions of protograf used the ReportLab PDF Toolkit, which is also a powerful and useful library for supporting this type of application.

Users on BoardGameGeek have provided invaluable feedback and suggestions!

:books: Additional Libraries

:scroll: License

protograf is licensed under the GNU General Public License.

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

protograf-0.5.1.tar.gz (519.4 kB view details)

Uploaded Source

Built Distribution

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

protograf-0.5.1-py3-none-any.whl (532.9 kB view details)

Uploaded Python 3

File details

Details for the file protograf-0.5.1.tar.gz.

File metadata

  • Download URL: protograf-0.5.1.tar.gz
  • Upload date:
  • Size: 519.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for protograf-0.5.1.tar.gz
Algorithm Hash digest
SHA256 8f7c107a01dc586942ca494d0f06d2a881894a0006ba1c17e6d1fe9b9a893c43
MD5 b2f41dd49a6b85a2b19656920fb32668
BLAKE2b-256 722e7bb1ddfa723d28b5effba4808cf8403f7b124eda16e87c3cf19b1a0297aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for protograf-0.5.1.tar.gz:

Publisher: release.yaml on gamesbook/protograf

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

File details

Details for the file protograf-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: protograf-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 532.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for protograf-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ef07938ed405bf9aa89497c3318a985a29c9f0f71fc849c82c470652c571cfc9
MD5 aa08092a01b48a4721369a581c901698
BLAKE2b-256 00699d9960ac87472a91c1a105acd9a63d45b1b42156625c9f2f9b85dfa4980a

See more details on using hashes here.

Provenance

The following attestation bundles were made for protograf-0.5.1-py3-none-any.whl:

Publisher: release.yaml on gamesbook/protograf

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