or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

cli-commands.mdconfiguration.mdindex.mdmodels-database.mdrest-api.mdsecurity-auth.mdvisualization.md
tile.jsonVALIDATION_REPORT.md

tessl/pypi-apache-superset

A modern, enterprise-ready business intelligence web application for data exploration and visualization.

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/apache-superset@1.0.x

To install, run

npx @tessl/cli install tessl/pypi-apache-superset@1.0.0

index.mddocs/

Apache Superset

Apache Superset is a modern, enterprise-ready business intelligence web application that enables data exploration and visualization. Built with Python and React, it provides rich visualizations, interactive dashboards, SQL Lab for data analysis, and enterprise-grade security features.

Package Information

  • Package Name: apache-superset
  • Package Type: PyPI
  • Language: Python
  • Installation: pip install apache-superset

Core Imports

import superset
from superset import app, db, cache, security_manager

Application factory pattern:

from superset.app import create_app
app = create_app()

Basic Usage

# Initialize Superset application
from superset.app import create_app

# Create app instance
app = create_app()

# Initialize database and permissions  
with app.app_context():
    from superset import cli
    cli.init()

# Run development server
if __name__ == '__main__':
    app.run(debug=True, host='0.0.0.0', port=8088)

Command-line usage:

# Initialize Superset
superset init

# Create admin user
superset fab create-admin

# Load example data
superset load-examples

# Run development server
superset run -h 0.0.0.0 -p 8088 --with-threads --reload --debugger

Architecture

Apache Superset follows a layered architecture:

  • Web Layer: Flask-based web application with RESTful APIs
  • Security Layer: Role-based access control with Flask-AppBuilder
  • Data Layer: SQLAlchemy ORM with pluggable database engines
  • Visualization Layer: Rich chart library with D3.js and custom components
  • Cache Layer: Multi-tier caching with Redis/Memcached support
  • Task Layer: Celery-based background processing for async operations

Capabilities

Command Line Interface

Comprehensive CLI for application management, data loading, user administration, and development tasks.

def superset() -> None:
    """Management script for the Superset application."""

def init() -> None:
    """Initialize the Superset application."""

def version(verbose: bool) -> None:
    """Print current version number."""

def load_examples() -> None:
    """Load example data and dashboards."""

CLI Commands

REST API

Full REST API for programmatic access to dashboards, charts, datasets, and administrative functions.

# Chart API endpoints
class ChartRestApi(BaseSupersetModelRestApi):
    def get(self, pk: int) -> Response:
        """Get chart by ID."""
    
    def post(self) -> Response:
        """Create new chart."""
    
    def put(self, pk: int) -> Response:
        """Update chart."""
    
    def delete(self, pk: int) -> Response:
        """Delete chart."""

# Dashboard API endpoints  
class DashboardRestApi(BaseSupersetModelRestApi):
    def get(self, pk: int) -> Response:
        """Get dashboard by ID."""
    
    def export(self) -> Response:
        """Export dashboards."""

REST API

Application Configuration

Comprehensive configuration system for databases, security, caching, and feature flags.

# Core configuration classes
class SupersetConfig:
    SECRET_KEY: str
    SQLALCHEMY_DATABASE_URI: str
    WTF_CSRF_ENABLED: bool
    FEATURE_FLAGS: Dict[str, bool]
    
# Database configuration
DATABASES: Dict[str, Dict[str, Any]]

# Cache configuration  
CACHE_CONFIG: Dict[str, Any]
DATA_CACHE_CONFIG: Dict[str, Any]

# Security configuration
CUSTOM_SECURITY_MANAGER: Optional[Type[SupersetSecurityManager]]
AUTH_TYPE: int
AUTH_ROLE_ADMIN: str
AUTH_ROLE_PUBLIC: str

Configuration

Database Models and ORM

SQLAlchemy-based models for dashboards, charts, datasets, users, and metadata management.

# Core models
class Dashboard(Model, AuditMixinNullable):
    id: int
    dashboard_title: str
    position_json: str
    slices: List[Slice]

class Slice(Model, AuditMixinNullable):
    id: int
    slice_name: str
    viz_type: str
    params: str
    datasource: BaseDatasource

class Database(Model, AuditMixinNullable):
    id: int
    database_name: str
    sqlalchemy_uri: str
    engine: str

Models and Database

Security and Authentication

Enterprise-grade security with role-based access control, row-level security, and OAuth integration.

class SupersetSecurityManager(SecurityManager):
    def get_user_menu_access(self, menu_names: List[str]) -> Set[str]:
        """Get user's menu access permissions."""
    
    def can_access(self, permission_name: str, view_name: str) -> bool:
        """Check if user has permission."""
    
    def get_rls_filters(self, table: BaseDatasource) -> List[SqlaQuery]:
        """Get row-level security filters."""

# Permission model
class Permission(Model):
    name: str
    view_menu: ViewMenu

# Role model  
class Role(Model):
    name: str
    permissions: List[Permission]

Security and Authentication

Visualization System

Extensible visualization system with 40+ chart types and custom plugin support.

class BaseViz:
    viz_type: str
    verbose_name: str
    is_timeseries: bool
    
    def get_query_object(self) -> QueryObject:
        """Build query object from form data."""
    
    def get_data(self, df: pd.DataFrame) -> VizData:
        """Process data for visualization."""

# Chart plugin registry
viz_types: Dict[str, Type[BaseViz]]

# Query object for data retrieval
class QueryObject:
    datasource: BaseDatasource
    metrics: List[str]
    groupby: List[str]
    filters: List[Dict[str, Any]]

Visualization System

Types

# Core application types
from typing import Dict, List, Optional, Any, Union
from flask import Flask
from pandas import DataFrame

# Configuration types
ConfigDict = Dict[str, Any]
FeatureFlags = Dict[str, bool]

# Data types
VizData = Dict[str, Any]
QueryResult = Dict[str, Any]
ChartData = Dict[str, Any]

# Security types  
Permission = str
Role = str
User = Dict[str, Any]

# Database types
DatabaseEngine = str
ConnectionString = str
QueryObject = Dict[str, Any]