Dead simple client for interacting with the Metabase dataset API
Project description
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 details)
Built Distribution
File details
Details for the file metabasic-0.5.1.tar.gz
.
File metadata
- Download URL: metabasic-0.5.1.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/4.19.128-microsoft-standard
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc920858e218cc1e891b39e2c6ee3b28792b4da4dcaf705cb232c735a06acc1e |
|
MD5 | c00c030c982d49ed66aa31618059cc9e |
|
BLAKE2b-256 | 41e6b7e1c0d5df701c2b0281c3ca1bf875c1d1dee3edcbc103d4104f6d5caeae |
File details
Details for the file metabasic-0.5.1-py3-none-any.whl
.
File metadata
- Download URL: metabasic-0.5.1-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/4.19.128-microsoft-standard
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b450c2f5abaeba46b3eec96ba0dd051db2b31d2a7f50a487fbbe560db036b10 |
|
MD5 | 076f20fa68d2a22d05c4d4aeb79d8a44 |
|
BLAKE2b-256 | 954151cbc5086ebee3932929f2647f188bfad48c03760608d9b686decf5b8e40 |