Improve API responses and marshal scraper data#80
Improve API responses and marshal scraper data#80madhavarshney wants to merge 6 commits intomasterfrom
Conversation
de56ee3 to
76ee60b
Compare
4fdab20 to
a4aaa3f
Compare
2d2a6f2 to
c02ad04
Compare
| @@ -0,0 +1,35 @@ | |||
| from marshmallow import Schema, fields, validate, EXCLUDE | |||
|
|
|||
| class ClassDataSchema(Schema): | |||
There was a problem hiding this comment.
TODO:
- Add descriptions
- Update docs
| data[f'{dept}'].append({k: generate_url(dept, k) for k in keys}) | ||
|
|
||
| return jsonify(data), 200 | ||
| return jsonify({k: {kk: vv for d in v for kk, vv in d.items()} for k, v in data.items()}), 200 |
There was a problem hiding this comment.
ah yes one liners :D
love em and hate em at the same time
There was a problem hiding this comment.
To be honest, I can never really understand Python one-liners (though I half-wrote this, half SO'd it).. maybe I just need more experience with them. =P
|
Just a note. We might want to just build a schedule maker as part of the API. Like requesting courses and getting a generated list of all possible schedules possible as a response |
|
@phi-line Possibly. For this PR, take a look at my comment on key names above. What do you think about those? Additionally, although this is trivial, should the "times" array be called |
c02ad04 to
a9aff8e
Compare
a9aff8e to
199719b
Compare
199719b to
c231a58
Compare
- Change course model structure - Properly marshal data (str -> int)
- Add documention to course model - Rename and improve some course keys
c231a58 to
9319439
Compare
9319439 to
20f0d2b
Compare
|
This will no longer be merged because of its significant number of breaking changes. They have been included in the new OpenCourseAPI. |
Key Changes:
owl_models.py.[ {}, {} ]- to an object with atimearray -{ time: [] }.unitsis now automatically converted from astringto adouble. This is done through marshmallow.Future TODOs: