A modern, enterprise-ready business intelligence web application
npx @tessl/cli install tessl/pypi-superset@0.28.0Apache Superset is a modern, enterprise-ready business intelligence web application for data visualization and exploration. Built on Flask and React, it provides an intuitive interface for creating interactive dashboards, running SQL queries, and exploring datasets from diverse data sources including traditional databases, cloud data warehouses, and modern analytics engines like Druid.
pip install supersetimport superset
from superset import app, db, security_managerCommon for CLI operations:
from superset.cli import supersetFor extending Superset functionality:
from superset import appbuilder
from superset.models import core as models
from superset.connectors.sqla import models as sqla_models
from superset.connectors.druid import models as druid_models# Initialize Superset application
from superset import app, db
# Create the application context
with app.app_context():
# Initialize database
db.create_all()
# Load sample data
from superset.data import load_birth_names
load_birth_names()
# Start the web server
app.run(host='0.0.0.0', port=8088, debug=True)CLI usage for administration:
# Initialize the database and create default roles/permissions
superset init
# Create an admin user
superset fab create-admin
# Load example data
superset load-examples
# Start the web server
superset runserver --host 0.0.0.0 --port 8088 --debugSuperset follows a modular architecture designed for scalability and extensibility:
This architecture enables Superset to handle enterprise workloads while providing flexibility for customization and integration with existing data infrastructure.
Complete command-line interface for administration, data management, and server operations. Includes commands for initialization, data loading, import/export operations, and worker management.
def init(): ...
def runserver(): ...
def load_examples(): ...
def import_dashboards(): ...
def export_dashboards(): ...
def refresh_druid(): ...
def worker(): ...Flask-based web application with comprehensive REST API endpoints for dashboard management, data exploration, and administrative functions. Includes both synchronous and asynchronous view handlers.
class Superset:
def datasources(self): ...
def explore_json(self): ...
def slice_json(self): ...
def save_dash(self): ...
def copy_dash(self): ...
def testconn(self): ...Core data models representing databases, tables, charts, dashboards, and user activity. Built on SQLAlchemy ORM with comprehensive relationship mapping and business logic methods.
class Database:
def get_sqla_engine(self): ...
def fetch_metadata(self): ...
def all_table_names(self): ...
class Slice:
def datasource(self): ...
def viz(self): ...
class Dashboard:
def clone(self): ...
def data(self): ...Connector framework supporting SQL databases through SQLAlchemy and Druid through native APIs. Provides unified interface for data source registration, metadata discovery, and query execution.
class ConnectorRegistry:
def register_sources(self, datasource_config): ...
def get_datasource(self, datasource_type, datasource_id, session): ...
def get_all_datasources(self, session): ...
class SqlaTable:
def query(self): ...
def fetch_metadata(self): ...
def values_for_column(self): ...Comprehensive visualization system with 50+ chart types including tables, time series, geospatial maps, statistical plots, and specialized visualizations. Based on D3.js, NVD3, and deck.gl.
class BaseViz:
def process_metrics(self): ...
def get_df(self): ...
def cache_key(self): ...
def get_json_data(self): ...
class TableViz(BaseViz): ...
class NVD3TimeSeriesViz(BaseViz): ...
class MapboxViz(BaseViz): ...Role-based access control system with fine-grained permissions for databases, schemas, tables, and individual metrics. Supports multiple authentication methods and custom security policies.
class SupersetSecurityManager:
def can_access(self, permission_name, view_name, user=None): ...
def database_access(self, database, user=None): ...
def datasource_access(self, datasource, user=None): ...
def get_schema_perm(self, database, schema): ...Interactive SQL editor with syntax highlighting, auto-completion, query history, and async execution capabilities. Supports saved queries, query sharing, and result export functionality.
def get_sql_results(ctask, query_id, rendered_query, return_results=True, store_results=False, user_name=None, start_time=None): ...
def execute_sql(ctask, query_id, rendered_query, return_results, store_results, user_name, session, start_time): ...
class SqlLabView:
def runsql(self): ...
def sql_json(self): ...
def results(self): ...Comprehensive configuration system with settings for database connections, security, caching, feature flags, and UI customization. Supports environment-based configuration and runtime customization.
SECRET_KEY: str
SQLALCHEMY_DATABASE_URI: str
CACHE_CONFIG: dict
FEATURE_FLAGS: dict
CORS_OPTIONS: dict
CELERY_CONFIG: objectCore utilities for data processing, caching, JSON serialization, time handling, database management, and Celery integration. Provides essential functionality used throughout the application.
def flasher(msg, severity=None): ...
def parse_human_datetime(s): ...
def json_dumps(obj, default=None, ignore_nan=False, encoding=None, sort_keys=False): ...
def setup_cache(app, cache_config): ...
def get_or_create_main_db(): ...
def merge_extra_filters(form_data, extra_filters): ...