BiolinkHelper
BiolinkHelper is a lightweight Python utility class for working with a specific Biolink Model version.
Its data source is the Biolink Model YAML file.
Overview
The BiolinkHelper class requires two mandatory inputs at initialization time:
- A Biolink Model version
- A local cache path where Biolink resources are stored (or will be stored)
No defaults are assumed.
Installation
pip install biolink-helper-pkg
Usage
Basic Example
from biolink_helper_pkg import BiolinkHelper
helper = BiolinkHelper(
biolink_version="4.2.6",
cached_path="/data/biolink_cache"
)
Class API
BiolinkHelper
class BiolinkHelper:
def __init__(self, biolink_version, cached_path):
...
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
biolink_version |
str |
Yes | The Biolink Model version to use (e.g. "4.2.6"). This value is mandatory and must be provided explicitly. |
cached_path |
str |
Yes | Path to a directory used for caching Biolink YAML files and lookup maps. Must be readable and writable. |
Both parameters are mandatory. Initialization will fail if either is missing or invalid.
How to use
Examples of ways to get ancestors:
biolink_helper.get_ancestors("biolink:Drug")
biolink_helper.get_ancestors(["biolink:Drug", "biolink:Protein"])
biolink_helper.get_ancestors("biolink:Drug", include_mixins=False)
biolink_helper.get_ancestors("biolink:Protein", include_conflations=False)
biolink_helper.get_ancestors("biolink:treats")
Examples of ways to get descendants:
biolink_helper.get_descendants("biolink:ChemicalEntity")
biolink_helper.get_descendants(["biolink:ChemicalEntity", "biolink:Protein"])
biolink_helper.get_descendants("biolink:ChemicalEntity", include_mixins=False)
biolink_helper.get_descendants("biolink:Protein", include_conflations=False)
biolink_helper.get_descendants("biolink:related_to")
Ancestors/descendants are always returned in a list. Relevant mixins are included in the returned list by default, but you can turn that behavior off via the include_mixins parameter, as shown in some of the above examples. Inclusion of ARAX-defined conflations can be controlled via the include_conflations parameter (default is True).
Other available methods include getting canonical predicates:
biolink_helper.get_canonical_predicates("biolink:treated_by")
biolink_helper.get_canonical_predicates(["biolink:treated_by", "biolink:related_to"])
And filtering out mixins:
biolink_helper.filter_out_mixins(["biolink:ChemicalEntity", "biolink:PhysicalEssence"]])
Debugging
The JSON version saved in cached_path is just there for easier debugging/viewing.
Metadata
Release files for biolink-helper-pkg 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| biolink_helper_pkg-1.0.1.tar.gz | 9.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| biolink_helper_pkg-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.0 kB
Release files / biolink_helper_pkg-1.0.1.tar.gz
| Download URL | biolink_helper_pkg-1.0.1.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
70ca463c52f3ee7916b15bd4f6d0b94d94e098d2f99fc4ff0aa7df4d2586aa17
|
|
BLAKE2b-256 checksum How to use checksums |
9a92ef0fcb05603b8cfe22f5957b09b2ea63e70430a99889c38105b3e0d1fd27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.0
|
Release files / biolink_helper_pkg-1.0.1-py3-none-any.whl
| Download URL | biolink_helper_pkg-1.0.1-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
88a0c54eb8947c00684a0770b90ff26c7a90ab69367b786bfd3c4df28f394212
|
|
BLAKE2b-256 checksum How to use checksums |
acc0031b168bd9d0c16f3a0e77701368d0fab19a1f9dd7553fa553d81be46288
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.0
|
Security for biolink-helper-pkg 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.