The api Module
Standard-library-only Apache Superset REST API client.
No third-party dependencies. Auth: POST /api/v1/security/login returns a JWT; the import endpoint also needs the CSRF token (GET /api/v1/security/csrf_token/) and a Referer header.
- multipart(fields, files)[source]
fields: dict[str,str]; files: list[(name, filename, bytes, ctype)].
- class SupersetClient(base_url)[source]
-
- get_database_uuid(name)[source]
Resolve a connection NAME to its uuid on THIS Superset instance.
Each instance assigns its own uuid, so callers must look it up by name rather than hard-code it.
- import_dashboard_zip(zip_bytes, overwrite=True)[source]
POST a native bundle to the v1 importer (same code the UI uses; the legacy
superset import-dashboardsCLI silently drops charts from native bundles). Returns (http_status, body_text).