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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
prefixcommons-0.1.9.tar.gz
(4.3 kB
view hashes)
Built Distributions
prefixcommons-0.1.9-py3.8.egg
(4.5 kB
view hashes)
Close
Hashes for prefixcommons-0.1.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ff99e9f2c27f41e6beb831742ca88ddae129b2de6dcc81b0b27f0de69cb2e8a |
|
MD5 | e271851989367601b1a39cdde9cbd344 |
|
BLAKE2b-256 | 93066151b38ed558e96a531bfb7736e4fa50f10c9a502d9d8b98f71f5699d443 |