druid/examples/quickstart/jupyter-notebooks
Abhishek Radhakrishnan 5ce1b0903e
Add basic security functions to druidapi (follow up to #14009) (#14055)
Co-authored-by: Victoria Lim <vtlim@users.noreply.github.com>
Co-authored-by: Paul Rogers <progers@apache.org>
2023-04-11 10:55:27 -07:00
..
druidapi Add basic security functions to druidapi (follow up to #14009) (#14055) 2023-04-11 10:55:27 -07:00
0-START-HERE.ipynb pip install for Python Druid API (#13938) 2023-03-21 11:37:39 -07:00
Python_API_Tutorial.ipynb pip install for Python Druid API (#13938) 2023-03-21 11:37:39 -07:00
README.md pip install for Python Druid API (#13938) 2023-03-21 11:37:39 -07:00
api-tutorial.ipynb pip install for Python Druid API (#13938) 2023-03-21 11:37:39 -07:00
requirements.txt Python Druid API for use in notebooks (#13787) 2023-03-04 18:25:19 -08:00
sql-tutorial.ipynb Python Druid API for use in notebooks (#13787) 2023-03-04 18:25:19 -08:00

README.md

Jupyter Notebook tutorials for Druid

If you are reading this in Jupyter, switch over to the 0-START-HERE notebook instead.

You can try out the Druid APIs using the Jupyter Notebook-based tutorials. These tutorials provide snippets of Python code that you can use to run calls against the Druid API to complete the tutorial.

Prerequisites

Make sure you meet the following requirements before starting the Jupyter-based tutorials:

  • Python 3

  • The requests package for Python. For example, you can install it with the following command:

    pip install requests
    
  • JupyterLab (recommended) or Jupyter Notebook running on a non-default port. By default, Druid and Jupyter both try to use port 8888, so start Jupyter on a different port.

    • Install JupyterLab or Notebook:

      # Install JupyterLab
      pip install jupyterlab
      # Install Jupyter Notebook
      pip install notebook
      
    • Start Jupyter using either JupyterLab

      # Start JupyterLab on port 3001
      jupyter lab --port 3001
      

      Or using Jupyter Notebook

      # Start Jupyter Notebook on port 3001
      jupyter notebook --port 3001
      
  • The Python API client for Druid. Clone the Druid repo if you haven't already. Go to your Druid source repo and install druidapi with the following commands:

    cd examples/quickstart/jupyter-notebooks/druidapi
    pip install .
    
  • An available Druid instance. You can use the quickstart deployment. The tutorials assume that you are using the quickstart, so no authentication or authorization is expected unless explicitly mentioned.

    If you contribute to Druid, and work with Druid integration tests, can use a test cluster. Assume you have an environment variable, DRUID_DEV, which identifies your Druid source repo.

    cd $DRUID_DEV
    ./it.sh build
    ./it.sh image
    ./it.sh up <category>
    

    Replace <catagory> with one of the available integration test categories. See the integration test README.md for details.

Continue in Jupyter

Start Jupyter (see above) and navigate to the "0-START-HERE" notebook for more information.