Created
September 13, 2022 10:31
-
-
Save cthoyt/b21186e4b00902685c19e45f52b94cde to your computer and use it in GitHub Desktop.
Find resources in the Bioregistry whose regular expression patterns contain a banana (i.e., a redundant prefix or prefix synonym) for curation.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bioregistry | |
def main(): | |
"""Identify resources with uncurated bananas.""" | |
for resource in bioregistry.resources(): | |
pattern = resource.get_pattern() | |
if not pattern: | |
continue | |
for peel in ":_-": | |
if resource.prefix + peel in pattern.lower() or any( | |
synonym.lower() + peel in pattern.lower() | |
for synonym in resource.get_synonyms() | |
): | |
print(resource.prefix, pattern) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment