mirror of
https://github.com/PokeAPI/pokeapi
synced 2024-11-22 19:33:10 +00:00
a few doc changes
This commit is contained in:
parent
b5981d70ff
commit
b58a5b76c3
2 changed files with 43 additions and 7 deletions
42
README.md
42
README.md
|
@ -59,6 +59,33 @@ $ build_abilities()
|
||||||
$ build moves()
|
$ build moves()
|
||||||
etc...
|
etc...
|
||||||
```
|
```
|
||||||
|
Heres a list of the data building functions
|
||||||
|
- build_languages()
|
||||||
|
- build_regions()
|
||||||
|
- build_generations()
|
||||||
|
- build_versions()
|
||||||
|
- build_stats()
|
||||||
|
- build_damage_classes()
|
||||||
|
- build_abilities()
|
||||||
|
- build_characteristics()
|
||||||
|
- build_egg_groups()
|
||||||
|
- build_growth_rates()
|
||||||
|
- build_items()
|
||||||
|
- build_types()
|
||||||
|
- build_contests()
|
||||||
|
- build_moves()
|
||||||
|
- build_berries()
|
||||||
|
- build_natures()
|
||||||
|
- build_genders()
|
||||||
|
- build_experiences()
|
||||||
|
- build_machines()
|
||||||
|
- build_evolutions()
|
||||||
|
- build_pokedexes()
|
||||||
|
- build_locations()
|
||||||
|
- build_pokemons()
|
||||||
|
- build_encounters()
|
||||||
|
- build_pal_parks()
|
||||||
|
|
||||||
|
|
||||||
## V2 Database setup
|
## V2 Database setup
|
||||||
|
|
||||||
|
@ -66,13 +93,22 @@ Start Django shell
|
||||||
```
|
```
|
||||||
$ python manage.py shell --settings=config.local
|
$ python manage.py shell --settings=config.local
|
||||||
```
|
```
|
||||||
|
|
||||||
run the build script with
|
run the build script with
|
||||||
```
|
```
|
||||||
$ import data.v2.build
|
$ from data.v2.build import *
|
||||||
$ data.v2.build.build_all()
|
$ build_all()
|
||||||
```
|
```
|
||||||
Each time the build script is run it will iterate over each table in the database, wipe it and rewrite each row using the data found in data/v2/csv.
|
Each time the build script is run it will iterate over each table in the database, wipe it and rewrite each row using the data found in data/v2/csv.
|
||||||
If you don't need all of the data just run the functions of the modelgroups you want. For now there are only functions for groups of models if you want to build only some models you have to comment out everything you don't want in the functions you want to run. This might be useful because some of the csv files are massive (pokemon_moves expecially) and it can take about 30 minutes to build everything.
|
When building against sqlite we've heard it can take a ridiculously long time to finish building out the database. In this case you can set up just the portions of the db that you need.
|
||||||
|
```
|
||||||
|
$ from data.v2.build import *
|
||||||
|
$ build_languages()
|
||||||
|
$ build_abilities()
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
Here
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
#
|
#
|
||||||
# and run the build script with
|
# and run the build script with
|
||||||
#
|
#
|
||||||
# $ execfile('data/v2/build.py')
|
# $ from data.v2.build import *
|
||||||
|
# $ build_all
|
||||||
#
|
#
|
||||||
# Each time the build script is run it will iterate over each table in the database,
|
# Each time the build script is run it will iterate over each table in the database,
|
||||||
# wipe it and rewrite each row using the data found in data/v2/csv.
|
# wipe it and rewrite each row using the data found in data/v2/csv.
|
||||||
# If you don't need all of the data just go into data/v2/build.py and
|
# If you don't need all of the data just go into data/v2/build.py and
|
||||||
# comment out everything but what you need to build the tables you're looking for.
|
# just call one of the build functions found in this script
|
||||||
# This might be useful because some of the csv files are massive
|
|
||||||
# (pokemon_moves expecially) and it can take about 30 minutes to build everything.
|
|
||||||
|
|
||||||
# support python3
|
# support python3
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
Loading…
Reference in a new issue