Skip to content

Instantly share code, notes, and snippets.

@cthoyt
Created September 13, 2022 10:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cthoyt/b21186e4b00902685c19e45f52b94cde to your computer and use it in GitHub Desktop.
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.
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