{ "info": { "author": "Philip Hodder", "author_email": "philip.hodder@encodis.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Games/Entertainment :: Role-Playing" ], "description": "# Introduction\n\nLately it seems that cards have become a popular accessory in tabletop role playing games. These can be used to provide a physical representation of items, spells or other gaming elements. Most decks are produced using image editors like GIMP or Photoshop, which is fine if you have the time, the software and the skills to use it. \n\nGamecards tries to automate this process. It takes a CSV file where each row represents an item, spell or other gaming element and each field in the row represents a property or attribute of that item, and converts it into a number of HTML pages. Each page contains a table, and each cell of the table contains a representation of the item, rendered according to a template file.\n\nThe resulting HTML file can then be printed and cut up to produce the cards themselves.\n\n## Installation\n\n```\n$ pip install --upgrade gamecards\n```\n\n## Usage\n\nThe `gamecards` script simply takes four arguments (in this order): the CSV file containing the data, a template HTML file, a CSS specification (a file name, or comma separated list of file names) and the output HTML file name:\n\n```\n$ python -m gamecards cards.csv cards.tpl cards.css cards.html\n```\n\nOr use the console script:\n\n```\n$ gamecards cards.csv cards.tpl cards.css cards.html\n```\n\nThe default is for each 'page' of the file to contain 3 rows and 3 columns. This can be changed using the `--rows` and `--cols` arguments:\n\n```\n$ gamecards cards.csv cards.tpl cards.css cards.html --rows 2 --cols 4\n```\n\n## CSV file\n\nThe CSV file must start with a header line that names each of the fields. These will be used in the template file. If a field contains a comma it must be enclosed in quotes. For example:\n\n```\nID,Field1,Field2\n1,Some text,Some more text\n2,Second row,\"Text, with a comma\"\n```\n\n## Template file\n\nThis is an HTML fragment containing standard Python template strings. These template strings should match header fields in the CSV file, and are substituted into the template using the Python string Template functionality. For example, the following template file:\n\n```\n
${Field1}
\n