load_prefix_map(prefix_map: str | Path | Mapping[str, str], **kwargs: Any) Converter[source]

Get a converter from a simple prefix map.

  • prefix_map

    One of the following:

    • A mapping whose keys represent CURIE prefixes and values represent URI prefixes

    • A string containing a remote location of a JSON file containg a prefix map

    • A string or pathlib.Path object corresponding to a local file path to a JSON file containing a prefix map

  • kwargs – Keyword arguments to pass to curies.Converter.__init__()


A converter

>>> import curies
>>> converter = curies.load_prefix_map({
...     "CHEBI": "http://purl.obolibrary.org/obo/CHEBI_",
... })
>>> converter.expand("CHEBI:138488")
>>> converter.compress("http://purl.obolibrary.org/obo/CHEBI_138488")