Skip to main content

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

You can also use a pre-defined context from biocontexts

>>> from prefixcommons import read_biocontext
>>> ctxt = read_biocontext('translator_context')
>>> print(contract_uri('http://purl.obolibrary.org/obo/GO_0008150'), [ctxt])
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.

Source Distribution

prefixcommons-0.1.7.tar.gz (4.4 kB view details)

Uploaded Source

Built Distributions

prefixcommons-0.1.7-py3.8.egg (9.3 kB view details)

Uploaded Source

prefixcommons-0.1.7-py3.6.egg (5.1 kB view details)

Uploaded Source

prefixcommons-0.1.7-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file prefixcommons-0.1.7.tar.gz.

File metadata

File hashes

Hashes for prefixcommons-0.1.7.tar.gz
Algorithm Hash digest
SHA256 a0aee464591f9b25e855412917ef269b599ded3f11872469333cbf0b9f33629e
MD5 59826447ac516cadf21f9f9057829c10
BLAKE2b-256 f445c42e2aa8550049825cd7391587a3f809150d25862689f274aada844d6e6f

See more details on using hashes here.

Provenance

File details

Details for the file prefixcommons-0.1.7-py3.8.egg.

File metadata

  • Download URL: prefixcommons-0.1.7-py3.8.egg
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for prefixcommons-0.1.7-py3.8.egg
Algorithm Hash digest
SHA256 09ae3ffcf76f921ce17d805f7e31a03279217c0476fad9f6fbaf847307239581
MD5 5354c370da317a97ac41480f8fce2efe
BLAKE2b-256 d52a5afdfeca61a85d27d6d61ee4f22058ac485d40a42a76713452f229db3b04

See more details on using hashes here.

Provenance

File details

Details for the file prefixcommons-0.1.7-py3.6.egg.

File metadata

File hashes

Hashes for prefixcommons-0.1.7-py3.6.egg
Algorithm Hash digest
SHA256 8c9a9348d278d2101936c99678917fef93f6ac106d0e9812909ca0c272970b43
MD5 2b2ffe4779f255ee76b7901e267fa2a5
BLAKE2b-256 1446d378bcc6971e43538640b498d2c6e5dbf9217cf6bc2f24fa9d389dbc741c

See more details on using hashes here.

Provenance

File details

Details for the file prefixcommons-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for prefixcommons-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 24a3caf81964ebbadc3b77b4a421e2f1899b6c665f0d8b03e243a8e18e67847c
MD5 d7078298ea9c611c1aa3d6419a64951c
BLAKE2b-256 14974f743330b7082ed6d9ec32b397229eac5d5f0eba2272e1fb0f99e076e72a

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page