-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain_sql.py
More file actions
40 lines (36 loc) · 1.35 KB
/
main_sql.py
File metadata and controls
40 lines (36 loc) · 1.35 KB
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
39
40
'''The entry point to start the sql2mongo processor
'''
import sys
from datetime import datetime
from mathematician.pipe import PipeLine
import mathematician.config as config
from mathematician.Processor.Sql2MongoProcessor import (course,
db,
enrollment,
forum,
grade,
log,
user,
video)
def main():
'''The entry function
'''
if len(sys.argv) >= 2:
config.init_config(sys.argv[1])
else:
config.init_config('./config.json')
pipeline = PipeLine()
pipeline.input_files([]) \
.pipe(course.CourseProcessor()) \
.pipe(video.VideoProcessor()) \
.pipe(enrollment.EnrollmentProcessor()) \
.pipe(log.LogProcessor()) \
.pipe(user.UserProcessor()) \
.pipe(forum.ForumProcessor()) \
.pipe(grade.GradeProcessor()) \
.pipe(db.DBProcessor())
start_time = datetime.now()
pipeline.execute()
print('spend time:' + str(datetime.now() - start_time))
if __name__ == "__main__":
main()