SDKs
Python SDK
Official Python client for the MUDBASE API.
Installation
bash
pip install mudbasepip install mudbaseSource: mudbase-sdk-python on GitHub
Quick Start
Construct a Configuration plus the API classes you need - there is no unified client wrapper:
python
import os
import mudbase
configuration = mudbase.Configuration(
host="https://cloud.mudbase.dev",
)
with mudbase.ApiClient(configuration) as api_client:
# Your project API key goes out as X-API-Key on every request - the
# data/collection endpoints authenticate on that header.
api_client.set_default_header("X-API-Key", os.environ["MUDBASE_API_KEY"])
auth = mudbase.AuthenticationApi(api_client)
data = mudbase.DataApi(api_client)
# Log in an end-user of your project
session = auth.login_user(
mudbase.LoginRequest(email='morgan.chen@northwind.dev', password='hunter2')
)
# List documents in a collection
items = data.list_data(project_id, collection_id)import os
import mudbase
configuration = mudbase.Configuration(
host="https://cloud.mudbase.dev",
)
with mudbase.ApiClient(configuration) as api_client:
# Your project API key goes out as X-API-Key on every request - the
# data/collection endpoints authenticate on that header.
api_client.set_default_header("X-API-Key", os.environ["MUDBASE_API_KEY"])
auth = mudbase.AuthenticationApi(api_client)
data = mudbase.DataApi(api_client)
# Log in an end-user of your project
session = auth.login_user(
mudbase.LoginRequest(email='morgan.chen@northwind.dev', password='hunter2')
)
# List documents in a collection
items = data.list_data(project_id, collection_id)More
For installation in other languages, error handling, and pagination, see the SDKs Overview.