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.

Source Distribution

metabasic-0.5.1.tar.gz (4.6 kB view hashes)

Uploaded Source

Built Distribution

metabasic-0.5.1-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page