Skip to content

Instantly share code, notes, and snippets.

@multimeric
multimeric / mtgjson to csv
Created September 11, 2016 13:04
Bash script to convert mtgjson's AllCards.json into a csv format
# Download the database
wget https://mtgjson.com/json/AllCards.json.zip
# Unzip it
unzip AllCards.json.zip
# Convert to CSV
jq -r 'to_entries[] | [.key, (.value | tostring ) ] | @csv' AllCards.json > AllCards.csv
# Load into postgres