Registry / devops / pycarlo

pycarlo

JSON →
library0.15.248pypypi✓ verified 24d ago

Pycarlo is Monte Carlo's Python SDK, providing programmatic access to the Monte Carlo data observability platform's APIs. It enables users to execute queries and mutations against the Monte Carlo API and leverage higher-level features for common data operations. The library is actively maintained and frequently updated, with a current version of 0.12.292 and requires Python 3.9 or greater.

pip install -U pycarlo
INSTALL
IMPORT
SIG · PYCARLO
P
pycarlo
devopspythonv0.15.248
Install
4.0s avg
Import
6979ms
Disk
51MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.15.248 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 7.080s · 44.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.0s · import 6.878s · 63MB
51MB installed
● package 51MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Client
from pycarlo.core import Client
Query
from pycarlo.core import Query
Mutation
from pycarlo.core import Mutation
Session
from pycarlo.core import Session
CircuitBreakerService
from pycarlo.features.circuit_breakers import CircuitBreakerService

This quickstart demonstrates how to initialize the Pycarlo client and execute a basic query to retrieve the current user's email. Authentication is handled via environment variables (MCD_ID, MCD_TOKEN), a Monte Carlo CLI-configured profile (~/.mcd/profiles.ini), or by explicitly passing credentials to the Session. It's recommended to use environment variables or CLI profiles for security in production environments.

import os from pycarlo.core import Client, Query, Session # Configure session using environment variables or a named profile # For production, it's recommended to set MCD_ID and MCD_TOKEN environment variables. # Alternatively, you can configure via the Monte Carlo CLI: `montecarlo configure` # If using a named profile, ensure ~/.mcd/profiles.ini is set up. mcd_id = os.environ.get('MCD_ID', 'your_mcd_id_here') mcd_token = os.environ.get('MCD_TOKEN', 'your_mcd_token_here') # Instantiate a client. By default, it uses the 'default' profile or environment variables. # You can also pass credentials explicitly or specify a profile: # client = Client(Session(mcd_id=mcd_id, mcd_token=mcd_token)) client = Client() # Create a query object query = Query() query.get_user.email() # Execute the query try: response = client(query) user_email = response.get_user.email print(f"Current user email: {user_email}") except Exception as e: print(f"An error occurred: {e}")
Debug
Known issues
gotchaAPI Key Configuration: Pycarlo requires an API Key ID (MCD_ID) and API Secret (MCD_TOKEN) for authentication. These are typically sourced from environment variables or a configuration file (~/.mcd/profiles.ini) created by the Monte Carlo CLI (`montecarlo configure`). Incorrect or missing credentials will prevent the SDK from functioning.
fix
Ensure `MCD_ID` and `MCD_TOKEN` environment variables are set, or run `montecarlo configure` via the CLI to set up a default profile. For explicit control, pass `mcd_id` and `mcd_token` to `pycarlo.core.Session`.
affects: All
gotchaEnum Backward Compatibility: Unlike `sgqlc`'s default behavior, Pycarlo is designed to be backward compatible with new enum values introduced in the Monte Carlo API. If the API returns an enum value not present in your SDK version, it will be returned as a string with a warning, instead of raising an error. While this prevents breakage, it means your local SDK might not fully reflect the latest API schema.
fix
Keep your Pycarlo SDK updated to the latest version to avoid warnings and ensure full feature and schema support. `pip install -U pycarlo`.
affects: All
gotchaSeparation of Core and Features: Pycarlo is divided into `core` for direct API queries/mutations and `features` for higher-level convenience functions (e.g., circuit breakers, dbt, pii filtering). Ensure you import from the correct submodule (e.g., `from pycarlo.core import Client` vs. `from pycarlo.features.circuit_breakers import CircuitBreakerService`).
fix
Refer to the documentation for specific imports. Most basic operations start with `pycarlo.core`.
affects: All
Upgrade
Version history
0.15.248latest on PyPI · released Aug 28, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
8
Resources