forked from bayesimpact/python-emploi-store
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcsv_example.py
More file actions
24 lines (18 loc) · 722 Bytes
/
csv_example.py
File metadata and controls
24 lines (18 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# encoding: utf-8
"""An example script to use emploi_store library.
This downloads a resource from the API as a CSV.
To run it, you will need to set your environment variable:
EMPLOI_STORE_CLIENT_ID and EMPLOI_STORE_CLIENT_SECRET.
See documentation about accessing the REST API at
https://www.emploi-store-dev.fr/portail-developpeur/donneesdoctechnique
"""
import emploi_store
def main():
"""Download the "Référentiel des familles de métier" from the API."""
client = emploi_store.Client()
bmo_package = client.get_package('bmo')
fap_ref = bmo_package.get_resource(
name=u'Référentiel des familles de métier')
fap_ref.to_csv('ref_fap.csv')
if __name__ == '__main__':
main()