Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Commit

Permalink
uploaded Spring 2019 data
Browse files Browse the repository at this point in the history
  • Loading branch information
shannenigans committed Jul 16, 2019
1 parent 3a3316a commit 7f917b3
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 140 deletions.
4 changes: 2 additions & 2 deletions converter/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ def main():

df = pd.read_excel(filename)
df = df.rename(index=str, columns={'Subject': 'subj', 'Catalog Number': 'num', 'Section': 'sect', 'Instructor 1': 'prof'})
df = df.drop(columns=['Instructor 2', 'Instructor 3', 'Instructor 4', 'Instructor 5', 'Instructor 6'])

df = df.drop(columns=['Instructor 2', 'Instructor 3', 'Instructor 4', 'Instructor 5', 'Instructor 6'], axis=1)
records = df.to_dict('records')
processed_records = nest_grades(records)

output_filename = os.path.join(dirname, 'output/output.json')

with open(output_filename, 'w+', encoding='utf-8') as outfile:
with open(output_filename, 'w+') as outfile:
json.dump(processed_records, outfile)

def nest_grades(records):
Expand Down
1 change: 1 addition & 0 deletions loader/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ node_modules
.lock-wscript

# IDEs and editors (shamelessly copied from @angular/cli's .gitignore)
.idea
/.idea
.project
.classpath
Expand Down
2 changes: 1 addition & 1 deletion loader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ async function run() {
try {
const sequelize = init();

let content = JSON.parse(fs.readFileSync('data/fall2018.json', 'utf8'));
let content = JSON.parse(fs.readFileSync('data/spring2019.json', 'utf8'));

const models = sequelize.models;

Expand Down
212 changes: 76 additions & 136 deletions loader/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dotenv": "^6.0.0",
"pg": "^7.5.0",
"progress": "^2.0.0",
"sequelize": "^4.39.0"
"sequelize": "^6.0.0"
},
"devDependencies": {},
"scripts": {
Expand Down

0 comments on commit 7f917b3

Please sign in to comment.