forked from metabrainz/listenbrainz-labs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manage.py
26 lines (22 loc) · 815 Bytes
/
manage.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
import sys
import logging
from listenbrainz_spark.stats import user
from listenbrainz_spark.recommendations import create_dataframes
from listenbrainz_spark.recommendations import train_models
from listenbrainz_spark.recommendations import recommend
if __name__ == '__main__':
if len(sys.argv) != 2:
print("Usage: manage.py <module_name>")
sys.exit(-1)
# The root logger always defaults to WARNING level
# The level is changed from WARNING to INFO
logging.getLogger().setLevel(logging.INFO)
module_name = sys.argv[1]
if module_name == 'create_dataframes':
create_dataframes.main()
elif module_name == 'train_models':
train_models.main()
elif module_name == 'recommend':
recommend.main()
elif module_name == 'user':
user.main()