-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdump.py
38 lines (30 loc) · 1.05 KB
/
dump.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
37
38
import os
import datetime
import biothings, config
biothings.config_for_app(config)
from config import DATA_ARCHIVE_ROOT
import biothings.hub.dataload.dumper
class BiorxivDumper(biothings.hub.dataload.dumper.DummyDumper):
SRC_NAME = "biorxiv"
__metadata__ = {
"src_meta": {
"author":{
"name": "Marco Cano",
"url": "https://github.com/marcodarko"
},
"code":{
"branch": "master",
"repo": "https://github.com/outbreak-info/biorxiv.git"
},
"url": "https://api.biorxiv.org/covid19/help",
"license": "https://www.biorxiv.org/about-biorxiv"
}
}
# override in subclass accordingly
SRC_ROOT_FOLDER = os.path.join(DATA_ARCHIVE_ROOT, SRC_NAME)
SCHEDULE = "15 7 * * *" # daily at 7:15PT
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.set_release()
def set_release(self):
self.release = datetime.datetime.now().strftime('%Y-%m-%d-%H:%M')