python wrapper for metabase api
Switch branches/tags
Nothing to show
Clone or download
Latest commit f16f8aa Jul 9, 2018
Permalink
Failed to load latest commit information.
metabase Purge default endpoint Jul 5, 2018
.gitignore first complete v1.0.0 Apr 12, 2017
LICENSE.md add LICENSE Apr 12, 2017
README.md bump up Jul 25, 2017
setup.cfg first complete v1.0.0 Apr 12, 2017
setup.py bump version Jul 9, 2018

README.md

metabase-py

python wrapper for metabase api

Installation

pip install metabase

How to use

import pprint
from metabase import Metabase

metabase = Metabase(email="<email>", password="<password>")

# get all cards
pprint.pprint(metabase.get("/card/"))

payload={
        'dataset_query': {
            'database': 2,
            'native': {
                'query': "SELECT 1,2,3;" },
            'type': 'native' },
        'display': "area",
        'name': 'test:1',
        'visualization_settings': {
        'graph.dimensions': ['a'],
        'graph.metrics': ['b', 'c'],
	'graph.show_goal': False,
        'line.interpolate': 'linear',
        'line.marker_enabled': True,
	'line.missing': 'interpolate',
	'stackable.stack_type': 'stacked',
	'table.column_widths': [] }}

pprint.pprint(metabase.post("/card/", json=payload))
pprint.pprint(metabase.get("/card/"))

Environments

  • METABASE_ENDPOINT
  • METABASE_AUTH_EMAIL
  • METABASE_AUTH_PASSWORD

Methods

  • get(<URL>, params=data)
  • post(<URL>, json=data)
  • head(<URL>, ...)
  • delete(<URL>, ...)

Features

  • can set session key as manually
  • auth_callback authentication callback (For custom storage)

Notice

This library wraps requests

Contributors

see here