Opentrain repository for community data analysis of Israel Railways train delay data.
Python HTML JavaScript Jupyter Notebook CSS ApacheConf Other
Latest commit 09fc342 Jan 23, 2017 @ekeydar ekeydar fix
Permalink
Failed to load latest commit information.
depr cleanup git Dec 22, 2015
docs Update visual_data_views.rst Dec 12, 2016
simple Analysis script update Sep 19, 2016
train2 fix Jan 23, 2017
.gitignore train2 Feb 22, 2016
README.md Update README.md Apr 4, 2016

README.md

Online Project Documentation

Interactive documentation is available at http://opentraincommunity.readthedocs.org/en/latest/

Developer Environment Setup

The project runs on Python 3 with POSTGRES, and we recommend using a virtual environment for development. You can use the following command to setup a virtualenv called opentrain:

mkvirtualenv -p $(which python3) opentrain

You might need to first install the virtualenv package, via:

sudo pip install virtualenv

Then activate the environment:

cd opentrain
source bin/activate

Then install all of the required modules into your virtualenv using pip:

cd OpenTrainCommunity/train2
pip install -r requirements.txt
sudo apt-get install postgresql libpq-dev

Database setup and import

Best way to start is to download the POSTGRES dump file.

  1. Download the latest sql dump from http://otrain.org/files/dumps/ (you can download the gz file)
python restore.py <name-of-sql-file>

Note that the script will gunzip the file. You might need to run,

pip install argparse

In case you have already set a postgres user name, you could face:

ERROR:  role "postgres" does not exist

In this case, create a user name postgres before running the script.

On mac platform you might also have to change l29 in clean_all.py to

postgres_cmd = "sudo -u your_macuser psql"

Now you can start the server.

python manage.py runserver