curies
Idiomatic conversion between URIs and compact URIs (CURIEs)
What it is and what it does
Curies is a library for bidirectional conversion between full URIs and their compact CURIE form (e.g., 'CHEBI:1' ↔ 'http://purl.obolibrary.org/obo/CHEBI_1'). It accepts custom prefix maps or loads standard ones from the web (bioregistry, GO, OBO, etc.) and provides both a Python API and a command-line interface. The library uses a trie data structure for efficient lookups and can run as a web resolver or mapper using Flask or FastAPI.
The package is designed for semantic web and biomedical ontology work where URIs need compact representation for readability and transmission. It requires Pydantic v2 (as of v0.8) and depends on pystow for data caching. The CLI supports multiple pre-defined prefix maps and custom formats, making it useful for both one-off conversions and long-running web services.
Use it for:
- Convert biomedical ontology URIs to compact form for display in research tools or publications.
- Run a web resolver service that maps CURIEs to their full URIs for linked data applications.
- Normalize and compress identifiers in data pipelines that work with semantic web standards.
- Build a CURIE mapper web service for integration with external systems or APIs.
- Programmatically expand prefixed identifiers in Python scripts handling RDF or ontology data.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts between URIs and compact URIs (CURIEs) using customizable prefix maps, with both programmatic and CLI interfaces for resolving and mapping identifiers.
Yes. The package is actively maintained, has no known vulnerabilities, minimal install friction, and a permissive license. It solves a specific and well-defined problem in semantic web and biomedical data work. Install it if you need reliable CURIE–URI conversion; skip it only if you don't work with prefixed identifiers.
Install
curies on PyPI
pip
pip install curiesuv
uv add curiespoetry
poetry add curiesInstalling curies
Before you install
Low friction install with only two runtime dependencies (pydantic and pystow). Active maintenance with a release 4 days ago and recent commits; supports current Python versions (3.11–3.14).
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal legal friction.
Quickstart
pip install curies
import curies
converter = curies.load_prefix_map({
"CHEBI": "http://purl.obolibrary.org/obo/CHEBI_"
})
compressed = converter.compress("http://purl.obolibrary.org/obo/CHEBI_1")
expanded = converter.expand("CHEBI:1")
Requires Python 3.11 or later and Pydantic v2.
Verify before relying
- Whether the trie-based implementation scales efficiently for very large prefix maps.
- Performance characteristics when expanding or compressing thousands of identifiers in succession.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — pystow, pydantic |
| Maintenance | actively maintained — 4 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 491,496/month — #6,364 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: curies-0.15.0-py3-none-any.whl
Keywords: snekpack, cookiecutter, semantic web, compact uniform resource identifiers, uniform resource identifiers, curies, IRIs, URIs
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
bioregistryBioregistry provides a unified Python interface…
permissive · top 15,000 on PyPI
prefixcommonsConverts between CURIEs (compact URI…
permissive · top 15,000 on PyPI
prefixmapsRetrieves and manages semantic prefix maps that…
permissive · top 15,000 on PyPI
prisonEncodes and decodes a compact URI-friendly data…
permissive · top 5,000 on PyPI
risonEncodes and decodes data to and from Rison, a…
permissive · top 15,000 on PyPI
class-resolverDynamically lookup and instantiate classes by…
permissive · top 15,000 on PyPI
PyTriePyTrie provides a pure Python 3 trie data…
permissive · top 15,000 on PyPI
arcpGenerate and parse arcp (Archive and Package)…
permissive · top 15,000 on PyPI
lazr.uriParse, manipulate, and generate URIs with a…
copyleft · top 15,000 on PyPI
pygtriepygtrie provides pure Python implementations of…
permissive · top 5,000 on PyPI