wild APIs at

insee, API
pip install irenee==2.0


irenee : wild APIs from insee website

turns online services into nice and handy APIs !

irenee depends on the following modules:

  • requests
  • bs4 (BeautifulSoup)
  • docopt
  • pandas

Consider using Grohlke repos for easy install windows binaries (


$ pip install irenee

irenee.catfish: get category from siren ID

catfish submodule uses to retrieve information on companies identified by siren ID (for definitions:


$ from irenee import catfish

get data for a single siren ID

$ catfish.get('666999666')

compute a list of sirens

$ sirens = [
$ res = [catfish.get(siren) for sire in sirens]

compute a xlsx file containing sirens (colA)

$ catfish.batch('in.xlsx', 'out.xlsx)

irenee.cog: get cog changelogs

COG = "Code Officiel Geographique"

cog submodule uses to retrieve COG changelog cog has one method: get(start, end, deplist=['00'], modlist=['M0'], xlsx=None) which returns a pandas.DataFrame. cog also can export to xlsx.



$ from irenee import cog

time interval

get changelogs for all municipalities between 2000 and 2015

$ log = cog.get('2000', '2015')


Departements are queried as a list of dep codes : get changelogs between 2000 and 2015 for a list of departements:

$ deps = [
$ log = cog.get('2000', '2015', deplist=deps)

modifications types

List of modtypes:

  • MA: Changement de nom
  • MB: Création / rétablissement
  • MC: Modification cantonale
  • MD: Changement de dep. / d'arrond.
  • ME: Suppression / fusion
  • MF: Transfert de chef-lieu
  • MG: Echange de parcelles

Modifications are queried as a list of modtypes : get changelogs between 2000 and 2015 for a list of modtypes:

$ mods = [
$ cog.get('2000', '2015', modlist=mods)

export to xlsx

cog will export to xlsx if path is provided:

$ cog.get('2000', '2015', xlsx='/path/to/file.xlsx')