Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dares-fetcher
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dbnomics-fetchers
dares-fetcher
Commits
91e324f2
Commit
91e324f2
authored
7 years ago
by
Constance de Quatrebarbes
Browse files
Options
Downloads
Patches
Plain Diff
Init Fetcher: to_dbnomics
parent
5b98cfc5
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
Implement download script and more
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dares_to_dbnomics.py
+98
-0
98 additions, 0 deletions
dares_to_dbnomics.py
with
98 additions
and
0 deletions
dares_to_dbnomics.py
0 → 100644
+
98
−
0
View file @
91e324f2
#!/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__
"
:
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment