Python SSG for tracking online TCG collection
Find a file
2025-01-25 12:26:17 +00:00
build Track coupons 2024-12-07 13:40:50 +00:00
.gitignore Add space for miscellaneous files 2024-12-11 20:50:26 +00:00
build.sh Add some more classes for CSS 2024-12-17 23:37:09 +00:00
collectinggen.py Add thresholds for medium and high priority 2024-11-13 19:17:24 +00:00
COPYING MVP 2024-10-28 21:54:15 +00:00
download.py Add page for masteries, get deck types from a file, some refactoring 2024-11-03 22:53:45 +00:00
generate.py Make owned cards page optional 2024-12-08 11:38:19 +00:00
indexgen.py Track sketchpad redemption 2025-01-01 19:45:53 +00:00
levelsgen.py Coquille 2025-01-04 19:04:02 +00:00
log-template.py Track sketchpad redemption 2025-01-01 19:45:53 +00:00
loggen.py Track coupons 2024-12-07 13:40:50 +00:00
massgen.py Show relevant masteries on mass dack pages, hide numbers for some mass decks 2024-12-23 10:04:13 +00:00
masteredgen.py Add page for masteries, get deck types from a file, some refactoring 2024-11-03 22:53:45 +00:00
ownedgen.py Add page for masteries, get deck types from a file, some refactoring 2024-11-03 22:53:45 +00:00
portfoliosgen.py Move portfolios to log 2024-11-06 23:33:39 +00:00
README.org Show donations on index page 2024-12-30 12:04:29 +00:00
searchgen.py Make it possible to include single cards in mass collects 2024-12-18 00:33:55 +00:00
setup.py misc fixes 2024-12-18 22:19:29 +00:00
skel.py Make owned cards page optional 2024-12-08 11:38:19 +00:00
tcgcore.py Make it possible to include single cards in mass collects 2024-12-18 00:33:55 +00:00
thetypes.py Add page for masteries, get deck types from a file, some refactoring 2024-11-03 22:53:45 +00:00
tradegen.py Refactor tradegen 2025-01-25 12:26:17 +00:00
variables-template.py Add optional link to a page of choice 2024-12-30 11:52:16 +00:00
wantedgen.py Attempt some refactoring 2024-12-06 21:23:24 +00:00

tcg

Python scripts to generate a mobile-friendly static site for tracking tcg cards (designed for colors).

Instructions

Requirements

  • python3
  • server space
  • subdomain pointing to your site root on the server
  • rclone with your server set up as a remote

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
  • Edit variables.py to set the variables as follows:

    • servername: name set for your remote in rclone
    • serverpath: path to the site root on the server (with leading slash, without trailing slash)
    • name: the name you use in the game
    • highpriority: a list of high priority decks youre collecting
    • tradepost: URL of your trade post on Dreamwidth
    • faves: a list of cards to showcase on the index page
    • headerbackground: an HTML colour to display behind your header image and set as a theme colour
    • british: True if you want “grey” to display on the site, False if you want “gray”
    • collectthreshold: minimum number of owned cards for putting a deck in the “collecting” category
    • mediumthreshold: minimum number of owned cards for marking a deck as medium priority
    • highthreshold: minimum number of owned cards for marking a deck as high priority
    • keepsig: True if you always want to keep one copy of your signature, False if you want to make them all available for trading
    • tradestatement: statement to place on your trading page
    • maxmastered: maximum number of most recently mastered decks to show on the index page
    • ownedpage: True if you want a page displaying your entire collection, False otherwise
    • firstmasteries: a list of decks you mastered first
    • misclink: under "link", a link to any page you choose, and under "text", text to display as the link
    • donations : lists of donated decks and individual scrapbook cards
    • masscollect: list (python dict) of series/themes being mass collected, each containing a dict which specifies “full” as either True or False (to show or hide a list of the total number of cards in the set) and contains at least one of "decks" specifying a list of decks, or "singles" specifying a list of individual cards
  • 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/, as 00.gif, 01.gif, etc.
  • Save coupons to build/assets/coupons/, with filenames that match the codes youve given them in log.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 the log list like in the example (removing any of "received", "lost", "crayons", "decks", "coupons"> that arent relevant).
  • Run ./build.sh in this directory to download the relevant card images and then upload everything to the server.