Skip to main content

Convert any CSV into meaningful graphs automatically.

Project description

PlotMind 📊

Convert any CSV into meaningful graphs automatically.

PlotMind analyses your CSV, detects column types, recommends the best chart, and generates it — with zero manual configuration. It supports interactive charts via Plotly and static charts via Matplotlib, and can export to PNG, PDF, or HTML.


Installation

pip install plotmind

Or install from source:

git clone https://github.com/git-rohan7/plotmind
cd plotmind
pip install -e .

Quick Start

Python API

from plotmind import load_csv, clean_dataframe, plot, export

# 1. Load
df = load_csv("sales.csv")

# 2. Clean (handles missing values, duplicates, type coercion)
df = clean_dataframe(df, verbose=True)

# 3. Plot – auto-detects best chart
fig = plot(df)

# 4. Export
export(fig, "sales_chart.html")
export(fig, "sales_chart.png")

Command-Line Interface

# Auto-detect best chart and display
plotmind sales.csv

# Choose a specific chart type
plotmind sales.csv --chart bar

# Specify axes
plotmind sales.csv --chart scatter --x revenue --y profit

# Export to file without displaying
plotmind sales.csv --chart line --export output.html

# Use matplotlib backend
plotmind sales.csv --backend matplotlib --export chart.png

# Show column info and recommendation
plotmind sales.csv --info

Features

Feature Description
Auto-chart selection Detects the best chart based on column types
Column type detection Identifies numerical, categorical, datetime, boolean columns
Data cleaning Fills missing values, removes duplicates, fixes types
Interactive charts Plotly backend for zoom/hover/pan
Static charts Matplotlib backend for PNG/PDF output
Export PNG, PDF, HTML, SVG
CLI Full command-line interface

Chart Types

PlotMind supports these chart types (auto-selected or manually chosen):

Chart When auto-selected
histogram Single numerical column
bar Categorical + numerical (high cardinality)
pie Categorical + numerical (≤6 unique categories)
scatter Two numerical columns
line Datetime + numerical
heatmap Many numerical columns (correlation matrix)
box Box plot for distribution

API Reference

load_csv(filepath, **kwargs) → DataFrame

Load a CSV and validate it.

df = load_csv("data.csv")

clean_dataframe(df, verbose=False) → DataFrame

Clean: fill missing values, remove duplicates, coerce types.

df = clean_dataframe(df, verbose=True)

detect_columns(df) → dict

Return a dict of {column_name: type} for each column. Types: numerical, categorical, datetime, boolean, unknown.

from plotmind import detect_columns
types = detect_columns(df)
# {'age': 'numerical', 'city': 'categorical', ...}

recommend_chart(df, x=None, y=None) → (chart, x_col, y_col)

Recommend the best chart. Returns a tuple.

from plotmind import recommend_chart
chart, x, y = recommend_chart(df)
print(chart)  # e.g. 'scatter'

plot(df, chart=None, x=None, y=None, title=None, backend='plotly', show=True) → Figure

Generate a chart. Returns the figure object.

fig = plot(df, chart="bar", x="city", y="sales", title="Sales by City")
fig = plot(df, backend="matplotlib", show=False)  # static, no display

export(fig, path, fmt=None) → str

Export the figure. Format is inferred from the file extension.

export(fig, "chart.png")    # PNG (requires kaleido for Plotly)
export(fig, "chart.pdf")    # PDF
export(fig, "chart.html")   # Interactive HTML (Plotly) or embedded HTML (Matplotlib)
export(fig, "chart.svg")    # SVG

Utils

from plotmind.utils import preview, column_stats, filter_columns

preview(df)               # Print head
column_stats(df)          # Summary DataFrame with null counts, unique values, etc.
filter_columns(df, types=["number"])  # Get only numeric column names

Testing

pip install plotmind[dev]
pytest tests/ -v

Requirements

  • Python ≥ 3.8
  • pandas ≥ 1.3
  • plotly ≥ 5.0
  • matplotlib ≥ 3.4
  • kaleido ≥ 0.2.1 (for Plotly static image export)

Optional:

  • seaborn (for nicer heatmaps with pip install plotmind[seaborn])

License

MIT

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

plotmind-0.1.1.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plotmind-0.1.1-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file plotmind-0.1.1.tar.gz.

File metadata

  • Download URL: plotmind-0.1.1.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for plotmind-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e17c2596a685b95aaa1dd7a22ba776e2cd93bbd795923572dabab906fccf00d9
MD5 932465b233eba274a0e7d1eae4f4c09d
BLAKE2b-256 acbe5c116cc5e2331962daac8afb5d352b1d321b02595ab918cafc502a7d2d3a

See more details on using hashes here.

File details

Details for the file plotmind-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: plotmind-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for plotmind-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3f315f717cfa27c588358b3a45084f9c5d7b910c92f21cb869542b2b462dd389
MD5 fa67e4129a2e00e1d169483cd7756231
BLAKE2b-256 4072c3ecc21610a0a8192425fcf4df171aac9beab9ed7ee2c2c0efbe5961c423

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page