SDK
Credentials are required to use the SDKThe SDKs authenticate with an API key or OAuth client credentials. See API Authentication to create either, and each SDK's documentation for how to pass them.
Monte Carlo provides convenient programmatic access to all APIs and additional features via a simple yet powerful SDK.
| Language | API | Details |
|---|---|---|
| Python (pycarlo) | GraphQL | pypi.org/project/pycarlo |
| Python (pycarlo2) | REST API v2 | pypi.org/project/pycarlo2 |
| Go | REST API v2 | pkg.go.dev/github.com/monte-carlo-data/mc-sdk-go |
REST API v2 SDKs
BetaThe REST API v2 SDKs are versioned
0.x, and a new minor version may carry breaking changes.
The Python and Go SDKs cover the REST API v2: deployments, collection agents and data stores, credentials, warehouses and connections. Both read credentials from their options, from MCD_DEFAULT_* environment variables, or from a profile in ~/.mcd/profiles.ini written by the CLI.
Python
pycarlo2 is a separate package from pycarlo, which covers the GraphQL API; the two can be installed side by side. It requires Python 3.10 or later:
pip install pycarlo2With credentials already configured through the CLI, a client needs no options:
import pycarlo2
client = pycarlo2.new_client()
print(pycarlo2.UsersApi(client).get_current_user())See the Python SDK reference for every operation, other ways to pass credentials, and paginated lists.
Go
go get github.com/monte-carlo-data/mc-sdk-go/montecarloSee its documentation for usage and examples.
Updated 16 days ago
