This commit is contained in:
Zach H 2016-07-22 01:41:17 -04:00
parent f213600518
commit 5f6dd0e59e

View file

@ -3,7 +3,9 @@
[![Join the chat at https://gitter.im/mtgjson/mtgsqlive](https://badges.gitter.im/mtgjson/mtgsqlive.svg)](https://gitter.im/mtgjson/mtgsqlive) [![Join the chat at https://gitter.im/mtgjson/mtgsqlive](https://badges.gitter.im/mtgjson/mtgsqlive.svg)](https://gitter.im/mtgjson/mtgsqlive)
### Goals ### Goals
The goals of this project include creating a downloadable SQLite database file containing all cards from the game Magic: The Gathering. We are looking for a way to stop being dependent on Gatherer for card data due to their delayed update times and egregious errors that slip by quality control, which we can correct in real time. While we want to claim we are completely independent from Gatherer, we must first start with their data and then manually edit it to be correct. Once that is accomplished, we are then no longer dependent on them for card data, except for rullings. The goals of this project include creating a downloadable SQLite database file containing all cards from the game Magic: The Gathering. We are looking for a way to stop being dependent on Gatherer for card data due to their delayed update times and egregious errors that slip by quality control, which we can correct in real time.
While we want to claim we are completely independent from Gatherer, we must first start with their data and then manually edit it to be correct. Once that is accomplished, we are then no longer dependent on them for card data, except for rullings.
### How We Did It ### How We Did It
@ -22,9 +24,7 @@ Projects can pull in our complete database for their projects in order to have a
If you would like to use our pre-compiled database for your project, simply download the database and read the `lastUpdated` table to know when the database was last updated. If you would rather create your own database, we have included the tools to do such. If you would like to use our pre-compiled database for your project, simply download the database and read the `lastUpdated` table to know when the database was last updated. If you would rather create your own database, we have included the tools to do such.
To turn your AllSets JSON file into a SQLite database, run the following command: To turn your AllSets JSON file into a SQLite database, run the following command: <br> `./json_to_sql.py create_new_db db_location json_file_location`
`./json_to_sql.py create_new_db db_location json_file_location`
Where: Where:
* `create_new_db` is "0" (do not create a new database) or "1" (create a new database) * `create_new_db` is "0" (do not create a new database) or "1" (create a new database)
@ -34,9 +34,7 @@ Where:
If your project is already dependent on a JSON format, such as if you pull in the data from MTGJSON and parse it internally, you can create a JSON file from our database with our conversion tool! If your project is already dependent on a JSON format, such as if you pull in the data from MTGJSON and parse it internally, you can create a JSON file from our database with our conversion tool!
To turn a SQLite database file into a JSON file, run the following command: To turn a SQLite database file into a JSON file, run the following command: <br> `./sql_to_json.py db_location output_file_location sets_or_cards`
`./sql_to_json.py db_location output_file_location sets_or_cards`
Where: Where:
* `db_location` is the location where the database is stored * `db_location` is the location where the database is stored