Closed tshrv closed 3 years ago
If you could contrast this with PR #15 and PR #17, would be great.
Sure @DragonWarrior15,
The following are the features present in PR #25 in contrast with PR #15 and PR #17 -
cowin_api.constants.py
cowin_api.constants.py
cowin_api.utils.py
Missing features:
Instead of putting filters in a dictionary, putting them as the arguments will make it more editor friendly and will have less scope of human error.
Not sure how this works. Dictionary is also a well formatted structure in any editor.
Filter Vaccine is an Enum. Editor friendly and reduce chances of human error. cowin_api.constants.py Isn't this tedious than simply passing a string as input ? I understand that you are trying to avoid spelling mistakes here.
Further, you maybe limited to what vaccines are put in the Enum
, and the API will keep evolving as more and more vaccines are being brought in.
Since there are limited number of parameters based on which we might need to filter (currently min_age_limit, vaccine, dose), it is better to have a simpler filter mechanism even if it involves explicitly checking for multiple filters. cowin_api.utils.py
You never know how this will keep growing, so your explicit filtering will require multiple modifications to the code as it evolves. I mean both arguments are kind of right here I guess.
Filter Fees
This can be easily added in the dictionary. The core user functions that take arguments are simply there for compatibility with older versions of the API.
Sure, You're right. It's already great.
Hey, you can keep the PR open, this merged with PR #17 will probably be useful. Not sure why you closed it.
I've added two more filters:
(covaxin/covishield)
(first/second)
Updated filter function mechanism to accommodate multiple filters with a dry approach. Updated param typo
min_age_limt -> min_age_limit