Python SSG for tracking online TCG collection
| build | ||
| .gitignore | ||
| colors.py | ||
| COPYING | ||
| log-template.py | ||
| README.org | ||
| rewards.py | ||
| setup.py | ||
| tools.py | ||
| trade-template.py | ||
| variables-template.py | ||
tcg
Python scripts to generate a mobile-friendly static site for tracking tcg cards (designed for colors).
Features
- Mobile-frendly by default
- Built in light/dark mode depending on device settings
- No JavaScript except on the card search page
- Automatic categorisation of cards, decks, portfolios etc.
- Various tools to generate game comments, art shop requests, trade requests etc.
Instructions
Requirements
python3(needs the following libraries:bs4, collections, datetime, itertools, os, random, re, requests)-
either:
- server space
- subdomain pointing to your site root on the server
rclonewith your server set up as a remote
-
or:
- a neocities account with the neocities CLI installed
Setup
- Download and create the initial files by running:
git clone https://git.praze.net/tre/tcg.git
cd tcg
cp log-template.py log.py
cp variables-template.py variables.py
cp trade-template.py trade.py
-
Edit
variables.pyto set the variables as follows:neocities: set toTrueif you will be using the neocities CLIservername: name set for your remote inrclone(if not using the neocities CLI)serverpath: path to the site root on the server (if not using the neocities CLI; with leading slash, without trailing slash)subfolder: subfolder under your (sub)domain in which the TCG pages will be located (leave as an empty string if they are at the top level; leave out both leading and trailing slash; if using the neocities CLI this will not work and the pages will be uploaded to the site root)url: URL of your site index page includinghttps://name: the name you use in the gamehovertext: text to display when hovering over the header imagesig: set toTruewhen you have a signature cardmembersdisambig: uncomment and set to a member’s name as given in their sig card + the URL of their card post where necessary (in case of any sigs failing to link or linking incorrectly)banner: set toTruewhen you have a player banner, and save this inbuild/assets/asbanner.pnglowpriority: a list of decks you’re collecting that aren’t in mass deckstrademedium: whether to allow trading medium-priority cards away in exchange for high-priority cards (special cards will not be listed as tradeable)tradepost: URL of your trade post on Dreamwidthhiatus: set toTrueor"custom hiatus message"if you are on hiatusfaves: a list of cards to showcase on the index pageheaderbackground: an HTML colour to display behind your header image and set as a theme colourbritish:Trueif you want “grey” to display on the site,Falseif you want “gray”sketchprize: prize you normally want for sketchpads in the art shop (1 or 2)collectthreshold: minimum number of owned cards for putting a deck in the “collecting” category (all cards in mass decks will be included)mediumthreshold: minimum number of owned cards for marking a deck as medium prioritycollectingmediumthreshold: minimum number of owned cards for marking a deck being collected as medium priority (should normally be lower thanmediumthreshold)highthreshold: minimum number of owned cards for marking a deck as high prioritykeepsig:Trueif you always want to keep one copy of your signature,Falseif you want to make them all available for tradingtradestatement: statement to place on your trading pagemaxmastered: maximum number of most recently mastered decks to show on the index pagefirstmasteries: a list of decks you mastered firstmisclink: under"link", a link to any page you choose, and under"text", text to display as the linknewtab: whether links to external sites should open in new tabsdonations: lists of donated decks and individual scrapbook cardsmasscollect: list (python dict) of series/themes being mass collected, each containing at least one of"series"specifying a list of series from the online decklist,"decks"specifying a list of decks, or"singles"specifying a list of individual cardsanniversary: list of current anniversary decks
-
Run the following:
python3 setup.py chmod +x build.sh - Save a header image to
build/assets/header.png - Save each stage of a filled sketchpad to
build/assets/sketch/, as00.gif,01.gif, etc. - Save coupons to
build/assets/coupons/, with filenames that match the codes you’ve given them inlog.py. - Add level images manually to
build/assets/levels/ - Add custom CSS to
build/user.css
Updating and building
- For each transaction, add a dictionary
{}to theloglist like in the example (removing any of"received","lost","crayons","decks","coupons","pend","unpend"that aren’t relevant). - Run
./build.shin this directory to download the relevant card images and then upload everything to the server.