metabase-manager
Manage your Metabase instance programmatically by declaring your desired state. metabase-manager will create, update,
and delete objects in Metabase to ensure to it matches your declared configuration.
Installation
pip install metabase-manager
Usage
Here is an example configuration for Users and Groups:
# metabase.yml
users:
- email: jdoe@example.com
first_name: Jane
last_name: Doe
groups:
- Administrators
- Finance
- name: jsmith@example.com
first_name: John
last_name: Smith
groups:
- Marketing
groups:
- name: Finance
- name: Marketing
By running the following command, metabase-manager will create these users and groups if they don't already exist,
update them if some attributes differ, and delete users and groups that exist in Metabase but are not declared here.
metabase-manager sync
[CREATE] Group(name='Finance')
[CREATE] Group(name='Marketing')
[DELETE] Group(name='Sales') # Sales is not defined in metabase.yml
[CREATE] User(first_name='Jane', last_name='Doe', email='jdoe@example.com', groups=[Group(name='Administrators'), Group(name='Finance')])
# jsmith@example.com already exists in Metabase, but some attributes or group membership differ
[UPDATE] User(first_name='John', last_name='Smith', email='jsmith@example.com', groups=[Group(name='Marketing')])
Credentials
It is possible to provide credentials to your Metabase instance through the command-line as follows:
metabase-manager sync --host=https://<org>.metabaseapp.com --user <email> --password <password>
It is also possible to provide credentials as environment variables. metabase-manager will automatically use
these variables if they are set in the environment.
METABASE_HOST=<host>METABASE_USER=<user>METABASE_PASSWORD=<password>
Configuration
By default, metabase-manager will expect to find a metabase.yml file in the current directory. You can override this
default, and optionally provide more than one file, with the --file/-f parameter.
metabase-manager sync -f users.yml -f <directory>/groups.yml
Selection
It is possible to run your sync only for certain types of objects by using the --select/-s or --exclude/-e options.
metabase-manager sync --select users # only users will be synced
metabase-manager sync --exclude users # everything by users will be synced
Dry Run
It is possible to execute a dry run to see which objects would be created, updated, or deleted given your configuration. This will only log the changes, but not actually execute any changes on your Metabase instance.
metabase-manager sync --dry-run
Upsert Only
If you do not want metabase-manager to delete anything in your Metabase instance, you can use the --no-delete flag.
This is useful if your metabase.yml configuration file does not exhaustively define object that you wish to exist in
your Metabase instance.
metabase-manager sync --no-delete
Supported Entities
Currently, it is possible to manage the following entities:
- Users
- Groups
Metadata
Release files for metabase-manager 0.2.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 | Provenance | |
|---|---|---|---|---|
| metabase-manager-0.2.1.tar.gz | 9.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| metabase_manager-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.6 kB
Release files / metabase-manager-0.2.1.tar.gz
| Download URL | metabase-manager-0.2.1.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
438e6d4ca5ff27f42434a5c6d91be5af9aa3bf633fa514df67ad64a20578b71c
|
|
BLAKE2b-256 checksum How to use checksums |
4c9c84799e3b30d1a863088b6dabc7943d7dc5654d4b1943ee0294fa2191789f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.6.9 Linux/5.4.0-104-generic
|
Release files / metabase_manager-0.2.1-py3-none-any.whl
| Download URL | metabase_manager-0.2.1-py3-none-any.whl |
|---|---|
| Size | 10.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
57399715e1c2060d670fe50a9894fa1fd9d601609b6f75bc7a3b727af0771937
|
|
BLAKE2b-256 checksum How to use checksums |
07951065046fe3e8379f84f03cec85471c1fdae6fa2a6210fde8925720d2af73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.6.9 Linux/5.4.0-104-generic
|
Security for metabase-manager 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.