From 5a2c3f2e1edb6832ff95b8eccaac8e120d9abe4e Mon Sep 17 00:00:00 2001 From: Hugo Cachitas Date: Sun, 31 Mar 2024 02:21:16 +0100 Subject: [PATCH] Update README --- README.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b729019..d56e3d3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # STRINGX -STRINGX is a [STRING](string-db.org) API client using [HTTPX](https://www.python-httpx.org) +STRINGX is a [STRING](https://string-db.org) API client using [HTTPX](https://www.python-httpx.org). ## Install @@ -12,8 +12,28 @@ pip install stringx ```python import stringx +``` + +You can call API endpoints directly + +```python +identifiers = stringx.map_identifiers(["edin", "atta"], species=7227) +``` + +or instantiate a customized client where you can specify the API version or your *caller identity*. -with stringx.Client() as client: + +```python +import stringx + +with stringx.Client(base_url="https://version-11-0.string-db.org") as client: identifiers = client.map_identifiers(["edin", "atta"], species=7227) ``` + +### API Endpoints + +| Method | API URL | **stringx** | +| -------------------------------- | ------------------------------- | ------------------------ | +| Mapping identifiers | /api/json/get_string_ids? | `map_identifiers()` | +| Getting the interaction partners | /api/json/interaction_partners? | `interaction_partners()` |