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('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


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.11a0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

prefixcommons-0.1.11a0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file prefixcommons-0.1.11a0.tar.gz.

File metadata

  • Download URL: prefixcommons-0.1.11a0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.7

File hashes

Hashes for prefixcommons-0.1.11a0.tar.gz
Algorithm Hash digest
SHA256 bf2bff774cb7e3f88cb415bc425f4d54e10cfd38dd05deeceaa42517559c8d5d
MD5 08b80dc2113d04954fb4594d88dd5190
BLAKE2b-256 165cdbc52b72807026ed3104c9fad230c9337233c39a4de00740117dfe59770d

See more details on using hashes here.

Provenance

File details

Details for the file prefixcommons-0.1.11a0-py3-none-any.whl.

File metadata

File hashes

Hashes for prefixcommons-0.1.11a0-py3-none-any.whl
Algorithm Hash digest
SHA256 1d57360bffc73a3ae064f2e184f2de1cb000d326c154e15d61d0399d61394061
MD5 11f6af1c1b5e07b904ad9176a7164407
BLAKE2b-256 a9cde0f545e905e4f08ddac19ec56f3174f75c191b6b415abb5b7eb0bb19f3dc

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