skillfed

curies

Idiomatic conversion between URIs and compact URIs (CURIEs)

curies v0.15.0 491.5K downloads/30d#6,364 on PyPI27
Permissive license MIT Active released

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 curies

uv

uv add curies

poetry

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 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleFramework :: PytestFramework :: SphinxFramework :: toxIntended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Typing :: Typed

Tags

URI to CURIE conversioncompact URI expansionprefix map resolversemantic web identifiersbiomedical ontology URIsCURIE compressionIRI normalization
semantic-webbiomedical-ontologyidentifier-mapping

More Internet packages