Skip to content

🛠️ Setup

🐍 Install from PyPI

Run Meerschaum commands with mrsm (or python -m meerschaum if ~/.local/bin/ isn't in your PATH).

1
python -m pip install --upgrade meerschaum
Installing dependencies

Meerschaum will auto-install packages as you use them (into a virtual environment, to preserve your base environment).

You can manually install these packages in one command:

1
python -m meerschaum upgrade packages api -y

To install the packages into your environment (e.g. you're already using a virtual environment) by adding the name of the dependency group, e.g. api:

1
python -m pip install --upgrade meerschaum[api]

🥞 Start the Stack

You'll need Docker to start the stack.

1
mrsm stack up -d
📽️ Watch an example

This will start the pre-configured TimescaleDB instance (sql:main).

Don't have Docker or want to use your own database?

You can use a built-in SQLite database with the keys sql:local, or you may use your own database by creating a new connector. Read more about the SQLConnector here.

📽️ Watch an example

MRSM_SQL_<LABEL> environment variables

You can also define connectors in your environment. Set an environment variable MRSM_SQL_<LABEL> to your database URI:

1
2
MRSM_SQL_FOO=sqlite:////tmp/foo.db \
  python -m meerschaum start connector sql:foo

⚡ Connect to Your Instance

Meerschaum instance prompt Open the Meerschaum shell with mrsm or python -m meerschaum.

Your default instance is sql:main from the pre-configured stack. Connect to a different instance with instance sql:<label>.

To test the connection, run the command mrsm show pipes. A successful connection should return the message:

🎉 No pipes to show.
Change your default instance

The instance command temporarily changes your connected instance. To permanently change your default instance:

  1. Open your configuration with mrsm edit config.
  2. Navigate to the key instance: at the bottom of the file.
  3. Edit the value to the keys of your new instance (mrsm show connectors to see registered connectors).
Watch an example

If you've successfully connected, try building a pipe to get that data flowing!