Skip to main content

Metashovel

Metashovel is a Metabase utility tool to mainly import/export questions and dashboards

Setup

Running from source

  1. Install Pipenv command in your system: sudo apt install pipenv
  2. Install dependencies from the root of this project directory: pipenv install
  3. Open shell with requirements loaded in a virtual environment: pipenv shell

Configuration

Depending on subcommand, you configure the cli with:

  1. environment variables (mostly for credentials eg API keys, or access urls, eg. url to database with user, pass, hostname, db name)
  2. command line switches and arguments

Environment variables reference

  1. API keys and Database access urls

Metashovel uses the Metabase API. Define Metabase url, username and password with these variables:

  • METABASE_ENDPOINT - url of Metabase instance with scheme, eg: https://data.awesome.com
  • METABASE_AUTH_EMAIL - email for login
  • METABASE_AUTH_PASSWORD - password for login

Usage

Metashovel has a set of subcommands, similar to git or heroku.

Export

metashovel export generates a JSON dump of all the data required to import the collections / dashboards / questions given in options.

The generated JSON is printed on standard output. It contains a property items with the list of objects that got exported, as well as a property mappings with information to translate ids that make sense only in the context of a Metabase instance (table ids, card ids, etc).

Options:

  • -c "Some collection" - Exports all the questions and dashboards contained in the named collection and its child collections. You should ensure that the dashboards refer only to questions contained within that collection, unless you plan to import the data within the same Metabase instance. The collection must exist.

Import

metashovel import reads a JSON dump generated by the export command and import the object into a Metabase instance.

Options:

  • -c "Some collection" - The name of the collection into which the objects should be imported. The collection must exist and be empty (no support for overwrite / merge at the moment).
  • -j /path/to/file.json - The JSON file to import.

Package building

To build the package use python setup.py bdist_wheel.

To install the package locally:

pip install --upgrade dist/metashovel-0.1-py3-none-any.whl

To upload it to PyPI:

  1. Create a ~/.pypirc file:
[distutils] 
index-servers=pypi
[pypi] 
repository = https://upload.pypi.org/legacy/ 
username = pypi-username
  1. Use python -m twine upload dist/*.

Contributing

TODO

Code Linting and Formatting

A pylint configuration is in pylintrc - configure your editor to run it automatically. Use black for formatting.

Release files for metashovel 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for metashovel 0.4.1
File Interpreter ABI Platform
metashovel-0.4.1-py3-none-any.whl Python 3 none any Details

Release files / metashovel-0.4.1-py3-none-any.whl

Download URL metashovel-0.4.1-py3-none-any.whl
Size 30.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb75a7b5c1c73cc8682d588c494ff7835b72919081b98512fc9b457d1babeea8
BLAKE2b-256 checksum
How to use checksums
9518ec09814982594f4a526643460bc59210986843c9589e6fbf235619d2d0c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.4.1 This release

1 release file

0.4.0

1 release file

0.3.4

1 release file

0.3.3

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page