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()
)
Release files for metabasic 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| metabasic-0.5.1.tar.gz | 4.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| metabasic-0.5.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.4 kB
Release files / metabasic-0.5.1.tar.gz
| Download URL | metabasic-0.5.1.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fc920858e218cc1e891b39e2c6ee3b28792b4da4dcaf705cb232c735a06acc1e
|
|
BLAKE2b-256 checksum How to use checksums |
41e6b7e1c0d5df701c2b0281c3ca1bf875c1d1dee3edcbc103d4104f6d5caeae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.9.1 Linux/4.19.128-microsoft-standard
|
Release files / metabasic-0.5.1-py3-none-any.whl
| Download URL | metabasic-0.5.1-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9b450c2f5abaeba46b3eec96ba0dd051db2b31d2a7f50a487fbbe560db036b10
|
|
BLAKE2b-256 checksum How to use checksums |
954151cbc5086ebee3932929f2647f188bfad48c03760608d9b686decf5b8e40
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.9.1 Linux/4.19.128-microsoft-standard
|