Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

Library for working prefixcommons.org CURIEs

Project description

prefixcommons

A python API for working with ID prefixes in the context of prefixcommons

Current functionality: Uses JSON-LD contexts to expand and contract CURIEs to URIs

E.g. GO:0008150 <=> http://purl.obolibrary.org/obo/GO_0008150

Example

>>> from prefixcommons import contract_uri
>>> print(contract_uri('http://purl.obolibrary.org/obo/GO_0008150'))
GO:0008150

>>> from prefixcommons import expand_uri
>>> print(expand_uri('GOL0008150'))
http://purl.obolibrary.org/obo/GO_0008150

The above uses standard JSON-LD context files from prefixcommons/biocontext

You can pass your own

>>> cmaps = [{'GO': 'http://purl.obolibrary.org/obo/GO_'}]
>>> print(contract_uri('http://purl.obolibrary.org/obo/GO_0008150'), cmaps)
GO:0008150

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for prefixcommons, version 0.1.9
Filename, size File type Python version Upload date Hashes
Filename, size prefixcommons-0.1.9-py3.8.egg (4.5 kB) File type Egg Python version 3.8 Upload date Hashes View
Filename, size prefixcommons-0.1.9-py3-none-any.whl (5.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size prefixcommons-0.1.9.tar.gz (4.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page