Python SDK
pip install abel-cap — the official Python client for Abel's CAP API.
Installation
terminalbash
pip install abel-capClient Initialization
init.pypython
import abel
client = abel.Client(api_key="sk-your-key")
# Or use environment variable ABEL_API_KEY
client = abel.Client()CAP Primitives
primitives.pypython
# Predict
prediction = client.predict("BTCUSD_close", horizon=48)
# Explain causal drivers
drivers = client.explain("BTCUSD_close", depth=2, cross_domain=True)
# Causal intervention
effect = client.intervene("Fed_Funds_Rate", "BTCUSD_close", treatment_value=0.5)
# Discover causal structure from your data
import pandas as pd
data = pd.read_csv("my_data.csv")
graph = client.discover(data, query="What causes churn?")
# Counterfactual
cf = client.counterfactual("NVDA_close", "AMD_close", intervene_value=0.01)
# Validate graph
report = client.validate(graph_id="g-123", test_data=new_data)Schema API
schema.pypython
# Search variables
results = client.schema.search_variables("oil price")
# → [{ name: "WTI_Crude", community: "Energy Markets", ... }]
# List communities
communities = client.schema.list_communities()
# Get causal neighborhood
neighborhood = client.schema.get_neighborhood("BTCUSD_close", depth=2)
# Check regime status
regime = client.schema.get_regime_status()Autonomous Analysis
analyze.pypython
# Full Causal-Copilot pipeline: discovery + inference + report
analysis = client.analyze(
data=pd.read_csv("experiment.csv"),
query="Find causal factors for conversion rate"
)
print(analysis.graph) # Discovered causal graph
print(analysis.effects) # Estimated causal effects
print(analysis.report_url) # Full HTML report