A python API for working with ID prefixes
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('GO:000850')) 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.10.tar.gz
(24.1 kB
view details)
Built Distribution
File details
Details for the file prefixcommons-0.1.10.tar.gz
.
File metadata
- Download URL: prefixcommons-0.1.10.tar.gz
- Upload date:
- Size: 24.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.7 Darwin/20.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 925715003d54aa083f3fea6f7a3c140e24eb764c16f8ab50bc78c51d4f76ea95 |
|
MD5 | 809eb2102256e9cd89c998bfbf20f509 |
|
BLAKE2b-256 | 11528ab78b41d32e3539ff314589ea47308db2c73dd72f9410f36e1f6fb55c44 |
Provenance
File details
Details for the file prefixcommons-0.1.10-py3-none-any.whl
.
File metadata
- Download URL: prefixcommons-0.1.10-py3-none-any.whl
- Upload date:
- Size: 29.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.7 Darwin/20.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89a8ece73a8f1637ca99a44d488a7f7d026c1d4d8c2c97486e54267ac6a58dda |
|
MD5 | d5d9ca12198a0011205cf6ec491a8d94 |
|
BLAKE2b-256 | 6b617ea54de542120274fbbbf16864445a6ee3e3d7086cdcb9fa4f5565c1f3ef |