Python Library to translate CURIEs to IRIs and vice versa. Python version based on the Java Implementation: https://github.com/prefixcommons/curie-util and the JavaScript Implementation: https://github.com/geneontology/curie-util-es5
Project description
Curie Util
Python Library to translate CURIEs to IRIs and vice versa. Python version based on the Java Implementation: https://github.com/prefixcommons/curie-util and the JavaScript Implementation: https://github.com/geneontology/curie-util-es5
Install
pip install curieutil
Usage
Retrieve a JSON-LD file such as: https://github.com/prefixcommons/biocontext/blob/master/registry/go_context.jsonld
import requests
url = 'https://raw.githubusercontent.com/prefixcommons/biocontext/master/registry/go_context.jsonld'
r = requests.get(url)
Then create a CurieUtil object:
from curieutil import CurieUtil
mapping = CurieUtil.parseContext(r.json())
curie = CurieUtil(mapping)
Get IRI
curie.getIri("ZFIN:ZDB-GENE-031112-7")
curie.getIri("MGI:MGI:34340")
Get CURIE
curie.getCurie("http://identifiers.org/zfin/ZDB-GENE-031112-7")
curie.getCurie("http://identifiers.org/mgi/MGI:34340")
Notes
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for curieutil-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8ce79d611f89a6fe82c717983f51960e3e664e051cb160fda1b3befc8b39935 |
|
MD5 | aab9af8ff839f2715dbde15b5bd9937d |
|
BLAKE2b-256 | 3f02aa02d71cdf89dabf0c922c52c56bf0967a74440168d0d990413019eb3b23 |