prefixcommons
A python API for working with ID prefixes
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 prefixcommonsuv
uv add prefixcommonspoetry
poetry add prefixcommonsInstalling 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
Tags
More Information Analysis packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyarrowpyarrow provides Python bindings to Apache…
permissive · top 100 on PyPI
networkxNetworkX provides data structures and…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
snowflake-snowpark-pythonSnowpark Python provides APIs to query and…
permissive · top 1,000 on PyPI
curiesConverts between URIs and compact URIs (CURIEs)…
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
uri-templateExpands RFC 6570 URI Templates with variable…
permissive · top 1,000 on PyPI
bioregistryBioregistry provides a unified Python interface…
permissive · top 15,000 on PyPI
risonEncodes and decodes data to and from Rison, a…
permissive · top 15,000 on PyPI
uritoolsParses, validates, and composes URIs and URI…
permissive · top 5,000 on PyPI
lazr.uriParse, manipulate, and generate URIs with a…
copyleft · top 15,000 on PyPI
prontoPronto parses, browses, creates, and exports…
permissive · top 15,000 on PyPI
rdflib-jsonldProvides JSON-LD parsing and serialization for…
permissive · top 15,000 on PyPI