<commit_before># PokeAPI


A RESTful API for Pokemon


LICENSE: BSD

http://pokeapi.co


## DEPRECATION

Quite a lot of data is missing from the V1 API.

**As of January 2015, no new data will be added to the v1 API, you will have to use the V2 API instead. This is part of an ongoing deprecation of the v1 API.**

See [This blog post for more information](http://phalt.co/if-you-have-data-they-will-consume-it).

## Setup

- Download this source code into a working directory.

- Install the requirements using pip:
```
$ make install
```
This will install all the required packages and libraries for using PokeAPI

- Set up the local developer environment using the following command:
```
$ make setup
```
- Run the server using the following command::
```
$ make serve
```
Visit localhost:8000 to see the running website!

If you ever need to wipe the database use this command:
```
$ make wipe_db
```

## V1 Database setup

Start Django shell
```
$ python manage.py shell --settings=config.local
```
import build functions
```
$ from data.v1.build import *
```
run the functions in order to populate v1 tables
```
$ build_pokes()
$ build_abilities()
$ build moves()
etc...
```

## V2 Database setup

Start Django shell
```
$ python manage.py shell --settings=config.local
```
run the build script with
```
$ execfile('data/v2/build.py')
```
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 go into data/v2/build.py and comment out everything but what you need to build the tables you're looking for. 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.

## Contributing
<commit_msg>updated README for the new useage of the v2 build script<commit_after># PokeAPI


A RESTful API for Pokemon


LICENSE: BSD

http://pokeapi.co


## DEPRECATION

Quite a lot of data is missing from the V1 API.

**As of January 2015, no new data will be added to the v1 API, you will have to use the V2 API instead. This is part of an ongoing deprecation of the v1 API.**

See [This blog post for more information](http://phalt.co/if-you-have-data-they-will-consume-it).

## Setup

- Download this source code into a working directory.

- Install the requirements using pip:
```
$ make install
```
This will install all the required packages and libraries for using PokeAPI

- Set up the local developer environment using the following command:
```
$ make setup
```
- Run the server using the following command::
```
$ make serve
```
Visit localhost:8000 to see the running website!

If you ever need to wipe the database use this command:
```
$ make wipe_db
```

## V1 Database setup

Start Django shell
```
$ python manage.py shell --settings=config.local
```
import build functions
```
$ from data.v1.build import *
```
run the functions in order to populate v1 tables
```
$ build_pokes()
$ build_abilities()
$ build moves()
etc...
```

## V2 Database setup

Start Django shell
```
$ python manage.py shell --settings=config.local
```
run the build script with
```
$ import data.v2.build
$ data.v2.build.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.
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.

## Contributing

{'fraction_non_alphanumeric': 0.0858718487394958, 'fraction_numerical': 0.011292016806722689, 'mean_word_length': 3.9725848563968666, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6376206', 'n_tokens_mistral': 1155, 'n_tokens_neox': 1058, 'n_words': 552}