Created
September 24, 2021 11:36
-
-
Save cthoyt/3f899eae5304ea3b3316a3c1be3c5bfd to your computer and use it in GitHub Desktop.
Find URL format strings in the bioregistry with problematic trailing slashes
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 tabulate | |
import bioregistry | |
def main(): | |
"""Generate a curation sheet for URL format strings with problematic trailing slashes.""" | |
rows = [] | |
for prefix, resource in bioregistry.read_registry().items(): | |
format_url = resource.get_format() | |
identifier = resource.get_example() | |
if format_url and format_url.endswith('/'): | |
rows.append((prefix, format_url, bioregistry.get_iri(prefix, identifier))) | |
print(tabulate.tabulate(rows, headers=["Prefix", "URL", "Example"])) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment