8. Data exploration

8.1. Apache Superset

8.1.1. Install

  1. Install superset

    pip install superset
    
  2. Create an admin user

    fabmanager create-admin --app superset
    
  3. Initialize the database

    superset db upgrade
    
  4. Load some data to play with

    superset load_examples
    
  5. Create default roles and permissions

    superset init
    
  6. To start a development web server on port 8088, use -p to bind to another port

    superset runserver -d
    

8.1.2. Configuration

  • superset_config.py

ROW_LIMIT = 5000
SUPERSET_WEBSERVER_PORT = 8088

# Change this for your setup
SECRET_KEY = '\2\1thisismyscretkey\1\2\e\y\y\h'

# Superset configuration database only
# Datasources are managed in the web UI
SQLALCHEMY_DATABASE_URI = 'sqlite:////path/to/superset.db'

# Flask CSRF protection
WTF_CSRF_ENABLED = True
WTF_CSRF_EXEMPT_LIST = []
WTF_CSRF_TIME_LIMIT = 60 * 60 * 24 * 365

# Set this API key to enable Mapbox visualizations
MAPBOX_API_KEY = ''

8.1.3. Production setup

gunicorn \
    -w 10 \
    -k gevent \
    --timeout 120 \
    -b  0.0.0.0:6666 \
    --limit-request-line 0 \
    --limit-request-field_size 0 \
    --statsd-host localhost:8125 \
    superset:app

8.1.4. Features

8.1.4.1. Dashboard

../_images/superset-01.png

Figure 33. Dashboard

8.1.4.2. Data exploration

../_images/superset-02.png

Figure 34. Data exploration

8.1.4.3. SQL IDE

../_images/superset-03.png

Figure 35. SQL IDE

8.1.4.4. GIS and spatial data

../_images/superset-04.png

Figure 36. GIS and spatial data