Historic information for French regions, counties, overseas collectivities and towns based on INSEE and Wikipedia data, exported as (re)usable CSV files.
If you’re only interested in generated data, check out the
exports folder which contains CSV files related to intercommunalities, regions, counties, overseas collectivities and towns. There is a dedicated documentation at these places.
Source files are coming from the INSEE downloads page which allows to retrieve information related to the “Code officiel géographique 2017”. We’re using the list of existing towns and their history which are both available within the
Additionaly, files containing the population for almost all towns has been computed too in the
sources folder. They are coming from a XLS dataset provided by INSEE, manually completed with Wikipedia data for Lyon and Marseille districts, and converted into CSV.
The project only requires click dependency (you can install it with
pip install -r requirements.txt within a virtualenv but YMMV), you have to run it with Python 3 though:
$ python -m geohisto
Note that it takes about 7 minutes to generate the towns export.
Optionally, you can specify a date to only export towns valid at that given date:
$ python -m geohisto --at-date 2016-01-01
It will be generated within the
exports/communes/ folder with an explicit name.
To also generate the intercommunalities, you need to add the
$ python -m geohisto --intercommunalities
The whole process takes about one hour and a half to generate both towns and intercommunalities exports (on a core i7 with 16Gb RAM).
You may add some extra output to see the progress by setting the verbosity to
$ python -m geohisto --intercommunalities -v debug
If you plan to contribute, you have to install pytest and launch the test suite:
$ python -m pytest tests
Note that the duration of the whole test suite run is about 5 minutes.
That's why you would probably prefer to run a particular test:
$ python -m pytest tests/test_actions.py::test_change_name
See LICENSE.md file for code and produced data.