Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

apache-superset-core

PyPI version License Python 3.10+

The official core package for building Apache Superset backend extensions and integrations. This package provides essential building blocks including base classes, API utilities, type definitions, and decorators for both the host application and extensions.

📦 Installation

pip install apache-superset-core

🏗️ Architecture

The package is organized into logical modules, each providing specific functionality:

  • api - REST API base classes, models access, query utilities, and registration
  • api.models - Access to Superset's database models (datasets, databases, etc.)
  • api.query - Database query utilities and SQL dialect handling
  • api.rest_api - Extension API registration and management
  • api.types.rest_api - REST API base classes and type definitions

🚀 Quick Start

Basic Extension Structure

from flask import request, Response
from flask_appbuilder.api import expose, permission_name, protect, safe
from superset_core.api import models, query, rest_api
from superset_core.api.types.rest_api import RestApi

class DatasetReferencesAPI(RestApi):
    """Example extension API demonstrating core functionality."""

    resource_name = "dataset_references"
    openapi_spec_tag = "Dataset references"
    class_permission_name = "dataset_references"

    @expose("/metadata", methods=("POST",))
    @protect()
    @safe
    @permission_name("read")
    def metadata(self) -> Response:
        """Get dataset metadata for tables referenced in SQL."""
        sql: str = request.json.get("sql")
        database_id: int = request.json.get("databaseId")

        # Access Superset's models using core APIs
        databases = models.get_databases(id=database_id)
        if not databases:
            return self.response_404()

        database = databases[0]
        dialect = query.get_sqlglot_dialect(database)

        # Access datasets to get owner information
        datasets = models.get_datasets()
        owners_map = {
            dataset.table_name: [
                f"{owner.first_name} {owner.last_name}"
                for owner in dataset.owners
            ]
            for dataset in datasets
        }

        # Process SQL and return dataset metadata
        return self.response(200, result=owners_map)

# Register the extension API
rest_api.add_extension_api(DatasetReferencesAPI)

🤝 Contributing

We welcome contributions! Please see the Contributing Guide for details.

📄 License

Licensed under the Apache License, Version 2.0. See LICENSE for details.


Note: This package is currently in release candidate status. APIs may change before the 1.0.0 release. Please check the changelog for breaking changes between versions.

Metadata

Release files for apache-superset-core 0.0.1rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for apache-superset-core 0.0.1rc1
File Size Uploaded Provenance Actions
apache_superset_core-0.0.1rc1.tar.gz 12.8 kB Without provenance Details for apache_superset_core-0.0.1rc1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for apache-superset-core 0.0.1rc1
File Interpreter ABI Platform Actions
apache_superset_core-0.0.1rc1-py3-none-any.whl Python 3 none any Details for apache_superset_core-0.0.1rc1-py3-none-any.whl

Total release size: 25.1 kB

Release files / apache_superset_core-0.0.1rc1.tar.gz

Download URL apache_superset_core-0.0.1rc1.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6ee6065e289641e719ee078393e92132dd6e9ea38e115ce2a3e90a8f860c7563
BLAKE2b-256 checksum
How to use checksums
9e7bf03654653643545998ab50f415325485f63c8c84a5429fc64eec3118eb80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.12

Release files / apache_superset_core-0.0.1rc1-py3-none-any.whl

Download URL apache_superset_core-0.0.1rc1-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
64219cf930f9cf3901fa742c01817ca5c21957f54e20b0daa4bb40bc15b40b12
BLAKE2b-256 checksum
How to use checksums
8e13a3ec1ce2f87deb199cfc590dd88efc09a12e79ee2ce4eb9db8e60aab4ffe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.12

Security for apache-superset-core 0.0.1rc1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page