Skip to main content

seaborn-lite

A tiny, matplotlib-only subset of seaborn plus every algorithm from the DWM practical exam and every experiment write-up, packaged for direct use.

No seaborn, no scikit-learn, no scipy — just numpy, pandas and matplotlib.

Install

pip install .

That installs the distribution seaborn-lite and the import package seaborn_lite, bundles the 14 exam datasets, and adds the seaborn-lite command. To publish it so pip install seaborn-lite works from anywhere, build and upload it with python -m build + twine upload dist/*.

Print an experiment write-up

Every experiment .txt is bundled. One function per experiment prints it verbatim and returns the same text:

import seaborn_lite as snsl

snsl.apriori()      # prints 05_APRIORI_FREQUENT_PATTERNS.txt
snsl.sql()          # prints 01_SQL_EXPERIMENTS.txt
snsl.list()         # shows every available function
Function Prints
sql() 01_SQL_EXPERIMENTS.txt
star_schema() 02_STAR_SCHEMA_AND_15_QUERIES.txt
olap() 03_OLAP_OPERATIONS.txt
preprocessing(), data_preprocessing() 04_DATA_PREPROCESSING_AND_VISUALISATION.txt
apriori(), appriori() 05_APRIORI_FREQUENT_PATTERNS.txt
kmeans(), kmedoids() 06_KMEANS_AND_KMEDOIDS.txt
hierarchical(), hierarchical_clustering() 07_HIERARCHICAL_CLUSTERING.txt
naive_bayes(), categorical_naive_bayes(), gaussian_naive_bayes() 08_NAIVE_BAYES.txt
pagerank(), hits() 09_PAGERANK_AND_HITS.txt
all_experiments() DWM_ALL_EXPERIMENTS_ONE_FILE.txt

snsl.list() prints this table with the exact function names and file names. The algorithm implementations live under seaborn_lite.dwm, so snsl.kmeans() prints the write-up while seaborn_lite.dwm.kmeans(X, k=3) does the clustering.

Plotting

import seaborn_lite as sns
from seaborn_lite import datasets

df = datasets.load("customer_churn_raw")
sns.set_theme()
sns.histplot(df, x="Age", kde=True)
sns.countplot(df, x="Contract_Type")
sns.heatmap(df.select_dtypes("number").corr(), annot=True)

Supported: histplot, countplot, barplot, boxplot, scatterplot, heatmap, pairplot, set_theme. Same data= / x= / y= calling style as seaborn; plot functions return the matplotlib Axes (pairplot returns an object with .fig and .savefig; set_theme returns nothing). pairplot plots numeric columns only.

Algorithms

from seaborn_lite import datasets
from seaborn_lite.dwm import kmeans
from seaborn_lite.dwm.itemsets import apriori, transactions_from_dataframe

X = datasets.load("mall_customers").select_dtypes("number").to_numpy()
result = kmeans(X, k=3)
print(result.centroids, result.wcss)

tx = transactions_from_dataframe(datasets.load("transactions_list"))
frequent = apriori(tx, min_support=0.3)

API by experiment

Experiment Import Main callables
3 · OLAP from seaborn_lite.dwm import rollup, drilldown, slice_cube, dice_cube, pivot rollup(df, dim, measure), drilldown, slice_cube, dice_cube, pivot
4 · Explore from seaborn_lite.dwm import explore explore(df) -> dict
4 · Clean from seaborn_lite.dwm import clean_dataframe clean_dataframe(df, rename=...)
4 · Preprocess from seaborn_lite.dwm import discretize, label_encode, one_hot_encode, minmax_scale, zscore_scale, train_test_split all six helpers
4 · Visualise from seaborn_lite.dwm import plot_all plot_all(df, out_dir)
4 · Pivot from seaborn_lite.dwm import group_summary, multi_agg, pivot_table group_summary, multi_agg, pivot_table
5 · Apriori from seaborn_lite.dwm import apriori, association_rules apriori(transactions, min_support), association_rules(frequent, transactions, min_confidence)
6 · K-Means from seaborn_lite.dwm import kmeans, elbow kmeans(X, k) -> KMeansResult, elbow(X, k_max)
6 · K-Medoids from seaborn_lite.dwm import kmedoids kmedoids(X, k) -> KMedoidsResult
7 · Hierarchical from seaborn_lite.dwm import agglomerative, silhouette_score, plot_dendrogram four linkages (single/complete/average/ward), scale=True for StandardScaler behaviour
8 · Naive Bayes from seaborn_lite.dwm import CategoricalNB, GaussianNB scikit-learn-shaped fit / predict / predict_proba
9 · PageRank from seaborn_lite.dwm import pagerank, hits pagerank(graph) -> dict, hits(graph) -> (hubs, authorities)

Datasets

from seaborn_lite import datasets

datasets.available()          # 14 names
datasets.load("play_tennis")  # DataFrame
datasets.path("play_tennis")  # Path to the bundled CSV

CLI

seaborn-lite list
seaborn-lite datasets
seaborn-lite run kmeans
seaborn-lite run visualise --out ./plots
seaborn-lite run apriori --data my_baskets.csv

Demos: apriori, kmeans, kmedoids, hierarchical, nb-categorical, nb-gaussian, pagerank, hits, olap, explore, clean, preprocess, pivot, visualise.

Layout

seaborn-lite/
├── seaborn_lite/
│   ├── plotting.py        # the seaborn subset
│   ├── experiments/       # the 10 bundled .txt write-ups + printers/list()
│   ├── datasets/          # bundled CSVs + loaders
│   ├── demos.py           # what the CLI runs
│   ├── cli.py
│   └── dwm/               # the exam algorithms
├── tests/selfcheck.py     # assert-based, no test framework
├── pyproject.toml
└── DWM_PRACTICAL_EXAM/    # original exam submission, left untouched

Verify

python tests/selfcheck.py

This loads every dataset, checks known results (17 Apriori itemsets, Ward silhouette 0.2352, 13/14 Tennis accuracy, PageRank ranking), writes all eight plots, and runs every CLI demo.

Metadata

Release files for seaborn-lite 0.1.1

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

Source distribution (sdist)

Source distribution for seaborn-lite 0.1.1
File Size Uploaded Provenance Actions
seaborn_lite-0.1.1.tar.gz 63.2 kB Without provenance Details for seaborn_lite-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for seaborn-lite 0.1.1
File Interpreter ABI Platform Actions
seaborn_lite-0.1.1-py3-none-any.whl Python 3 none any Details for seaborn_lite-0.1.1-py3-none-any.whl

Total release size: 131.4 kB

Release files / seaborn_lite-0.1.1.tar.gz

Download URL seaborn_lite-0.1.1.tar.gz
Size 63.2 kB
Tags Source
SHA-256 checksum
How to use checksums
87bff757a9bcf214c96389cb18a6a5d3ad10bc503558e737407afc8d3764af4d
BLAKE2b-256 checksum
How to use checksums
b90164a489527ec9a0b27bde665c3a12f5b06caf84de4ab9ee28346f9f0a37a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.12

Release files / seaborn_lite-0.1.1-py3-none-any.whl

Download URL seaborn_lite-0.1.1-py3-none-any.whl
Size 68.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96578b7cf6f9d8d65b57edfc6c2cdabc9a8c5aade21cc7f19be53b76af540be1
BLAKE2b-256 checksum
How to use checksums
f651a32dbe82fb815e60371c0ddb83ec2fd2ca25981d7655afed539529a6f7c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.12

Security for seaborn-lite 0.1.1

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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