write_tsv

write_tsv(converter: Converter, path: str | Path, *, header: Tuple[str, str] = ('prefix', 'base')) None[source]

Write a simple prefix map CSV file.

Parameters:
  • converter – The converter to export

  • path – The path to a file to write to

  • header – A 2-tuple of strings representing the header used in the file, where the first element is the label for CURIE prefixes and the second element is the label for URI prefixes

import curies
converter = curies.load_prefix_map({
    "CHEBI": "http://purl.obolibrary.org/obo/CHEBI_",
})
curies.write_tsv(converter, "example_context.tsv")
prefix  base
CHEBI   http://purl.obolibrary.org/obo/CHEBI_