sparklines
Generate sparklines for numbers using Unicode characters only.
What it is and what it does
Sparklines is a terminal visualization tool that converts sequences of numbers into compact Unicode bar charts, inspired by Edward Tufte's concept of data-dense graphics. It renders data as a single row of Unicode characters (▁▂▃▄▅▆▇█) by default, with support for multi-line output for higher resolution, automatic handling of mixed positive/negative values (split across rows), and graceful rendering of missing data as gaps.
The package works both as a command-line tool and as a Python library. It's designed for quick visual summaries in contexts where traditional charts are impractical—monitoring sensor readings in IoT networks, tracking stock prices or trading volume, displaying request rates in DevOps dashboards, or visualizing training metrics in machine learning workflows. It depends only on termcolor for color support and runs on Python 3.9 through 3.13.
Use it for:
- Display IoT sensor readings (temperature, humidity, power) as compact inline charts in monitoring dashboards.
- Visualize stock price history or daily P&L (gains above, losses below) in finance terminals.
- Show request rate, error rate, or build duration trends in DevOps/SRE monitoring without opening a graphing tool.
- Track training loss and validation accuracy per epoch in machine learning experiments inline.
- Monitor token usage, cost per API call, or cache hit rates in agentic computing workflows.
- Plot heart rate, sleep quality, or blood glucose trends in health and fitness tracking applications.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Sparklines renders compact Unicode bar charts (▃▁▄▁▅█▂▅) in your terminal or Python code to visualize sequences of numbers, supporting mixed positive/negative data and missing values.
Yes. Sparklines is production-stable, actively maintained, has zero known vulnerabilities, installs with minimal friction, and solves a specific problem well: inline terminal visualization of numeric sequences. Install it if you need quick visual feedback on time-series data in shell scripts, monitoring tools, or Python notebooks without the overhead of a graphing library.
Install
sparklines on PyPI
pip
pip install sparklinesuv
uv add sparklinespoetry
poetry add sparklinesInstalling sparklines
Before you install
Installs cleanly with a single lightweight runtime dependency (termcolor). The package is actively maintained, marked Production/Stable, and has been in development since 2016 with a recent release.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open and closed projects with minimal attribution requirements.
Quickstart
pip install sparklines
from sparklines import sparklines
for line in sparklines([1, 2, 3, 4, 5.0, None, 3, 2, 1]):
print(line)
# ▁▃▅▆█ ▅▃▁
Requires Python 3.9 or later; terminal must support Unicode characters.
Verify before relying
- Whether the package handles very large datasets efficiently or has memory/performance limits.
- Whether color emphasis and line wrapping features are fully documented in the API.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — termcolor |
| Maintenance | actively maintained — 67 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,948,615/month — #2,192 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sparklines-1.0.0-py3-none-any.whl
Keywords: chart, tool, visualization
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
termcolorAdds ANSI color and text formatting (bold,…
permissive · top 1,000 on PyPI
richRich renders styled text, tables, progress…
permissive · top 100 on PyPI
progressbar2progressbar2 renders text-based progress bars…
permissive · top 5,000 on PyPI
termplotlibtermplotlib renders line plots, histograms, and…
copyleft · top 15,000 on PyPI
altexAltex wraps Altair to provide a simple,…
permissive · top 15,000 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
climageConverts images to ANSI escape code sequences…
permissive · top 15,000 on PyPI
coloredColored provides ANSI/VT100 escape sequences…
permissive · top 5,000 on PyPI
progressProvides terminal progress bars and spinners…
permissive · top 5,000 on PyPI
leatherLeather is a lightweight Python charting…
permissive · top 1,000 on PyPI