sea-nymph
Do you want to show plots in your documentation? Do you want to avoid committing PNGs to git? Do you have an (un)reasonable dislike for SVG files? Look no further!
sea-nymph generates Mermaid charts from Python — plain text that renders natively on GitHub, GitLab, and most modern documentation tools. No image files, no binary blobs, no xml.
The API is modelled after seaborn: pass a DataFrame, name your columns, get a chart.
sea-nymph uses narwhals under the hood, so it accepts any DataFrame library — pandas, polars, PySpark, and more. Generate your markdown charts with distributed computing.
Installation
pip install sea-nymph
High-level API
import polars as pl
from sea_nymph import barplot, lineplot, countplot, histplot, kdeplot
df = pl.DataFrame({
"month": ["Jan", "Feb", "Mar", "Apr"],
"revenue": [10, 40, 30, 50],
"region": ["North", "North", "South", "South"],
})
fig = barplot(df, x="month", y="revenue")
print(fig.render())
xychart-beta
x-axis [Jan, Feb, Mar, Apr]
y-axis "Revenue" 0 --> 50
bar [10, 40, 30, 50]
Available plot functions
| Function | Description |
|---|---|
barplot |
Bar chart with optional aggregation |
lineplot |
Line chart with optional aggregation |
countplot |
Count (or proportion/percent) of categorical values |
histplot |
Histogram with configurable bins and statistics |
kdeplot |
Kernel density estimate using Silverman's rule |
All functions support a hue parameter for grouped series, hue_order and order for controlling category ordering, and palette for custom colours.
Hue
fig = barplot(df, x="month", y="revenue", hue="region", palette=["#4e79a7", "#f28e2b"])
Stat
countplot and histplot accept a stat parameter:
countplot(df, x="month", stat="percent") # "count" | "percent" | "proportion" | "probability"
histplot(df, x="revenue", stat="density") # "count" | "frequency" | "probability" | "proportion" | "percent" | "density"
Horizontal charts
Pass y instead of x to flip the orientation:
countplot(df, y="region")
kdeplot(df, y="revenue")
Low-level API
For full control, use XYChart from sea_nymph.mermaidplotlib directly:
from sea_nymph.mermaidplotlib import XYChart
months = ["Jan", "Feb", "Mar", "Apr"]
fig = XYChart()
fig.bar(months, [10, 40, 30, 50])
fig.line(months, [15, 35, 25, 45])
fig.xlabel("Month")
fig.ylabel("Revenue (k)")
fig.ylim(0, 60)
fig.title("Sales 2024")
print(fig.render())
xychart-beta
title "Sales 2024"
x-axis "Month" [Jan, Feb, Mar, Apr]
y-axis "Revenue (k)" 0 --> 60
bar [10, 40, 30, 50]
line [15, 35, 25, 45]
Limitations
Mermaid's xychart-beta places all data points equidistantly on the axis. This means:
- Line charts require evenly-spaced numeric x values — sea-nymph raises an error if they are not.
- Histograms require equal-width bins for the same reason — unequal bin widths are rejected.
Metadata
Release files for sea-nymph 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sea_nymph-1.1.0.tar.gz | 8.8 kB | With provenance | Details for sea_nymph-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sea_nymph-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for sea_nymph-1.1.0-py3-none-any.whl |
Total release size: 22.8 kB
Release files / sea_nymph-1.1.0.tar.gz
| Download URL | sea_nymph-1.1.0.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d26dcb01e5f2d020549b18a54e43668b94be7cd4f41183c6cfc4f6e319d97616
|
|
BLAKE2b-256 checksum How to use checksums |
9d3b0ad204ba1a1d237b99b28bbc359cb72bf10bfbbf660a246db99b3af73e12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 10, 2026.
Transparency logRelease files / sea_nymph-1.1.0-py3-none-any.whl
| Download URL | sea_nymph-1.1.0-py3-none-any.whl |
|---|---|
| Size | 14.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e1c9c8eabf396217c67ee6983c34059c15062935efe6af967b26b4f0896d69be
|
|
BLAKE2b-256 checksum How to use checksums |
c0eb0e15790e8f4be8ff84061ebf9a601e7f5dd6b9c270cc2adba0977833559b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 10, 2026.
Transparency logSecurity for sea-nymph 1.1.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for sea_nymph-1.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 10, 2026.
Transparency logA 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.