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/")