Skip to main content

omnipath-client

Tests Codecov Docs PyPI Python License

Python client for the OmniPath molecular biology prior-knowledge web API.

Features

  • One-call lookup() and related() helpers that resolve free-text queries, fetch the matching entities/relations, and pivot identifiers into named columns — no manual primary-key juggling
  • Friendly id-type aliases (name, chebi, hmdb, uniprot, genesymbol, kegg, …) and participant-type aliases (protein, small_molecule, …) that hide the MI/OM ontology codes
  • Network datasets — op.datasets.liana.get(), op.datasets.metalinksdb.info(); the names are read from the service, so a build that registers a new dataset serves it without a client update
  • Lower-level primitives: export entities, relations, and annotations as DataFrames; resolve free-text identifiers; slice with paging
  • Ontology term lookup, search, and hierarchy trees
  • Multi-backend output: polars (default), pandas, or pyarrow
  • Optional graph conversion to annnet objects
  • Query validation against the API schema
  • Caching via download-manager, with a fresh() context manager for first-touch refresh

Installation

pip install omnipath-client

With polars (recommended default backend):

pip install omnipath-client polars

Quick start

The two high-level helpers, lookup() and related(), cover most use cases in a single call:

import omnipath_client as op

# Resolve names and pivot identifiers into named columns
op.lookup(
    ['caffeine', 'metformin', 'TP53'],
    id_types=['name', 'chebi', 'hmdb', 'uniprot', 'genesymbol'],
)

# Compounds reported in strawberry (FooDB), as a wide joined table
op.related(
    subject='Strawberry',
    sources=['foodb'],
    id_types=['name', 'chebi', 'hmdb'],
)

# Drug targets for caffeine (positional arg matches either side)
op.related(
    'caffeine',
    sources=['bindingdb'],
    id_types=['name', 'uniprot', 'genesymbol'],
)

# Pathway members from WikiPathways and Reactome at once
op.related(
    object=['WP253', 'R-HSA-70171'],
    sources=['wikipathways', 'reactome'],
    relation_categories=['annotation'],
    id_types=['name', 'uniprot', 'chebi'],
    group_by='object_name',
)

The lower-level primitives are still available for paged scans, raw parquet, or graph export:

# All relations as a polars DataFrame
df = op.relations()

# Resolve free-text identifiers to entity primary keys
op.resolve(['caffeine', 'TP53'])

# Human entities
df = op.entities(taxonomy_ids=['9606'])

# Relations as an annnet graph
g = op.relations(as_graph=True)

# Ontology term lookup
result = op.ontology_terms(['GO:0006915', 'MI:0326'])

# Choose a different backend
df = op.entities(backend='pandas')

Cache control:

# Force a one-shot refresh for everything touched in the block
with op.fresh():
    df = op.related('caffeine', sources=['bindingdb'])

# Wipe the entire on-disk cache (e.g. after a server redeploy)
op.cache_clear()

For more examples, see the quickstart guide.

OmniPath Utils

The client provides access to the OmniPath Utils service for ID translation, taxonomy, and orthology:

from omnipath_client.utils import (
    map_name,           # translate identifiers
    translate_column,   # translate DataFrame columns
    ensure_ncbi_tax_id, # resolve organism names
    orthology_translate, # cross-species translation
)

# Gene symbol to UniProt
map_name('TP53', 'genesymbol', 'uniprot')  # {'P04637'}

# Organism resolution
ensure_ncbi_tax_id('mouse')  # 10090

# Cross-species translation
orthology_translate(['TP53'], source=9606, target=10090)
# {'TP53': {'Trp53'}}

Full API: utils.omnipathdb.org

Documentation

Full documentation: saezlab.github.io/omnipath-client

Data licensing

The data served by OmniPath is combined from many original resources, each with their own license terms. The OmniPath client software is BSD-3-Clause, but the data is subject to the licenses of the original sources. Some resources restrict commercial use. Tools and documentation for managing license-based access control will be provided in a future release.

Citation

If you use OmniPath in your research, please cite:

Türei D, Schaul J, Palacio-Escat N, Bohár B, Bai Y, Ceccarelli F, Çevrim E, Daley M, Darcan M, Dimitrov D, Doğan T, Domingo-Fernández D, Dugourd A, Gábor A, Gul L, Hall BA, Hoyt CT, Ivanova O, Klein M, Lawrence T, Mañanes D, Módos D, Müller-Dott S, Ölbei M, Schmidt C, Şen B, Theis FJ, Ünlü A, Ulusoy E, Valdeolivas A, Korcsmáros T, Saez-Rodriguez J. (2026) OmniPath: integrated knowledgebase for multi-omics analysis. Nucleic Acids Research 54(D1):D652-D660. doi:10.1093/nar/gkaf1126

License

The client software is licensed under BSD-3-Clause. See Data licensing above for information about the data.

Metadata

Release files for omnipath-client 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for omnipath-client 0.4.0
File Size Uploaded
omnipath_client-0.4.0.tar.gz 284.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for omnipath-client 0.4.0
File Interpreter ABI Platform
omnipath_client-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 335.7 kB

Release files / omnipath_client-0.4.0.tar.gz

Download URL omnipath_client-0.4.0.tar.gz
Size 284.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2e0ee70e564b6fd1ef0d8003d9ce9abd91c8fa186fd40a551fb81774319efe4a
BLAKE2b-256 checksum
How to use checksums
80fbb53d80f0e7e0756e77e960b53d52227168626c3084149c0ffd580a0541f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release files / omnipath_client-0.4.0-py3-none-any.whl

Download URL omnipath_client-0.4.0-py3-none-any.whl
Size 50.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af744e6704083ba653fb62affc6870bd96dbfb636209a668490b0147e9f4f467
BLAKE2b-256 checksum
How to use checksums
5ce42a30e9c77f99d0c9d953c65d6b4fde89e25995e219b695b5f8a59142215f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page