-
Notifications
You must be signed in to change notification settings - Fork 637
Getting Data
If you're like most people, you just want to get a hold of the data for your own nefarious purposes. Lucky for you, I have made this as simple as I can imagine. As long as you know your way around a terminal, anyway. You do, right?
For more exhaustive documentation on using the pokedex program, see CLI.
You have two options here.
You can use Git, like I do, if you're familiar with source control:
git clone git://git.veekun.com/pokedex.git
Or you can just go to the Downloads tab on Github and use one of the Download buttons to get a recent copy.
You have to do this for two reasons: (a) to make sure you have all the right libraries installed, and (b) to create the pokedex
program, which actually loads the data into a database for you.
Generally you can do this with:
python setup.py develop
You might have to invoke sudo
if you're on a good platform, because this will install necessary libraries to your system Python directory.
If you'd rather not do that (good for you!), you should instead:
- Get virtualenv. It's in most repositores as
python-virtualenv
, or you can usepip install virtualenv
, or get it manually if you must. - Create a virtualenv for the
pokedex
project by runningvirtualenv some_directory_name
. This will make a directory with a little Python environment inside it. - Move the
pokedex
project into your shiny new virtualenv. - Run
bin/python setup.py develop
. Make sure you run thebin/python
inside your virtualenv. This will install libraries and the pokedex program only inside the virtualenv and will not touch your system Python. Note that the pokedex program will then end up inside that samebin/
directory.
A lot of people come ask for help, only to realize they sort of forgot this bit. Here's a quick checklist:
- Be sure you know which database engine you're using!
- Be sure you've actually created the database!
- Be sure you have Python support for it installed! Out of the box, Python ONLY supports SQLite! For PostgreSQL, you'll need
psycopg2
; for MySQL, you'll needmysqldb
.
pokedex load -e postgresql://username:password@localhost/database
Or, you know, something like that. This will churn away for a while (a pretty lonw while, actually). When it's done, you should have a database full of data. Congrats!
For more stuff you can do with the pokedex program, and better instructions on how to use load
, see the pokedex documentation.