Skip to main content

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


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.12.tar.gz (24.1 kB view details)

Uploaded Source

Built Distribution

prefixcommons-0.1.12-py3-none-any.whl (29.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: prefixcommons-0.1.12.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

Hashes for prefixcommons-0.1.12.tar.gz
Algorithm Hash digest
SHA256 22c4e2d37b63487b3ab48f0495b70f14564cb346a15220f23919eb0c1851f69f
MD5 c5b3a8c6ba35bd08c44d2e878959359c
BLAKE2b-256 7db5c5b63a4bf5dedb36567181fdb98dbcc7aaa025faebabaaffa2f5eb4b8feb

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: prefixcommons-0.1.12-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

Hashes for prefixcommons-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 16dbc0a1f775e003c724f19a694fcfa3174608f5c8b0e893d494cf8098ac7f8b
MD5 8160110bfca4eb56bd696c68722f7e06
BLAKE2b-256 31e8715b09df3dab02b07809d812042dc47a46236b5603d9d3a2572dbd1d8a97

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