Skip to content

Commit bfb7061

Browse files
Compile user data into .csv, renamed demo_data.csv to demo_project_data.csv for clarity
1 parent 169b284 commit bfb7061

File tree

3 files changed

+47
-79
lines changed

3 files changed

+47
-79
lines changed
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
project_uid,title,caption,category,url,status,users,tags,featured_image
2-
ACAD_00001,OpenSUTD Web Platform,Prototype for the eventual OpenSUTD Web Platform,ACAD,https://github.com/OpenSUTD/web-platform-prototype,ACCEPT,"tom,jane","50.003,OpenSUTD,random tag,student",https://i.imgur.com/V72lqkN.png
3-
ACAD_00002,Random Project 1,A random project to better the world by design,ACAD,https://github.com/OpenSUTD/web-platform-prototype,ACCEPT,"tom,jane","50.003,random",
4-
SELF_00001,SUTD Timetable,.ics generator for SUTD Timetable,SELF,https://github.com/OpenSUTD/sutd-timetable,ACCEPT,shungit,"vue,js,student",
5-
ACAD_00003,ColourRun,50.002 Computational Structures Group 1-6 : Colour Run,ACAD,https://github.com/DoubleCapitals/CompStruct1D,ACCEPT,sikai,"mojo,student",
6-
SELF_00002,SUTDtoSimei_bot,Simple Telegram bot that checks bus timings to go to Simei from SUTD,SELF,https://github.com/benghaun/SUTDtoSimei_bot,ACCEPT,benghaun,telegram,http://sg1-cdn.pgimgs.com/listing/20213723/UPHO.76311320.V550.jpg
7-
SELF_00003,momobot,A ROS enabled autonomous ground vehicle for service!,SELF,https://github.com/OpenSUTD/momobot,ACCEPT,brandon,"robotics,student",https://raw.githubusercontent.com/OpenSUTD/momobot/master/assets/cute.png
8-
SELF_00004,machine-learning-starter-pack,Starter Pack: A collection of AI/ML courses and projects,SELF,https://github.com/OpenSUTD/machine-learning-starter-pack,ACCEPT,pengfei,"machine learning,student,education",https://media.mnn.com/assets/images/2017/09/matrix.jpg.653x0_q80_crop-smart.jpg
9-
SELF_00005,evenMoreDimension,Student-initiated Project: Make eDimension better.,SELF,https://github.com/OpenSUTD/evenMoreDimension,ACCEPT,yustynn,"tools,chrome,student",http://yustynn.tech/public/images/edim.gif
10-
SELF_00006,fifth-row-guides,"A collection of knowledge on management and maintenance processes for SUTD Fifth Rows, or any student clubs that wish to become a fifth row.",SELF,https://github.com/OpenSUTD/fifth-row-guides,ACCEPT,guian,policy,https://s3-ap-southeast-1.amazonaws.com/deeplearning-mat/SAC.jpg
11-
SELF_00007,discovery-week-working-title,Decentralised planning for the Freshmore experience,SELF,https://github.com/OpenSUTD/discovery-week-working-title,ACCEPT,qingze,policy,https://s3-ap-southeast-1.amazonaws.com/deeplearning-mat/SAC.jpg
12-
SELF_00008,community,OpenSUTD's DNA,SELF,https://github.com/OpenSUTD/community,ACCEPT,joel-huang,policy,https://s3-ap-southeast-1.amazonaws.com/deeplearning-mat/SAC.jpg
13-
SELF_00009,orientation2019,Source code for SUTD Freshmen Orientation 2019 Website and Telegram Bot @ https://orientation.sutd.edu.sg,SELF,https://github.com/OpenSUTD/orientation2019,ACCEPT,chester,"orientation,student",https://orientation.sutd.edu.sg/img/frame_1.jpg
14-
SELF_00010,SAC-student-rules,A living policy document with regards to SUTD's Student Activity Centre. Contains user instructions and processes.,SELF,https://github.com/OpenSUTD/SAC-student-rules,ACCEPT,guian,policy,https://s3-ap-southeast-1.amazonaws.com/deeplearning-mat/SAC.jpg
15-
SELF_00011,deeplearning-workshop-2019,IAP Workshop: Deep Learning,SELF,https://github.com/OpenSUTD/deeplearning-workshop-2019,ACCEPT,tlkh,"workshop,machine learning,student,education",https://s3-ap-southeast-1.amazonaws.com/deeplearning-mat/DL_IAP.jpeg
16-
ACAD_00004,Random Project 3,(Pending Approval) A random project to better the world by design,ACAD,https://github.com/OpenSUTD/web-platform-prototype,PENDING,"tom,jane","51.003,random",
17-
ACAD_00006,Random Project 5,(Pending Approval) A random project to better the world by design,ACAD,https://github.com/OpenSUTD/web-platform-prototype,PENDING,"tom,jane","53.003,random",
18-
ACAD_00008,Random Project 7,(Pending Approval) A random project to better the world by design,ACAD,https://github.com/OpenSUTD/web-platform-prototype,PENDING,"tom,jane","55.003,random",
19-
ACAD_00010,Random Project 9,(Pending Approval) A random project to better the world by design,ACAD,https://github.com/OpenSUTD/web-platform-prototype,PENDING,"tom,jane","57.003,random",
20-
SELF_00012,course-notes,Unofficial student-curated course notes,SELF,https://github.com/OpenSUTD/course-notes,ACCEPT,"tlkh,yustynn","student,education",
1+
project_uid,title,caption,category,url,status,users,tags,featured_image
2+
ACAD_00001,OpenSUTD Web Platform,Prototype for the eventual OpenSUTD Web Platform,ACAD,https://github.com/OpenSUTD/web-platform-prototype,ACCEPT,"tom,jane","50.003,OpenSUTD,random tag,student",https://i.imgur.com/V72lqkN.png
3+
ACAD_00002,Random Project 1,A random project to better the world by design,ACAD,https://github.com/OpenSUTD/web-platform-prototype,ACCEPT,"tom,jane","50.003,random",
4+
SELF_00001,SUTD Timetable,.ics generator for SUTD Timetable,SELF,https://github.com/OpenSUTD/sutd-timetable,ACCEPT,shungit,"vue,js,student",
5+
ACAD_00003,ColourRun,50.002 Computational Structures Group 1-6 : Colour Run,ACAD,https://github.com/DoubleCapitals/CompStruct1D,ACCEPT,sikai,"mojo,student",
6+
SELF_00002,SUTDtoSimei_bot,Simple Telegram bot that checks bus timings to go to Simei from SUTD,SELF,https://github.com/benghaun/SUTDtoSimei_bot,ACCEPT,benghaun,telegram,http://sg1-cdn.pgimgs.com/listing/20213723/UPHO.76311320.V550.jpg
7+
SELF_00003,momobot,A ROS enabled autonomous ground vehicle for service!,SELF,https://github.com/OpenSUTD/momobot,ACCEPT,brandon,"robotics,student",https://raw.githubusercontent.com/OpenSUTD/momobot/master/assets/cute.png
8+
SELF_00004,machine-learning-starter-pack,Starter Pack: A collection of AI/ML courses and projects,SELF,https://github.com/OpenSUTD/machine-learning-starter-pack,ACCEPT,pengfei,"machine learning,student,education",https://media.mnn.com/assets/images/2017/09/matrix.jpg.653x0_q80_crop-smart.jpg
9+
SELF_00005,evenMoreDimension,Student-initiated Project: Make eDimension better.,SELF,https://github.com/OpenSUTD/evenMoreDimension,ACCEPT,yustynn,"tools,chrome,student",http://yustynn.tech/public/images/edim.gif
10+
SELF_00006,fifth-row-guides,"A collection of knowledge on management and maintenance processes for SUTD Fifth Rows, or any student clubs that wish to become a fifth row.",SELF,https://github.com/OpenSUTD/fifth-row-guides,ACCEPT,guian,policy,https://s3-ap-southeast-1.amazonaws.com/deeplearning-mat/SAC.jpg
11+
SELF_00007,discovery-week-working-title,Decentralised planning for the Freshmore experience,SELF,https://github.com/OpenSUTD/discovery-week-working-title,ACCEPT,qingze,policy,https://s3-ap-southeast-1.amazonaws.com/deeplearning-mat/SAC.jpg
12+
SELF_00008,community,OpenSUTD's DNA,SELF,https://github.com/OpenSUTD/community,ACCEPT,joel-huang,policy,https://s3-ap-southeast-1.amazonaws.com/deeplearning-mat/SAC.jpg
13+
SELF_00009,orientation2019,Source code for SUTD Freshmen Orientation 2019 Website and Telegram Bot @ https://orientation.sutd.edu.sg,SELF,https://github.com/OpenSUTD/orientation2019,ACCEPT,chester,"orientation,student",https://orientation.sutd.edu.sg/img/frame_1.jpg
14+
SELF_00010,SAC-student-rules,A living policy document with regards to SUTD's Student Activity Centre. Contains user instructions and processes.,SELF,https://github.com/OpenSUTD/SAC-student-rules,ACCEPT,guian,policy,https://s3-ap-southeast-1.amazonaws.com/deeplearning-mat/SAC.jpg
15+
SELF_00011,deeplearning-workshop-2019,IAP Workshop: Deep Learning,SELF,https://github.com/OpenSUTD/deeplearning-workshop-2019,ACCEPT,tlkh,"workshop,machine learning,student,education",https://s3-ap-southeast-1.amazonaws.com/deeplearning-mat/DL_IAP.jpeg
16+
ACAD_00004,Random Project 3,(Pending Approval) A random project to better the world by design,ACAD,https://github.com/OpenSUTD/web-platform-prototype,PENDING,"tom,jane","51.003,random",
17+
ACAD_00006,Random Project 5,(Pending Approval) A random project to better the world by design,ACAD,https://github.com/OpenSUTD/web-platform-prototype,PENDING,"tom,jane","53.003,random",
18+
ACAD_00008,Random Project 7,(Pending Approval) A random project to better the world by design,ACAD,https://github.com/OpenSUTD/web-platform-prototype,PENDING,"tom,jane","55.003,random",
19+
ACAD_00010,Random Project 9,(Pending Approval) A random project to better the world by design,ACAD,https://github.com/OpenSUTD/web-platform-prototype,PENDING,"tom,jane","57.003,random",
20+
SELF_00012,course-notes,Unofficial student-curated course notes,SELF,https://github.com/OpenSUTD/course-notes,ACCEPT,"tlkh,yustynn","student,education",

demo_user_data.csv

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
user_id,display_name,display_picture,graduation_year,pillar
2+
tom,Tom Magnanti,https://via.placeholder.com/150,2019,EPD
3+
jane,Jane Tan,https://via.placeholder.com/150,2020,ESD
4+
harry,Harry Potter,https://via.placeholder.com/150,2021,EPD
5+
shungit,Shun Git,https://via.placeholder.com/150,2018,ISTD
6+
tlkh,Timothy Liu,https://via.placeholder.com/150,2020,ISTD
7+
bob,Bob David,https://via.placeholder.com/150,2019,ASD
8+
sikai,Ning Si Kai,https://via.placeholder.com/150,2020,ISTD
9+
benghaun,Ang Beng Haun,https://via.placeholder.com/150,2019,ISTD
10+
brandon,Brandon Ong,https://via.placeholder.com/150,2021,EPD
11+
pengfei,Hong Peng Fei,https://via.placeholder.com/150,2020,ISTD
12+
yustynn,Yustynn,https://via.placeholder.com/150,2019,ESD
13+
guian,Lee Gui An,https://via.placeholder.com/150,2020,ISTD
14+
qingze,Hum Qing Ze,https://via.placeholder.com/150,2020,ESD
15+
joel-huang,Joel Huang,https://via.placeholder.com/150,2019,ISTD
16+
chester,Chester,https://via.placeholder.com/150,2020,ISTD

populate_db.py

Lines changed: 11 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -19,69 +19,21 @@
1919

2020
# create users
2121

22-
um.create_user("tom", display_name="Tom Magnanti",
23-
display_picture="https://via.placeholder.com/150",
24-
graduation_year=2019, pillar="EPD")
25-
26-
um.create_user("jane", display_name="Jane Tan",
27-
display_picture="https://via.placeholder.com/150",
28-
graduation_year=2020, pillar="ESD")
29-
30-
um.create_user("harry", display_name="Harry Potter",
31-
display_picture="https://via.placeholder.com/150",
32-
graduation_year=2021, pillar="EPD")
33-
34-
um.create_user("shungit", display_name="Shun Git",
35-
display_picture="https://via.placeholder.com/150",
36-
graduation_year=2018, pillar="ISTD")
37-
38-
um.create_user("tlkh", display_name="Timothy Liu",
39-
display_picture="https://via.placeholder.com/150",
40-
graduation_year=2020, pillar="ISTD")
41-
42-
um.create_user("bob", display_name="Bob David",
43-
display_picture="https://via.placeholder.com/150",
44-
graduation_year=2019, pillar="ASD")
45-
46-
um.create_user("sikai", display_name="Ning Si Kai",
47-
display_picture="https://via.placeholder.com/150",
48-
graduation_year=2020, pillar="ISTD")
49-
50-
um.create_user("benghaun", display_name="Ang Beng Haun",
51-
display_picture="https://via.placeholder.com/150",
52-
graduation_year=2019, pillar="ISTD")
53-
54-
um.create_user("brandon", display_name="Brandon Ong",
55-
display_picture="https://via.placeholder.com/150",
56-
graduation_year=2021, pillar="EPD")
57-
58-
um.create_user("pengfei", display_name="Hong Peng Fei",
59-
display_picture="https://via.placeholder.com/150",
60-
graduation_year=2020, pillar="ISTD")
61-
62-
um.create_user("yustynn", display_name="Yustynn",
63-
display_picture="https://via.placeholder.com/150",
64-
graduation_year=2019, pillar="ESD")
65-
66-
um.create_user("guian", display_name="Lee Gui An",
67-
display_picture="https://via.placeholder.com/150",
68-
graduation_year=2020, pillar="ISTD")
69-
70-
um.create_user("qingze", display_name="Hum Qing Ze",
71-
display_picture="https://via.placeholder.com/150",
72-
graduation_year=2020, pillar="ESD")
73-
74-
um.create_user("joel-huang", display_name="Joel Huang",
75-
display_picture="https://via.placeholder.com/150",
76-
graduation_year=2019, pillar="ISTD")
22+
with open("demo_user_data.csv") as csvfile:
23+
reader = csv.reader(csvfile)
24+
next(reader, None)
25+
for row in reader:
26+
[user_id, display_name, display_picture, graduation_year, pillar] = row
27+
print(row)
7728

78-
um.create_user("chester", display_name="Chester",
79-
display_picture="https://via.placeholder.com/150",
80-
graduation_year=2020, pillar="ISTD")
29+
um.create_user(user_id.lower().strip(), display_name=display_name.strip(),
30+
display_picture=display_picture.strip(),
31+
graduation_year=graduation_year,
32+
pillar=pillar)
8133

8234
pm = OpenSUTDProjectManager()
8335

84-
with open("demo_data.csv") as csvfile:
36+
with open("demo_project_data.csv") as csvfile:
8537
reader = csv.reader(csvfile)
8638
next(reader, None)
8739
for row in reader:

0 commit comments

Comments
 (0)