mapillary / mapillary-python-sdk

A Python 3 library built on the Mapillary API v4 to facilitate retrieving and working with Mapillary data.
MIT License
39 stars 15 forks source link

[Feature] Print supported filter types to users #48

Open OmarMuhammedAli opened 3 years ago

OmarMuhammedAli commented 3 years ago

Is your feature request related to a problem? Please describe. A user may enter an unsupported filter when querying the SDK. Instead of just throwing an error, a list of supported filters should be logged to the user.

Describe the solution you'd like A function that raises an exception in case of a wrong filter entry and prints out a list of supported filters by the Mapillary API v4

Describe alternatives you've considered Instead of logging the whole list of supported filters, the function can print out a list of close matches to the user's input filter.

Rubix982 commented 3 years ago

"...prints out a list of supported filters by the Mapillary API v4"

By this, do you mean that a high-level filter function should return a list of possible filters?

"... close matches to the user's input filter."

We can use the Levenshtein edit distance algorithm!

cbeddow commented 3 years ago

Using close matches/Levenshtein for this would be outstanding, far beyond what I think a typical open source library might do in an early stage! Most probably would just return "check filter and try again" with no other info. Having the suggestions would be a great way to keep users focused and help them make quick fixes. Cool idea.

Rubix982 commented 3 years ago

Yes! Finally, my knowledge about data structures and algorithms pays off! :D