Add endpoint to store scraped courses #47
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's New?
save_courses
API accepts a JSON object containing a list of all scraped courses (request.form
did not play nicely with lists)courseId
is now a string to uniquely identify each course (e.g.CSC 101
)validate_input_keys()
pulled out to its own function to be reusedFixes #46
Type of change (pick-one)
How Has This Been Tested?
Integration test with course scraper stores all scraped courses in local
MySQL
instance.Steps
MySQL
https://github.com/calpoly-csai/csai-scraping
flask_api.py
inapi
packagesustainer.py
incsai-scraping
package (optionally comment out other scrapers if you do not want them to run) (branch with updatedcsai-scraping
)Checklist (check-all-before-merge)
formatting help:
- [x]
means "checked' and- [ ]
means "unchecked"I documented my code according to the Google Python Style Guide
I ran
./build_docs.sh
and the docs look fineI ran
./type_check.sh
and got no errorsI ran
./format.sh
because it automatically cleans my code for me 😄I ran
./lint.sh
to check for what "format" missedI added my tests to the
/tests
directoryI ran
./run_tests.sh
and all the tests pass