Skip to content

kzcheng/Penny-Dreadful-Tools

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Penny Dreadful Tools

Repository for the tools used by the Penny Dreadful Community.

View individual subdirectories for details

Build Status Codacy Badge Uptime Robot status

Modules

analysis is for Magic Online game log analysis.

decksite is the code for pennydreadfulmagic.com.

discordbot is the Discord chatbot.

github_tools are some GitHub integration utillities.

logsite is the code for logs.pennydreadfulmagic.com.

logsite_migrations are alembic database migrations for logsite.

magic is for information about Magic – cards, decklists, card images, legality, etc.

maintenance is for useful scripts, usually run via cron.

modo_bugs is for integration with https://github.com/PennyDreadfulMTG/modo-bugs/issues.

price_grabber builds a database of card prices.

pylint_monolith is for our custom extensions to pylint.

rotation_script is for the script that handles Penny Dreadful rotation (card legality changes each season).

shared contains a bunch of general purpose helper classes. Things that could be used in any project.

shared_web contains a bunch of web-specific helper classes.

Contributing

Contributions are very welcome. Please join the Discord at https://pennydreadfulmagic.com/discord/ and feel free to ask questions in #code.

Development Environment Setup

If you plan on running things outside of the containers (eg: dev.py or logsite):

Configuring Environment

  • Add a bot at https://discordapp.com/developers/applications/me
  • Add a bot user for the bot
  • Add the bot to your server with https://discordapp.com/oauth2/authorize?client_id=<your client id here>&scope=bot
  • Click to reveal the token (not secret) on https://discordapp.com/developers/applications/me
  • Copy .env.example to .env and alter the value for "token" to this value
  • Do the same for the discord client_id and client_secret
  • Optionally take a look at shared/configuration.py and enter any required non-default information into .env
  • You will want to investigate the various targets in dev.py that acts as a Makefile. Some of these utilities use GitHub's commandline git-enchancer, hub: https://github.com/github/hub

Manual Development Environment Setup (Non-docker instructions)

  • Install MariaDB 10.0+ (alternative MySQL 8.0+)
  • Install python3.7+
  • Install pip3
  • Install npm
  • git clone https://github.com/PennyDreadfulMTG/Penny-Dreadful-Tools.git
  • python3 dev.py build
  • Using the values from your .env issue the following commands in MySQL (you don't need to create the databases):
    • CREATE USER '<mysql_user>'@'<mysql_host>' IDENTIFIED BY '<mysql_passwd>';
    • GRANT ALL ON <decksite_database>.* TO '<mysql_user>'@'<mysql_host>';
    • GRANT ALL ON <prices_database>.* TO '<mysql_user>'@'<mysql_host>';
    • GRANT ALL ON <magic_database>.* TO '<mysql_user>'@'<mysql_host>';
    • GRANT ALL ON <logsite_database>.* TO '<mysql_user>'@'<mysql_host>';
  • Download a copy of the production decksite database (with personal information stripped):
    • mysql -u <mysql_user> -p<mysql_passwd> -e "CREATE DATABASE <decksite_database>"
    • curl https://pennydreadfulmagic.com/static/dev-db.sql.gz >/tmp/dev-db.sql.gz
    • gunzip /tmp/dev-db.sql.gz
    • mysql -u <mysql_user> -p<mysql_passwd> <decksite_database> </tmp/dev-db.sql
  • Some very minor parts of the bot (the "modofail" command) use libopus and ffmpeg which are not in pip and must be installed in a your-OS-specific way separately. Very optional.

Running Decksite

Running Logsite

Running Discordbot

  • python3 run.py discordbot
  • Visit your Discord server.

About

A suite of tools for the Penny Dreadful MTGO community

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 78.3%
  • HTML 15.8%
  • JavaScript 4.5%
  • TSQL 1.1%
  • PLpgSQL 0.1%
  • Dockerfile 0.1%
  • Other 0.1%