Giter VIP home page Giter VIP logo

stringx's Introduction

STRINGX is an API client for the STRING database, built on top of HTTPX.

PyPI Version Python Version STRING Version CI Status

Features

Inspired on the well-established usability of httpx, stringx provides a clean and easy to use interface to the STRING API while following usage recommendations and best practices:

  • Requires client identification;
  • Uses POST requests;
  • Allows linking to a specific STRING version;
  • When applicable, enforces specifying the species parameter.

A customizable client allows targeting any API version and provides support for all output formats available: TSV, JSON, XML, etc...

Installation

STRINGX requires Python 3.9+ and is available on PyPI.

$ pip install stringx

Usage

The stringx module provides a direct interface to the current API version. JSON is the default response format and can be easily integrated with pandas for further processing.

import pandas as pd
import stringx

stringx.identity = ""  # please identify yourself

df = pd.Dataframe(
    stringx.network(identifiers=["7227.FBpp0074940", "7227.FBpp0082908"], species=7227)
)

Tip

STRING understands a variety of identifiers and does its best to disambiguate your input. Nevertheless, it is recommended to map your identifiers first. Querying the API with a disambiguated identifier (for example 9606.ENSP00000269305 for human TP53) will guarantee much faster server response.

Client Identification

The STRING API requires its callers to identify themselves. To address this, STRINGX enforces that the identity value is set. If done at the module level all subsequent requests will carry this information.

import stringx

stringx.identity = "my_project_name"

You can also identify your clients independently.

import stringx

with stringx.Client(identity="my_project_name") as client:
    ...

with stringx.Client(
    address="https://version-10-5.string-db.org",
    identity="[email protected]"
) as client:
    ...

Regardless of how you choose to do it, STRINGX always appends its own information to your identity.

Using one of the clients instantiated above as example, the caller_identity parameters passed to the STRING API would be my_project_name (python-stringx/x.y.z).

Documentation

๐Ÿšง๐Ÿšง๐Ÿšง

Refer to the official API documentation for details.

License

STRING data is freely available under a CC-BY-4.0 license. Please provide appropriate credit when using the data. No changes or additions are made to the data by STRINGX.

stringx's People

Contributors

cachitas avatar dependabot[bot] avatar actions-user avatar

Stargazers

Clayton Kehoe avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.