IRIS Insee Geolocalizer
IRIS are specific codes and data related to more than 50,000 districts, built by the National Institute of Statistics and Economic Studies.
Some Insee stats for each IRIS, census 2013: population (by sex and age), employment and housing.
REST API documentation
For instance, you can:
URL/iris/0104?limit=5to the some information about a specific IRIS code
URL/search/q=place de la bourse Bordeauxto get the IRIS data from a specific address
You have to install postgreSQL and PostGIS. For Debian:
sudo apt-get install postgresql postgis
You have to be a PostgreSQL superuser to create the postgis extension for your database. If it's not the case, you can do:
su - postgres
psql pyris -c "CREATE EXTENSION postgis;"
All usefull scripts are in the scripts-data folder. Two steps:
- Download and some data processing for IGN and Insee data. Take a look to the Makefile in scripts-data.
- Then load data into your database thanks to the Python script loader.py.
To summarize, in a dedicated virtualenv, do:
- Go to scripts-data
- Run make all
- Run python loader.py ./data
For Python dependencies which help you to process data, take a look to the scripts-data/requirements.txt file.
You also have a configuration file example at scripts-data/settings.ini.sample.
Launch the Web App
bower install (just a Bootstrap and jQuery).
> gunicorn -b 127.0.0.1:5555 pyris.api.run:app or
> gunicorn -b 127.0.0.1:5555 --env PYRIS_APP_SETTINGS=./appdev.yml pyris.api.run:app
if you have to specify db credentials or logging Flask app
See an example of a app.yml file
- flask restplus