{"id":28225532,"url":"https://github.com/dlt-hub/metabase_data_api","last_synced_at":"2026-04-25T22:32:22.912Z","repository":{"id":42993815,"uuid":"465315657","full_name":"dlt-hub/metabase_data_api","owner":"dlt-hub","description":"Metabase data api python wrapper for notebooks and automation","archived":false,"fork":false,"pushed_at":"2022-05-31T11:52:57.000Z","size":280,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-08T19:06:00.602Z","etag":null,"topics":["colab-notebook","colaboratory","metabase","notebook-jupyter","pandas","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dlt-hub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-02T13:24:02.000Z","updated_at":"2025-06-04T12:31:56.000Z","dependencies_parsed_at":"2022-09-02T08:20:21.984Z","dependency_job_id":null,"html_url":"https://github.com/dlt-hub/metabase_data_api","commit_stats":null,"previous_names":["scale-vector/metabase_data_api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dlt-hub/metabase_data_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlt-hub%2Fmetabase_data_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlt-hub%2Fmetabase_data_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlt-hub%2Fmetabase_data_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlt-hub%2Fmetabase_data_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dlt-hub","download_url":"https://codeload.github.com/dlt-hub/metabase_data_api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlt-hub%2Fmetabase_data_api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259522458,"owners_count":22870469,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["colab-notebook","colaboratory","metabase","notebook-jupyter","pandas","python"],"created_at":"2025-05-18T11:09:01.701Z","updated_at":"2026-04-25T22:32:17.890Z","avatar_url":"https://github.com/dlt-hub.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Why?\n\n## Python notebook access\nThis package was created to enable reading data from Metabase into a python notebook for further analysis.\n\nIt's a way to provide business users with access to data in complex analyses.\n\nFor example, a product manager user may refresh an experiment evaluation or a sankey diagram by using only their metabase credentials.\n\nOr, a marketer could use a notebook that their data team made, to get user segmentation data and push it to Mailchimp or Facebook audiences.\n\nPossible uses:\n* Adding notebook-based analyses such as a/b testing significance calculators or data based attribution models\n* Adding complex visualisations such as sankey diagrams\n* Programmatic access to data for other parties (via metabase access management) means you can easily manage access in metabase rather than database.\n\n## Credential management, easy authentication and querying\nThe advantage over going directly to the db are :\n* Unified query method: You can query in the same way a card that reads data from Google Analytics or a database\n* Unified access control: Access to data can be managed in metabase for sources or even individual questions. If metabase reads from multiple source systems, this also reduces #nr of credentials.\n\nTypical use cases are:\n* Simple authentication and querying: Metabase is likely to be publicly accessible (as opposed to data warehouses that might be VPC only). Authentication is handled and does not require any complex flows.\n* Possiblity to consume \"drag and drop\" queries created in Metabase: A non tech user could create and maintain a data feed.\n\n\n# Examples:\n`pip install metabase-data-api`\nsee the examples folder\n\n![sankey](examples/sankey_example/sankey_example.png)\n\n![notebook](examples/regression_example/notebook_mlr.png)\n\ncode snippet:\n```\nimport pandas as pd\nfrom metabase_data_api import MetabaseApi as M\nimport json\n\nsession_params = dict(user='name@company.ai',\n                      password='demopass1',\n                      url='https://yourteam.metabaseapp.com/'\n                      )\n\nmb_api = M(**session_params)\n\nquery = 'SELECT 12 as col'\n\n#get raw file data via export\nd = mb_api.export_from_query(query, database_id=4)\n\njson.loads(d.decode(\"utf-8\"))\n\ndf = pd.DataFrame.from_records(d)\n\n\nprint(df)\n#   col\n#0   12\n```\n\n\n# Limits\nThe export method uses the file download functionality which is ***limited to 1m rows***.\n\nThe get_ methods are calling the same endpoints that are used by metabase for its own charting and are ***limited to 2k rows of results***\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlt-hub%2Fmetabase_data_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdlt-hub%2Fmetabase_data_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlt-hub%2Fmetabase_data_api/lists"}