Skip to main content

STRING API client

Project description

STRINGX

STRINGX is a STRING API client using HTTPX.

Quickstart

pip install stringx
import stringx

Firstly, it is recommended that you disambiguate your list of identifiers.

identifiers = ["edin", "atta"]

disambiguated_identifiers = stringx.map_identifiers(identifiers, species=7227)

The disambiguated_identifiers JSON response can be manipulated and reused in follow-up calls. For instance:

stringx.network(identifiers, species=7227)
stringx.interaction_partners(identifiers, species=7227)

Documentation

Here are some important point to have in mind when using stringx:

  • Latest API version tested and targeted by default.
  • You should identify yourself beforehand.
  • POST requests whenever possible as recommended.
  • Currently, only json format supported.
  • When applicable, species field is mandatory.
  • Use a custom stringx.Client() if you plan to make multiple calls or need to target a previous API version.
import stringx

with stringx.Client(base_url="https://version-11-0.string-db.org") as db:
    # remember to disambiguate identifiers first if needed
    network_1 = db.network(identifiers_1, species=7227)
    network_2 = db.network(identifiers_2, species=9606)

This tool aims at following best practices defined by STRING. Refer to the official API documentation for details.

API Endpoints Implemented

Method API URL stringx
Mapping identifiers /api/json/get_string_ids? map_identifiers()
Retrieving the interaction network /api/tsv/network? network()
Retrieving the interaction partners /api/json/interaction_partners? interaction_partners()

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

stringx-0.3.0.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

stringx-0.3.0-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

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