Python client#
souslesens is the Python client for the SousLeSensVocables API. It wraps read routes of
/api/v1 and is published on PyPI. The source is hosted at
souslesens/sls-py-client.
Installation#
pip install souslesens
Quick start#
from souslesens import SlsClient
client = SlsClient(token="xxx", base_url="http://localhost:3010")
client.health()
client.ask.knowledge_model_graph("ISO-14224-IOF")
The token is the same bearer token as the one described on the API page
(user menu, UserSettings, tab API TOKEN). base_url defaults to http://localhost:3010.
API#
Each method mirrors the API path it calls. The /api/v1/ask/... endpoints live under client.ask.
Method |
Description |
|---|---|
|
Client for the SousLeSensVocables API. |
|
Calls |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Exceptions#
SlsClientError— base class for all client failures (network error, invalid JSON response).HealthCheckError(SlsClientError)— the server returned{"health": "error"}(it could not probe itself).