Skip to main content

✨ Darsh

Built on pandas and matplotlib, not instead of them.

PyPI - Version License: MIT Python Versions


North Star: Darsh is a skin and convenience layer over pandas and matplotlib — not a replacement for them. Every Darsh call returns a real pandas.DataFrame, matplotlib.axes.Axes, or plotly.graph_objects.Figure so you never lose access to the ecosystem you already know and trust.

No proprietary DataFrame wrappers. No black-box chart objects. Just clean ergonomics registered via pandas' sanctioned df.darsh accessor.

import pandas as pd
import darsh

# 1. Load data with standard pandas — 100% native
df = pd.read_csv("sales.csv")

# 2. Clean effortlessly with chainable, explainable methods
df = (
    df.darsh.clean_names()
    .darsh.fill_missing(strategy="smart")
    .darsh.handle_outliers(columns=["price"], action="clip")
)

# 3. Use standard pandas methods anywhere in the chain
top_regions = df.groupby("region")["revenue"].sum().reset_index()

# 4. Generate styled matplotlib charts — returns real matplotlib.axes.Axes!
ax = top_regions.darsh.bar(x="region", y="revenue", title="Regional Revenue")

# 5. Native matplotlib methods work seamlessly
ax.figure.savefig("revenue.png", dpi=300)

⚡ Installation

pip install darsh

Dependencies: pandas>=2.0, matplotlib>=3.7, plotly>=5.0, fastapi>=0.100, uvicorn>=0.23.


🧼 Transparent Data Cleaning

Every cleaning method returns a real pandas.DataFrame and adheres to transparent, documented behavior:

df = (
    df.darsh.clean_names()                          # standardizes to snake_case identifiers
      .darsh.drop_duplicates()                      # removes exact duplicate rows
      .darsh.fill_missing(strategy="smart")         # median for numeric, mode for text; columns >30% missing untouched
      .darsh.handle_outliers(columns=["revenue"], action="clip") # IQR clipping
      .darsh.clean_text(columns=["notes"])          # strips whitespace, lowercases
      .darsh.add_date_features(columns=["order_date"]) # extracts year, month, day_name, is_weekend
      .darsh.infer_types()                          # casts dates, downcasts numerics, categorical optimization
)

Explainable Defaults

No silent, unexplainable mutations. For instance, fill_missing(strategy="smart") rules are plain English:

  • Numeric columns: Imputed using column median.
  • Text / Categorical columns: Imputed using column mode (or "Unknown" if no mode exists).
  • Columns with >30% missing data: Left untouched and flagged in .darsh.profile() rather than distorted.

🔍 Explainable Profiling & Quality Scoring

# Detailed tabular profile: dtype, % missing, cardinality, skew, and outlier count
profile_df = df.darsh.profile()
print(profile_df)

# Inspectable quality score (0 - 100)
score = df.darsh.quality_score()
print(f"Score: {score:.1f}/100")

# Plain-English diagnostic breakdown of score deductions
print(score.explain())

Example .explain() output:

Darsh Data Quality Score: 92.4/100.0
============================================
Identified 2 issue(s) affecting score:
  1. [Missing Data] Column 'customer_notes': -3.2 pts — 14 missing value(s) (4.2% missing)
  2. [Outliers] Column 'revenue': -4.4 pts — 18 outlier(s) (5.4% outside 1.5*IQR)
--------------------------------------------
Base: 100.0 | Total Deductions: -7.6 | Final: 92.4

📊 Visualizations: Matplotlib 2D & Plotly 3D

2D Charts (Matplotlib)

All 2D chart methods return real matplotlib.axes.Axes, accept optional ax=, and apply modern typography, palettes, and whitespace automatically:

import matplotlib.pyplot as plt

# Standalone or embedded in subplots
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(14, 5))

df.darsh.line(x="date", y="sales", title="Daily Trend", ax=ax1)
df.darsh.bar(x="category", y="sales", title="Category Sales", ax=ax2)

plt.tight_layout()
plt.show()

Available 2D chart methods:

  • df.darsh.line(x=..., y=..., title=..., ax=...)
  • df.darsh.bar(x=..., y=..., title=..., horizontal=False, ax=...)
  • df.darsh.scatter(x=..., y=..., size=..., color=..., ax=...)
  • df.darsh.donut(values=..., names=..., hole=0.55, ax=...)

3D Charts (Plotly)

Clearly labeled, Plotly-backed 3D visualizations returning real plotly.graph_objects.Figure:

fig = df.darsh.scatter_3d(x="price", y="units", z="margin", color="category")
fig.show()

Available 3D chart methods:

  • df.darsh.scatter_3d(x, y, z, color=None, size=None)
  • df.darsh.line_3d(x, y, z, color=None)
  • df.darsh.bar_3d(x, y, z)

🚀 One Unified Dashboard API

No competing OOP vs. procedural paradigms. Create dashboards directly using the charts and DataFrame you've already built:

import darsh

# 1. Create your charts
ax1 = df.darsh.line(x="order_date", y="revenue", title="Revenue Trend")
ax2 = df.darsh.bar(x="region", y="revenue", title="Revenue by Region")

# 2. Build dashboard with KPIs and reactive filter controls
app = darsh.dashboard(
    title="Sales Intelligence Hub",
    charts=[ax1, ax2],
    data=df,
    kpis=[
        darsh.kpi(label="Total Revenue", value=df["revenue"].sum(), delta="+12.4%"),
        darsh.kpi(label="Avg Order Value", value=df["revenue"].mean()),
        darsh.kpi(label="Orders", value=len(df)),
    ],
    filters=["region", "category"],
    theme="light",
)

# 3. Run the interactive local server
app.run(port=8501, open_browser=True)

# Or export standalone HTML
app.save_html("dashboard.html")

When users select filter values in the web UI, Darsh automatically filters the backing DataFrame and re-renders the charts in real-time.


🛡️ License

MIT License © 2026 Satyam Rana.

Metadata

Release files for darsh 2.0.0

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

Source distribution (sdist)

Source distribution for darsh 2.0.0
File Size Uploaded Provenance Actions
darsh-2.0.0.tar.gz 38.8 kB Without provenance Details for darsh-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for darsh 2.0.0
File Interpreter ABI Platform Actions
darsh-2.0.0-py3-none-any.whl Python 3 none any Details for darsh-2.0.0-py3-none-any.whl

Total release size: 71.1 kB

Release files / darsh-2.0.0.tar.gz

Download URL darsh-2.0.0.tar.gz
Size 38.8 kB
Tags Source
SHA-256 checksum
How to use checksums
48a830de4644e08e4e88a158b0f9840a53a23c549249816a4913fb8b81af57ef
BLAKE2b-256 checksum
How to use checksums
035be70d45399da2c90249a7b42274f902a9c91c17d2985478cc11626dcac713
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / darsh-2.0.0-py3-none-any.whl

Download URL darsh-2.0.0-py3-none-any.whl
Size 32.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
acb07522d34561049bda1c6e3b11f5d9e2fedb10ca2b51ea1b18eb7dc228e31d
BLAKE2b-256 checksum
How to use checksums
57ad1d836286141313b56c40044974016d089c8fcd178c3973ff49f7dd6cf94b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for darsh 2.0.0

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