Skip to main content

Dead simple client for interacting with the Metabase dataset API

Project description

CircleCI Actions codecov Language grade: Python License Tag PyPI

Metabasic

Dead simple client for interacting with the Metabase dataset API

Install

pip install metabasic

Examples

from metabasic import Metabasic
domain = "https://my-metabase-domain.com"

# Authentication with an existing session
db = Metabasic(domain, session_id="foo", database_id=1)
db.query("SELECT * FROM bar")
db.get_dataframe("SELECT * FROM bar")

# Email/Password authentication
ga = Metabasic(domain, database_id=2).authenticate("foo@email.com", "password")
ga_query = {
    "ids": "ga:1234567890",
    "start-date": "30daysAgo",
    "end-date": "today",
    "metrics": "ga:someMetric",
    "dimensions": "ga:someDimension",
    "sort": "ga:someDimension",
    "max-results": 10000
}
ga.query(json.dumps(ga_query))

# Select a database interactively
m = (
  Metabasic(domain)
  .authenticate("foo@email.com", "password")
  .select_database()
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for metabasic, version 0.5.1
Filename, size File type Python version Upload date Hashes
Filename, size metabasic-0.5.1-py3-none-any.whl (4.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size metabasic-0.5.1.tar.gz (4.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page