Closed aldimhr closed 6 months ago
Sorry for such a late reply! I do like the idea of these search functions, but I think these search features will be quite slow, especially considering how large the list of currencies have become (when you wrote this PR the list was around 4,000 currencies, but now the list is well over 12,000 currencies). So I think I would reverse the search logic to not try to lowercase the key and search through all possible keys, and instead, convert the search string to uppercase and return the key with that value, if it exists, removing the need to loop through all the currencies to find the right one.
Search through the labels is a different problem, your solution will short circuit on the first item it finds and requires exact strings, which is a big limitation. So before we consider adding in a search feature, I think we would need to discuss exactly what that feature should consist of.
With all that said, this library is not getting maintained that frequently (I am about to update the list of currencies though). So if this feature works well for you than I would encourage you to keep this in your own fork and use that instead. So if/when you want to open an issue to discuss the details of a possible search feature, please do so, and in the meantime, I will close this PR.