The `curies` Python package provides efficient, faultless, and idiomatic utilities for converting between Uniform Resource Identifiers (URIs) and Compact URIs (CURIEs). It is a crucial low-level tool for linked data applications, enabling data scientists, curators, and software developers to handle prefix maps, expand CURIEs to URIs, and compress URIs to CURIEs. The library is actively developed, currently at version 0.13.3, with ongoing enhancements for robustness and usability.
pip install curiesVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to load a predefined CURIE converter and then use it to expand CURIEs to URIs and compress URIs back to CURIEs. Alternatively, you can define and load your own prefix map.
Always review the release notes and changelog when upgrading `curies` to a new minor version to identify any necessary code adjustments.
Ensure that your custom prefix maps are ordered from most specific to least specific, or be aware that the first definition for a prefix/URI prefix pair will take precedence in resolution.
Add `import curies` at the top of your Python script or interactive session before using any functions or classes from the library.
Verify that your prefix map input is valid, or that the predefined converter could be loaded successfully. Always check that the `converter` object is not `None` before attempting to use its methods.