A modern, enterprise-ready business intelligence web application
—
Flask-based web application with comprehensive REST API endpoints for dashboard management, data exploration, and administrative functions. The application provides both synchronous and asynchronous view handlers for optimal performance and user experience.
Main application functionality for data exploration, dashboard management, and system administration.
class Superset:
def datasources(self):
"""
List available datasources.
Returns JSON list of accessible datasources for current user.
"""
def override_role_permissions(self):
"""
Override user role permissions.
Administrative function for temporary permission elevation.
"""
def request_access(self):
"""
Request datasource access.
Submit access request for restricted datasources.
"""
def approve(self):
"""
Approve access requests.
Administrative function for granting datasource access.
"""
def slice(self, slice_id):
"""
View slice/chart details.
Parameters:
- slice_id: int, chart identifier
Returns:
Slice detail view with metadata and configuration
"""
def slice_json(self, slice_id):
"""
Get slice JSON data.
Parameters:
- slice_id: int, chart identifier
Returns:
JSON representation of chart data and configuration
"""
def annotation_json(self, layer_id):
"""
Get annotation layer data.
Parameters:
- layer_id: int, annotation layer identifier
Returns:
JSON data for annotation layer
"""RESTful endpoints for interactive data exploration and visualization.
class Superset:
def explore_json(self, datasource_type=None, datasource_id=None):
"""
Explore data API endpoint.
Core endpoint for chart data generation and exploration.
Parameters:
- datasource_type: str, type of datasource ('table' or 'druid')
- datasource_id: int, datasource identifier
HTTP Methods: GET, POST
Returns:
JSON response with chart data, query metadata, and caching info
"""
def explorev2(self, datasource_type, datasource_id):
"""
Explore v2 interface.
Enhanced exploration interface with improved performance.
Parameters:
- datasource_type: str, datasource type
- datasource_id: int, datasource identifier
Returns:
Enhanced exploration interface
"""
def explore(self, datasource_type=None, datasource_id=None):
"""
Main explore interface.
Interactive chart builder and data exploration interface.
Parameters:
- datasource_type: str, optional datasource type
- datasource_id: int, optional datasource identifier
HTTP Methods: GET, POST
Returns:
Chart builder interface
"""
def filter(self, datasource_type, datasource_id, column):
"""
Get column filter values.
Retrieve distinct values for filter dropdowns.
Parameters:
- datasource_type: str, datasource type
- datasource_id: int, datasource identifier
- column: str, column name for filtering
Returns:
JSON list of distinct column values
"""Endpoints for dashboard creation, modification, and sharing.
class Superset:
def import_dashboards(self):
"""
Import dashboard functionality.
Upload and import dashboard JSON definitions.
HTTP Methods: GET, POST
Returns:
Import interface and processing results
"""
def copy_dash(self, dashboard_id):
"""
Copy dashboard.
Create duplicate of existing dashboard.
Parameters:
- dashboard_id: int, source dashboard identifier
HTTP Methods: GET, POST
Returns:
Dashboard copy interface and new dashboard
"""
def save_dash(self, dashboard_id):
"""
Save dashboard.
Update dashboard configuration and layout.
Parameters:
- dashboard_id: int, dashboard identifier
HTTP Methods: GET, POST
Returns:
Dashboard save confirmation
"""
def add_slices(self, dashboard_id):
"""
Add slices to dashboard.
Include charts in dashboard layout.
Parameters:
- dashboard_id: int, target dashboard identifier
HTTP Method: POST
Returns:
Updated dashboard with new slices
"""API endpoints for database connection management and metadata exploration.
class Superset:
def testconn(self):
"""
Test database connection.
Validate database connection parameters.
HTTP Methods: POST, GET
Returns:
Connection test results and error details
"""
def schemas(self, db_id, force_refresh=None):
"""
Get database schemas.
Parameters:
- db_id: int, database identifier
- force_refresh: bool, optional cache bypass
Returns:
JSON list of available schemas
"""
def tables(self, db_id, schema, substr):
"""
Get schema tables with filter.
Parameters:
- db_id: int, database identifier
- schema: str, schema name
- substr: str, table name filter
Returns:
JSON list of matching table names
"""
def checkbox(self, model_view, id_, attr, value):
"""
Toggle checkbox values.
Update boolean attributes via AJAX.
Parameters:
- model_view: str, model view name
- id_: int, object identifier
- attr: str, attribute name
- value: str, new value
Returns:
Updated attribute value
"""
def recent_activity(self, user_id):
"""
Get user recent activity.
Parameters:
- user_id: int, user identifier
Returns:
JSON list of recent user activities
"""Simple key-value storage API for temporary data and user preferences.
class KV:
def store(self):
"""
Store key-value data.
HTTP Method: POST
Returns:
Storage confirmation with key identifier
"""
def get(self, key_id):
"""
Retrieve stored data.
Parameters:
- key_id: str, storage key identifier
Returns:
Stored value or 404 if not found
"""URL shortening service for sharing long dashboard and chart URLs.
class R:
def redirect(self, url_id):
"""
Redirect to shortened URL.
Parameters:
- url_id: str, short URL identifier
Returns:
HTTP redirect to original URL
"""
def shortner(self):
"""
Create short URL.
Generate shortened URL for long dashboard/chart links.
HTTP Methods: POST, GET
Returns:
Short URL identifier and redirect link
"""
def msg(self):
"""
Display messages.
Show user messages and notifications.
Returns:
Message display interface
"""CRUD interfaces for managing Superset objects through the web interface.
class DatabaseView:
"""
Database connection management interface.
Provides CRUD operations for database connections,
YAML export functionality, and connection testing.
"""
class SliceModelView:
"""
Chart/slice management interface.
CRUD operations for charts with data exploration integration.
"""
class DashboardModelView:
"""
Dashboard management interface.
CRUD operations for dashboards with composition tools
and sharing/permissions management.
"""
class CssTemplateModelView:
"""
CSS template management interface.
CRUD operations for custom styling templates.
"""
class LogModelView:
"""
Audit log interface.
Read-only access to system activity logs
with filtering and search capabilities.
"""Background processing interfaces for long-running operations.
class DatabaseAsync:
"""
Asynchronous database operations.
Background connection testing and metadata loading.
"""
class SliceAsync:
"""
Asynchronous slice operations.
Background chart data loading and processing.
"""
class DashboardModelViewAsync:
"""
Asynchronous dashboard operations.
Background dashboard data aggregation and loading.
"""
class DatabaseTablesAsync:
"""
Asynchronous table listing.
Background schema exploration and metadata discovery.
"""app: Flask
"""
Main Flask application instance.
Configured with all Superset blueprints, extensions, and middleware.
"""
db: SQLAlchemy
"""
SQLAlchemy database instance (SQLA).
Main database connection for application metadata.
"""
appbuilder: AppBuilder
"""
Flask-AppBuilder instance.
Provides authentication, authorization, and admin interface.
"""
security_manager: SupersetSecurityManager
"""
Superset security manager instance.
Handles user authentication and permission management.
"""
cache: Cache
"""
Application cache instance.
Configurable backend for query results and metadata caching.
"""
tables_cache: Cache
"""
Tables metadata cache instance.
Specialized cache for database schema information.
"""
migrate: Migrate
"""
Flask-Migrate instance.
Database schema migration management.
"""def parse_manifest_json():
"""
Parse frontend asset manifest.
Load webpack-generated asset mappings for production builds.
"""
def get_js_manifest_files(filename):
"""
Get JavaScript files for entry.
Parameters:
- filename: str, entry point name
Returns:
List of JavaScript file paths for entry
"""
def get_css_manifest_files(filename):
"""
Get CSS files for entry.
Parameters:
- filename: str, entry point name
Returns:
List of CSS file paths for entry
"""
def get_unloaded_chunks(files, loaded_chunks):
"""
Filter unloaded chunks.
Parameters:
- files: list, all available files
- loaded_chunks: set, already loaded chunk names
Returns:
List of unloaded chunk files
"""The web application integrates with:
Install with Tessl CLI
npx tessl i tessl/pypi-superset