The goal of this repository is to store marvelsdb card data in a format that can be easily updated by multiple people and their changes reviewed.
Steps have been verified with Python 2.7.x and 3.7.x.
The validation script requires python package jsonschema
which can be installed using pip
via pip install jsonschema
. It is recommended that you use a virtual environment, but this is strictly optional.
# use a virtual environment (optional)
virtualenv venv
source venv/bin/activate
pip install jsonschema
If you see an error like "No module named jsonschema" when running the script, you have not installed the jsonschema
package correctly.
To check the JSON files:
./validate.py
# or for more detailed output, include the --verbose flag
./validate.py --verbose
To check and apply formatting to JSON files:
./validate.py --fix_formatting
# or for more detailed output, include the --verbose flag
./validate.py --verbose --fix_formatting
"Core"
for Core Set."Core Set"
1
for Core Setnull
- this value is used when the date is unknown. Examples: "2016-10-08"
for Core Setnull
- this value is used when the pack is just an organizational entity, not a physical pack. Examples: 120
for Core Setnull
. Possible values:
null
: Shows up as dash or a star if attack_star is defined"deck_requirements": [
{
"aspects": 2
}
]
aggression
basic
campaign
encounter
hero
justice
leadership
pool
protection
packs.json
.sets.json
.null
: There is no stage for the villain or main schemeCarol Danvers
is a subname for Captain Marvel
)null
: Shows up as dash or a star if thwart_star is definedTrait1. Trait2.
types.json
):
ally
alter_ego
attachment
environment
event
hero
main_scheme
minion
obligation
resource
side_scheme
support
treachery
upgrade
villain
Full description of (very simple) JSON format can be found here, below there are a few tips most relevant to editing this repository.
When symbols outside the regular ASCII range are needed, UTF-8 symbols come in play. These need to be escaped using \u<4 letter hexcode>
.
To get the 4-letter hexcode of a UTF-8 symbol (or look up what a particular hexcode represents), you can use a UTF-8 converter, such as this online tool.
To have text spanning multiple lines, use \n
to separate them. To have quotes as part of the text, use \"
. For example, "flavor": "\"I'd run if I were you.\"\n - Scott Lang",
results in following flavor text:
"I'd run if I were you." - Scott Lang
These can be used in a card's text
section. It will get converted to the appropriate icon.
[boost]
[cost]
[energy]
[mental]
[per_hero]
[physical]
[star]
[unique]
[wild]
To merge new changes in default language in all locales, run the CoffeeScript script update_locales
.
Pre-requisites:
node
and npm
installednpm -g install coffee-script
Usage: coffee update_locales.coffee