From 7f6d496654fe0c0a239e7d5e3064102a0278fb19 Mon Sep 17 00:00:00 2001 From: Yoshihiro OKUMURA Date: Thu, 2 Jul 2026 23:31:08 +0900 Subject: [PATCH] docs(readme): document custom configuration usage in library API Update the Python API Usage section in README.md to demonstrate how to initialize MdrsClient with InMemoryConfig to avoid creating local config files. --- README.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 57f9759..af6bec5 100644 --- a/README.md +++ b/README.md @@ -213,15 +213,21 @@ You can also use this package as a Python library to programmatically interact w ```python from mdrsclient.client import MdrsClient from mdrsclient.cache import InMemoryCache +from mdrsclient.config import InMemoryConfig + +# 1. Setup in-memory configuration and cache to avoid local state files (e.g., config.ini, cache/*.json) +config = InMemoryConfig("neurodata") +config.url = "https://neurodata.riken.jp/api" -# 1. Setup client with an in-memory cache to avoid local `.mdrsclient` state files cache = InMemoryCache() -client = MdrsClient.from_remote("neurodata", cache=cache) -# 2. Login to the remote server +# 2. Initialize client with custom configuration and cache +client = MdrsClient.from_remote("neurodata", cache=cache, config=config) + +# 3. Login to the remote server client.login("username", "password") -# 3. Use service methods +# 4. Use service methods labs = client.get_laboratories() metadata = client.metadata("neurodata:/NIU/Repository/")