Removed conditions from filter_colleges(), do all in one using get_colleges().
Stored metadata of CollegeAPI in API_METADATA.
removed unnecessary dependencies.
filters.py
Different field colleges / universities in 1 function named get_colleges().
Replaced processing() with fetch_details() which generates the data, works more efficiently.
Stored path of data folder in DATA_PATH.
Stored fields mapped to their respective json files in FIELD_FILES.
Added $2$ custom Exceptions inherited from ValueError
class InvalidFieldPassedError(ValueError):
"""
Exception class to raise if invalid field passed.
"""
class InvalidRegionPassedError(ValueError):
"""
Exception class to raise if invalid field passed.
"""
Added check_values() function, which checks and raises above exceptions if data provided doesn't matched.
data directory
Fixed cases of object parameters (city, state) of some files.
Issue Ticket Number
Fixes **Refactor the codebase #171
Type of change
[x] Refactored code
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update
Checklist:
[x] Remove unnecessary dependencies.
[x] Use/create functions to use reduce the repetition of code.
[x] I have followed the contributing guidelines of this project as mentioned in CONTRIBUTING.md
[x] I have checked to ensure there aren't other open Pull Requests for the same update/change?
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes needed to the documentation
Description
main.py
filter_colleges()
, do all in one usingget_colleges()
.API_METADATA
.filters.py
get_colleges()
.processing()
withfetch_details()
which generates the data, works more efficiently.DATA_PATH
.FIELD_FILES
.ValueError
check_values()
function, which checks and raises above exceptions if data provided doesn't matched.data
directoryIssue Ticket Number
Fixes **Refactor the codebase #171
Type of change
Checklist: