«

Using Jupyter Notebook

Jupyter Notebook is an interactive web-based notebook frequently used for data analysis and visualization. You can access data stored in Datomic for analysis in Jupyter Notebook (or any Python-based system) using the PyHive Presto library.

First, follow the steps in the Python Setup documentation.

Installing Jupyter

Use the venv created previously to perform the steps below.

  1. From the directory created when making the venv (my-python-env):
venv/bin/activate
  1. Install Jupyter by running:
pip install jupyterlab

Using Jupyter Notebook with Datomic Analytics

  1. Start a Jupyter Notebook with the following command:
jupyter notebook
  1. Browse to the URL reported by this command.
  2. Create a new Python3 notebook.
  3. To connect to your Datomic Analytics from Jupyter, use the configuration below:
from pyhive import presto
conn = presto.connect(
    host='<host>',
    port=<port>,
    catalog='<catalog>',
    schema='<schema>',
    username='presto'
)
cur = conn.cursor()
  1. Run a test query:
cur.execute('SELECT * FROM system.runtime.nodes')
print(cur.fetchall())