-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcone_jour.py
36 lines (25 loc) · 903 Bytes
/
cone_jour.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from tqdm import tqdm
from pybman import utils
from pybman.rest import JournalConeController
from .utils_paths import BASE_DIR
PURE_DIR = BASE_DIR + 'pure/'
#################################
### RETRIEVE LIST OF JOURNALS ###
#################################
jour_controller = JournalConeController()
journals = jour_controller.get_entities()
utils.write_json(PURE_DIR + 'jour/all.json', journals)
################################################
### RETRIEVE INDIVIDUAL ENTRIES FOR JOURNALS ###
################################################
jour_meta = {}
for jour in journals:
idx = jour['id'].split("/")[-1]
jour_meta[idx] = jour['value']
jour_ids = list(jour_meta.keys())
# request data
jour_data = {}
for idx in tqdm(jour_ids):
jour_details = jour_controller.get_entity(idx)
jour_data[idx] = jour_details
utils.write_json(PURE_DIR + 'jour/collection.json', jour_data)