Skip to content
Snippets Groups Projects
Commit 91e324f2 authored by Constance de Quatrebarbes's avatar Constance de Quatrebarbes
Browse files

Init Fetcher: to_dbnomics

parent 5b98cfc5
No related branches found
No related tags found
1 merge request!1Implement download script and more
#!/usr/bin/env python3
# dares-fetcher -- Fetch series from DARES
# By Constance de Quatrebarbes <constance.de.quatrebarbes@cepremap.org>
# Copyright (C) 2017 Cepremap
# https://git.nomics.world/dbnomics-fetchers/dares-fetcher
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http:>www.gnu.org/licenses/>.
"""DARES Fetcher.
Usage:
dares_to_dbnomics.py <source_dir> <target_dir> [--init] [--push]
dares_to_dbnomics.py (-h | --help)
dares_to_dbnomics.py --version
"""
SOURCE_EXCEL_FILES = [
{ "page_slug": 'l-activite-partielle',
"file_nb": 1},
{ "page_slug":'les-demandeurs-d-emploi-inscrits-a-pole-emploi-les-series-mensuelles-nationales',
"file_nb": 3},
{ "page_slug":'les-demandeurs-d-emploi-inscrits-a-pole-emploi-les-series-mensuelles-regionales',
"file_nb": 3},
{ "page_slug":'la-duree-collective-hebdomadaire',
"file_nb": 2},
{
"page_slug":'la-duree-individuelle-du-travail',
"file_nb": 1},
{
"page_slug":'l-emploi-salarie',
"file_nb": 1},
{
"page_slug":'les-emplois-vacants',
"file_nb": 1},
{
"page_slug":'l-emploi-interimaire',
"file_nb": 3},
{
"page_slug":'les-journees-individuelles-non-travaillees-jint',
"file_nb": 1},
{
"page_slug":'les-heures-supplementaires',
"file_nb": 1},
{ "page_slug":'les-heures-supplementaires-remunerees',
"file_nb": 1},
{ "page_slug":'les-offres-collectees-et-satisfaites-par-pole-emploi-les-series-mensuelles',
"file_nb": 1},
{ "page_slug": "la-participation-l-interessement-et-l-epargne-salariale",
"file_nb": 1},
{ "page_slug": "les-ruptures-conventionnelles",
"file_nb": 2},
{ "page_slug": "les-indices-de-salaire-de-base",
"file_nb": 2},
{ "page_slug": "donnees-statistiques-les-sortants-des-listes-de-demandeurs-d-emploi-inscrits-a",
"file_nb": 2},
{ "page_slug": "le-temps-partiel",
"file_nb": 1},
{ "page_slug": "les-tensions-sur-le-marche-du-travail-par-metier",
"file_nb": 2},
]
PROVIDER = {
"long_name": "Direction de l'Animation de la Recherche des Etudes et des Statistiques",
"name": "DARES",
"region": "France",
"slug": "dares",
"terms_of_use": "http://dares.travail-emploi.gouv.fr/dares-etudes-et-statistiques/article/mentions-legales",
"website": "http://dares.travail-emploi.gouv.fr/",
# we consider a categorie is the slug of a section in SOURCE_EXCEL_FILES
"categories":[
{
"name":n["page_slug"].replace("-", " "),
"category_code":n["page_slug"],
"datasets": []
} for n in SOURCE_EXCEL_FILE ]
}
for excel_f in os.list_dir(args["<source_dir>"]):
print(excel_f)
excel_file_path = os.path.join(args["source_dir"], EXCEL_FILE_NAME)
book = xlrd.open_workbook(excel_file_path)
if __name__ =="__main__":
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment