add database / update readme

This commit is contained in:
Zach H 2016-07-13 17:58:14 -04:00
parent a677b27b30
commit 0422915c17
4 changed files with 7 additions and 3 deletions

Binary file not shown.

View file

@ -1,3 +1,7 @@
# MTG-Livetime-Database
[![Join the chat at https://gitter.im/ZeldaZach/MTG-Livetime-Database](https://badges.gitter.im/ZeldaZach/MTG-Livetime-Database.svg)](https://gitter.im/ZeldaZach/MTG-Livetime-Database?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
This project uses the [MTGJSON](www.mtgjson.com) files to create a SQLite database with all relevant data for Magic: The Gathering.
This database can be easily updated / pulled from the repo for projects that need to use a database of the cards and don't have a way to parse the JSON files themselves.

View file

@ -5,7 +5,7 @@ import datetime
import os
JSON_FILE = input("Where is the \"AllSets-x.json\" file you'd like to import?\n> ") #Input filename via command line
DB_FILE = "Magic Database Complete" + str(datetime.datetime.now()) + ".db"
DB_FILE = "Magic Database Complete " + str(datetime.datetime.now()) + ".db"
# Get the value of the card, return None if NULL
def getVal(data, field):

View file

@ -5,7 +5,7 @@ import datetime
import os
JSON_FILE = input("Where is the single set JSON file you'd like to import?\n> ") #Input filename via command line
DB_FILE = "Magic Database Single Set" + str(datetime.datetime.now()) + ".db"
DB_FILE = "Magic Database Single Set " + str(datetime.datetime.now()) + ".db"
traffic = json.load(open(JSON_FILE))
conn = sqlite3.connect(DB_FILE)