CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-superset

A modern, enterprise-ready business intelligence web application

Pending
Overview
Eval results
Files

cli-interface.mddocs/

CLI Interface

Complete command-line interface for Apache Superset administration, data management, and server operations. The CLI provides essential tools for initializing the application, managing data, and performing administrative tasks.

Capabilities

Application Management

Commands for initializing, configuring, and running the Superset application server.

def init():
    """
    Initialize the Superset application and database.
    Creates database tables, default roles, and permissions.
    """

def runserver():
    """
    Start the Superset web server.
    
    Options:
    - --debug: Enable debug mode
    - --console-log: Enable console logging
    - --no-reload: Disable auto-reload
    - --address: Server bind address (default: 0.0.0.0)
    - --port: Server port (default: 8088)
    - --workers: Number of worker processes
    - --timeout: Request timeout in seconds
    - --socket: Unix socket path
    """

def version():
    """
    Display Superset version information.
    
    Options:
    - --verbose: Show additional version details
    """

Data Management

Commands for loading, importing, and exporting data, dashboards, and datasources.

def load_examples():
    """
    Load example datasets and dashboards.
    
    Options:
    - --load-test-data: Load additional test data
    """

def import_dashboards():
    """
    Import dashboards from JSON files.
    
    Options:
    - --path: Path to JSON file or directory
    - --recursive: Recursively search directories
    """

def export_dashboards():
    """
    Export dashboards to JSON format.
    
    Options:
    - --dashboard-file: Output file path
    - --print_stdout: Print to standard output
    """

def import_datasources():
    """
    Import datasources from YAML files.
    
    Options:
    - --path: Path to YAML file or directory
    - --sync: Synchronize existing datasources
    - --recursive: Recursively search directories
    """

def export_datasources():
    """
    Export datasources to YAML format.
    
    Options:
    - --datasource-file: Output file path
    - --print_stdout: Print to standard output
    - --back-references: Include back-references
    - --include-defaults: Include default values
    """

def export_datasource_schema():
    """
    Export datasource schema definitions.
    
    Options:
    - --back-references: Include back-references
    """

Druid Integration

Commands for managing Druid datasource connections and metadata synchronization.

def refresh_druid():
    """
    Refresh Druid datasource metadata.
    Synchronizes datasource definitions with Druid cluster.
    
    Options:
    - --datasource: Specific datasource name to refresh
    - --merge: Merge with existing metadata
    """

Cache and Metadata Management

Commands for managing application caches and metadata synchronization.

def update_datasources_cache():
    """
    Refresh SQL Lab datasources cache.
    Updates cached table and schema information.
    """

Background Processing

Commands for running Celery workers and monitoring interfaces for async query processing.

def worker():
    """
    Start Celery worker for asynchronous query processing.
    
    Options:
    - --workers: Number of worker processes (default: configured value)
    """

def flower():
    """
    Start Celery Flower monitoring interface.
    Provides web UI for monitoring Celery tasks and workers.
    
    Options:
    - --port: Web interface port
    - --address: Bind address
    """

User Management

Commands for creating test users and managing user accounts.

def load_test_users():
    """
    Create test users for development and testing.
    Creates admin, alpha, and gamma role users.
    """

Usage Examples

Basic Setup

# Initialize Superset database and create default roles
superset init

# Create an admin user (interactive)
superset fab create-admin

# Load example datasets and dashboards
superset load-examples

# Start development server
superset runserver --debug --port 8088

Production Deployment

# Initialize production database
superset init

# Run with multiple workers for production
superset runserver \
    --host 0.0.0.0 \
    --port 8088 \
    --workers 4 \
    --timeout 120

# Start background worker processes
superset worker --workers 8

# Start monitoring interface
superset flower --port 5555

Data Import/Export

# Export all dashboards to JSON
superset export-dashboards --dashboard-file /tmp/dashboards.json

# Import dashboards from file
superset import-dashboards --path /tmp/dashboards.json

# Export datasources with default values
superset export-datasources \
    --datasource-file /tmp/datasources.yml \
    --include-defaults

# Import and sync datasources
superset import-datasources \
    --path /tmp/datasources.yml \
    --sync

Maintenance Operations

# Refresh all Druid datasources
superset refresh-druid

# Refresh specific Druid datasource
superset refresh-druid --datasource my_datasource --merge

# Update SQL Lab metadata cache
superset update-datasources-cache

# Check version information
superset version --verbose

Configuration

CLI commands respect configuration settings from:

  • Environment Variables: SUPERSET_CONFIG_PATH, FLASK_APP
  • Configuration File: Default or custom config module
  • Command Line Options: Override configuration settings

Integration

The CLI interface integrates with:

  • Flask-Migrate: Database schema migrations
  • Celery: Asynchronous task processing
  • Flask-AppBuilder: User and role management
  • SQLAlchemy: Database operations
  • Druid: Metadata synchronization

Install with Tessl CLI

npx tessl i tessl/pypi-superset

docs

cli-interface.md

configuration.md

data-models.md

database-connectors.md

index.md

security.md

sql-lab.md

utilities.md

visualization.md

web-application.md

tile.json