A Python package to upload pandas DataFrames to Superset for easy visualization.
Project description
Superset Accessor for Pandas DataFrames
Note: The code docs AI-generated so may not be perfect (or even right lol).
Upload your DataFrame to Superset as a datasource for rapid visualization.
Notes
- Ensure you have a database or datasource in Superset that supports CSV uploads.
- To maintain a clean and organized Superset environment:
- Within Superset create a dedicated database or datasource (specified by the
database_nameparameter in theconfigurefunction) for this package. - Consistently use the same database or datasource name when uploading data, as the package overwrites existing data by default.
- Within Superset create a dedicated database or datasource (specified by the
- Call
SupersetAccessor.configureat least once before using theas_datasourceaccessor.
Installation
Install the package via pip:
pip install dataframe-to-superset
Usage
import pandas as pd
from dataframe_to_superset import SupersetAccessor
SupersetAccessor.configure(
base_url="https://superset",
username="your_username",
password="your_password",
provider="your_auth_provider", # e.g., "ldap" or "db"
database_name="your_database_name",
schema="your_schema_name", # optional, defaults to "public"
)
data = {"name": ["Alice", "Bob"], "age": [25, 30]}
df = pd.DataFrame(data)
url = df.superset.as_datasource("people")
print(url)
# Another example
data = {"animal": ["Wolf", "Cat"], "Sound": ["Howl", "Meow"]}
df = pd.DataFrame(data)
url = df.superset.as_datasource("animal_sounds", verbose_return = True)
print(url)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dataframe_to_superset-0.1.3.tar.gz.
File metadata
- Download URL: dataframe_to_superset-0.1.3.tar.gz
- Upload date:
- Size: 22.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e67d7022d8335f089fcccf6c29268b66a2686dda34778cb1f261d48ffd6eefb7
|
|
| MD5 |
411cda239589c684b2daaebea09b1e0a
|
|
| BLAKE2b-256 |
942244076c725abbd2233b67158334187192f2f2324af56dddf69229bb8dd8fe
|
File details
Details for the file dataframe_to_superset-0.1.3-py3-none-any.whl.
File metadata
- Download URL: dataframe_to_superset-0.1.3-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61f7608e9c743d79f35d832a9ccd773f71055912947aa2c86d77c968899040d2
|
|
| MD5 |
049b202a1b965315308a4870c37d8dd6
|
|
| BLAKE2b-256 |
6929d54563c7d6f0584c20e8f450614b2de50f33cc23d1b582f0da999e5eff17
|