# STRINGX
[![PyPI Version](https://img.shields.io/pypi/v/stringx?label=PyPI&logo=pypi&logoColor=white&color=006dad)](https://pypi.org/project/stringx/)
[![Python Version](https://img.shields.io/pypi/pyversions/stringx?label=Python&logo=python&logoColor=white&color=006dad)](https://pypi.org/project/stringx/)
[![STRING Version](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fstring-db.org%2Fapi%2Fjson%2Fversion&query=%24%5B0%5D.string_version&style=flat&label=STRING&color=f7f6f2)](https://string-db.org)
STRINGX is an API client for the [STRING] database, built on top of [HTTPX].
## 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](https://pypi.org/project/stringx).
```sh
$ 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.
```python
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.
```python
import stringx
stringx.identity = "my_project_name"
```
You can also identify your clients independently.
```python
import stringx
with stringx.Client(identity="my_project_name") as client:
...
with stringx.Client(
address="https://version-10-5.string-db.org",
identity="me@example.com"
) 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](https://string-db.org/help/api) for details.
## License
[STRING] data is freely available under a [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/) license. Please provide appropriate credit when using the data. No changes or additions are made to the data by STRINGX.
[STRING]: https://string-db.org
[HTTPX]: https://www.python-httpx.org
Raw data
{
"_id": null,
"home_page": null,
"name": "stringx",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "string api client httpx sib cpr embl biodata elixir protein gene interaction",
"author": null,
"author_email": "Hugo Cachitas <hcachitas@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/e6/22/7dcf685dae4a0addae8433166fd073e4d3b04ac7aa270dcfbfe3728060cc/stringx-0.7.5.tar.gz",
"platform": null,
"description": "# STRINGX\n\n[![PyPI Version](https://img.shields.io/pypi/v/stringx?label=PyPI&logo=pypi&logoColor=white&color=006dad)](https://pypi.org/project/stringx/)\n[![Python Version](https://img.shields.io/pypi/pyversions/stringx?label=Python&logo=python&logoColor=white&color=006dad)](https://pypi.org/project/stringx/)\n[![STRING Version](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fstring-db.org%2Fapi%2Fjson%2Fversion&query=%24%5B0%5D.string_version&style=flat&label=STRING&color=f7f6f2)](https://string-db.org)\n\nSTRINGX is an API client for the [STRING] database, built on top of [HTTPX].\n\n## Features\n\nInspired 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:\n\n- Requires client identification;\n- Uses POST requests;\n- Allows linking to a specific STRING version;\n- When applicable, enforces specifying the `species` parameter.\n\nA customizable client allows targeting any API version and provides support for all output formats available: TSV, JSON, XML, etc...\n\n## Installation\n\nSTRINGX requires Python 3.9+ and is available on [PyPI](https://pypi.org/project/stringx).\n\n```sh\n$ pip install stringx\n```\n\n## Usage\n\nThe `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.\n\n```python\nimport pandas as pd\nimport stringx\n\nstringx.identity = \"\" # please identify yourself\n\ndf = pd.Dataframe(\n stringx.network(identifiers=[\"7227.FBpp0074940\", \"7227.FBpp0082908\"], species=7227)\n)\n```\n\n> [!TIP]\n> 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.\n\n## Client Identification\n\nThe 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.\n\n```python\nimport stringx\n\nstringx.identity = \"my_project_name\"\n```\n\nYou can also identify your clients independently.\n\n```python\nimport stringx\n\nwith stringx.Client(identity=\"my_project_name\") as client:\n ...\n\nwith stringx.Client(\n address=\"https://version-10-5.string-db.org\",\n identity=\"me@example.com\"\n) as client:\n ...\n```\n\nRegardless of how you choose to do it, STRINGX always appends its own information to your identity.\n\nUsing 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)`.\n\n## Documentation\n\n\ud83d\udea7\ud83d\udea7\ud83d\udea7\n\nRefer to the official [API documentation](https://string-db.org/help/api) for details.\n\n## License\n\n[STRING] data is freely available under a [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/) license. Please provide appropriate credit when using the data. No changes or additions are made to the data by STRINGX.\n\n[STRING]: https://string-db.org\n[HTTPX]: https://www.python-httpx.org\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "STRING DB API Client",
"version": "0.7.5",
"project_urls": {
"Homepage": "https://pypi.org/project/stringx",
"Issues": "https://github.com/cachitas/stringx/issues",
"Repository": "https://github.com/cachitas/stringx"
},
"split_keywords": [
"string",
"api",
"client",
"httpx",
"sib",
"cpr",
"embl",
"biodata",
"elixir",
"protein",
"gene",
"interaction"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3bc06bf207a9f1e2437d092c14326989c723467fb915188afc4f0d03120695f1",
"md5": "0f397457c8897beb6bad31043e03a3bd",
"sha256": "d79845925fb5830c48c13d6628c75eaf7a0fe3667987904649278ffc638174b9"
},
"downloads": -1,
"filename": "stringx-0.7.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0f397457c8897beb6bad31043e03a3bd",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 5478,
"upload_time": "2024-04-09T23:40:37",
"upload_time_iso_8601": "2024-04-09T23:40:37.915259Z",
"url": "https://files.pythonhosted.org/packages/3b/c0/6bf207a9f1e2437d092c14326989c723467fb915188afc4f0d03120695f1/stringx-0.7.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e6227dcf685dae4a0addae8433166fd073e4d3b04ac7aa270dcfbfe3728060cc",
"md5": "b257bd6ed279c0024fea68a91857ff2e",
"sha256": "34e7fa6369d0409199e257d083e8d1afae76adb054b3deebc7573b2fbb587d84"
},
"downloads": -1,
"filename": "stringx-0.7.5.tar.gz",
"has_sig": false,
"md5_digest": "b257bd6ed279c0024fea68a91857ff2e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 7663,
"upload_time": "2024-04-09T23:40:39",
"upload_time_iso_8601": "2024-04-09T23:40:39.938004Z",
"url": "https://files.pythonhosted.org/packages/e6/22/7dcf685dae4a0addae8433166fd073e4d3b04ac7aa270dcfbfe3728060cc/stringx-0.7.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-09 23:40:39",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cachitas",
"github_project": "stringx",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "stringx"
}