{"id":45494734,"url":"https://github.com/24eme/metabase_export_import","last_synced_at":"2026-02-22T17:35:07.048Z","repository":{"id":87532497,"uuid":"397889808","full_name":"24eme/metabase_export_import","owner":"24eme","description":"A python library allowing to import and export metabase database configuration from a metabase API","archived":false,"fork":false,"pushed_at":"2024-08-02T17:16:58.000Z","size":52,"stargazers_count":21,"open_issues_count":8,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-12-24T09:36:59.864Z","etag":null,"topics":["metabase","metabase-api","metabase-python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/24eme.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-19T09:35:16.000Z","updated_at":"2025-10-24T10:12:47.000Z","dependencies_parsed_at":"2024-08-02T20:09:12.209Z","dependency_job_id":null,"html_url":"https://github.com/24eme/metabase_export_import","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/24eme/metabase_export_import","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/24eme%2Fmetabase_export_import","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/24eme%2Fmetabase_export_import/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/24eme%2Fmetabase_export_import/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/24eme%2Fmetabase_export_import/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/24eme","download_url":"https://codeload.github.com/24eme/metabase_export_import/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/24eme%2Fmetabase_export_import/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29720569,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T15:10:41.462Z","status":"ssl_error","status_checked_at":"2026-02-22T15:10:04.636Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["metabase","metabase-api","metabase-python"],"created_at":"2026-02-22T17:35:06.380Z","updated_at":"2026-02-22T17:35:07.037Z","avatar_url":"https://github.com/24eme.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Metabase Export/Import\n\nThis python library allows to export and import a community version instance of Metabase\n\n## Example scripts\n\nTwo scripts are provided to import and export fields, cards and dashboards of a specific database configuration of metabase :\n\n    python3 metabase_export.py http://localhost:3000/api/ my_user my_password my_database export_folder\n\nThe script produces 3 files for each exported elements (the name of the database is user as prefix) : `my_database_fields_exported.csv`, `my_database_cards_exported.json` and `my_database_dashboard_exported.json`\n\n    python3 metabase_import.py http://localhost:3000/api/ my_user my_password my_database import_folder\n\nThe script imports from 3 files, one for each elements : `my_database_fields_forimport.csv`, `my_database_cards_forimport.json` and `my_database_dashboard_forimport.json`\n\n## Library calls\n\n### database creation/deletion\n\n    import metabase\n    \n    #connect to metabase\n    ametabase = metabase.MetabaseApi(\"http://localhost:3000/api/\", \"metabase_username\", \"metabase_password\")\n    \n    #add a sqlite database located at /path/to/database.sqlite. The metabase associated name is my_database\n    ametabase.create_database(\"my_database\", 'sqlite', {\"db\":\"/path/to/database.sqlite\"})\n\n    #ametabase.delete_database('my_database')\n\n### users and permisssions\n\n    ametabase.create_user(\"user@example.org\", \"the_password\", {'first_name': 'John', 'last_name': 'Doe'})\n    \n    #Add a group and associate it with our new user\n    ametabase.membership_add('user@example.org', 'a_group')\n    \n    #allow read data and create interraction with my_database for users members of our new group (a_group)\n    ametabase.permission_set_database('a_group', 'my_database', True, True)\n\n### collections and permissions\n\n    #create a collection and its sub collection\n    ametabase.create_collection('sub_collection', 'main_collection')\n\n    #allow write right on the new collections to the membres of a_group\n    ametabase.permission_set_collection('main_collection', 'a_group', 'write')\n    ametabase.permission_set_collection('sub_collection', 'a_group', 'write')\n\n### schema\n\n    #export and import the schema of fields\n    ametabase.export_fields_to_csv('my_database', 'my_database_fields.csv')\n    ametabase.import_fields_from_csv('my_database', 'my_database_fields.csv')\n\n### cards and dashboards\n\n    ametabase.export_cards_to_json('my_database', 'my_database_cards.json')\n    ametabase.export_dashboards_to_json('my_database', 'my_database_dashboard.json')\n\n    ametabase.import_cards_from_json('my_database', 'my_database_cards.json')\n    ametabase.import_dashboards_from_json('my_database', 'my_database_dashboard.json')\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F24eme%2Fmetabase_export_import","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F24eme%2Fmetabase_export_import","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F24eme%2Fmetabase_export_import/lists"}