--- id: curies version: "0.15.0" license: MIT license_treatment: permissive maintenance: active --- # curies — Idiomatic conversion between URIs and compact URIs (CURIEs) License: permissive · Maintenance: active · Downloads: 491.5K/mo ## 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 above — 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 pip install curies uv add curies poetry add curies ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 491.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags URI to CURIE conversion, compact URI expansion, prefix map resolver, semantic web identifiers, biomedical ontology URIs, CURIE compression, IRI normalization, semantic-web, biomedical-ontology, identifier-mapping [View on SkillFed](https://skillfed.io/packages/curies) · [View on PyPI](https://pypi.org/project/curies/)