Python SDK for Metabase API.
pip install metabase-pyfrom metabase_py import MetabaseClient
# With API key
client = MetabaseClient(host="http://localhost:3000", api_key="your-api-key")
# List dashboards
dashboards = client.dashboards.list()
# Create a card
card = client.cards.create(
name="My Query",
dataset_query={"type": "query", "query": {...}},
display="table"
)
# Execute SQL
result = client.queries.run_native(
database_id=1,
native={"query": "SELECT * FROM orders LIMIT 10"}
)MIT