skillfed

prefixcommons

A python API for working with ID prefixes

prefixcommons v0.1.12 307.2K downloads/30d#7,778 on PyPI5
Permissive license DORMANT released

What it is and what it does

prefixcommons is a Python library that converts between compact identifier notation (CURIEs) and their full Uniform Resource Identifiers (URIs) using JSON-LD context files. It ships with standard contexts that map biomedical ontology prefixes to their canonical URIs—for example, GO:0008150 expands to http://purl.obolibrary.org/obo/GO_0008150. The core functions are expand_uri (CURIE to URI) and contract_uri (URI to CURIE), and you can supply your own context maps as dictionaries if the built-in ones don't fit your use case.

The package is designed for workflows where you need to normalize identifier formats across biomedical ontologies. It depends on requests, click, pytest-logging, and PyYAML. The codebase is dormant (last release 2022-07-19), though the repository remains active, so it is not abandoned but not actively developed.

Use it for:

  • Normalize biomedical ontology identifiers in data pipelines by converting CURIEs to full URIs.
  • Batch expand or contract identifiers when integrating data from multiple ontology sources.
  • Define custom prefix-to-URI mappings for domain-specific identifier schemes.
  • Validate and standardize identifier formats in bioinformatics ETL workflows.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Converts between CURIEs (compact URI identifiers like GO:0008150) and full URIs using JSON-LD contexts.

Yes, if you work with biomedical ontologies or need CURIE-to-URI conversion. The package is stable, has no known vulnerabilities, and low install friction. The dormant maintenance status is a minor concern for a specialized tool—monitor the repository if you depend on current ontology prefix definitions, but core functionality is unlikely to break.

Install

prefixcommons on PyPI

pip

pip install prefixcommons

uv

uv add prefixcommons

poetry

poetry add prefixcommons

Installing prefixcommons

Before you install

Low friction: pure Python wheel with four common runtime dependencies (requests, click, pytest-logging, PyYAML). Maintenance is dormant—last release 2022-07-19, though repository has recent commits.

License in practice

Licensed under BSD (permissive), so you can use and modify the package freely in most contexts without restriction.

Quickstart

pip install prefixcommons
from prefixcommons import expand_uri, contract_uri
print(expand_uri('GO:0008150'))
print(contract_uri('http://purl.obolibrary.org/obo/GO_0008150'))

Verify before relying

  • Whether the standard JSON-LD context files are kept current with latest ontology prefix definitions.
  • Performance characteristics when expanding or contracting large batches of identifiers.
  • Whether custom context maps support the full JSON-LD specification or a subset.

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.7,<4.0)
Install friction low — pure-Python wheel
Runtime dependencies 4 — requests, click, pytest-logging, PyYAML
Maintenance dormant — 1,487 days since the last release
Last repo commit
First released
Downloads 307,179/month — #7,778 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: prefixcommons-0.1.12-py3-none-any.whl

Keywords: ontology, graph, obo, owl, sparql, networkx, network

Intended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: Bio-InformaticsTopic :: Scientific/Engineering :: Information Analysis

Tags

CURIE to URI conversionontology identifier expansionprefix commonsJSON-LD context resolutionOBO identifier mapping
ontology-identifiersbiomedical-datasemantic-web

More Information Analysis packages