━━━━━━━━━━━━ c o d e c h u · s p a r k ━━━━━━━━━━━━
load: ▁▃▄▆█▇▅▃▂▁ sparkline
disk: ████▆▆▅▅▄▃▂▁ (downsamples)
io: ░░▒▒▓▓██▓▓▒░ heatmap
python ████████████████████ 42 bar_chart
rust ████████ 17
go ███ 8
━━━━━━━━━━ one line. one glance. one truth. ━━━━━━━━━
Unicode sparklines, mini bar charts, and 1-D heatmaps — pure text.
Stdlib-only text visualizations: single-row charts that fit a log line, a status field, or a dashboard cell. No GUI, no external deps — just Unicode block elements arranged for one-glance readability.
pip install codechu-sparkPython 3.10+. Zero third-party dependencies.
from codechu_spark import sparkline, bar_chart, heatmap
print(sparkline([1, 3, 7, 2, 5])) # ▁▃█▂▅
print(sparkline(list(range(100)), width=10)) # downsampled by averaging
print(bar_chart([("python", 42), ("rust", 17), ("go", 8)], width=20))
print(heatmap([0, 1, 2, 3, 4])) # ' ░▒▓█'sparkline— one-row Unicode chart. Auto-downsamples by averaging when the data is wider than the target.multi_sparkline— multiple series stacked on adjacent lines.sparkline_with_axis— sparkline with min/max axis labels.bar_chart— multi-line labeled horizontal bars; scaled to the maximum value, labels left-aligned.heatmap— denser-than-sparkline single-row intensity readout.
All functions accept a custom chars= ramp (low → high) so you can
swap in ASCII fallbacks, color characters, or your own glyph set.
- API reference — every public symbol with signatures and edge-case tables.
- Recipes — sparkline windows, top-N bars, 1-D heatmaps, custom ramps, terminal-width downsampling.
- Migration guide — 0.1 → 0.2 (internal refactor, no API changes).
- Changelog
| Library | Purpose |
|---|---|
| codechu-cli | CLI primitives — colors, progress, spinners, prompts |
| codechu-fmt | Human-readable sizes, durations, rates |
| codechu-meter | Timing — stopwatch, ETA, rate, histogram |
| codechu-term | Terminal capabilities, alt buffer, raw mode |
| codechu-treeviz | Treemap + sunburst layouts |
Full ecosystem: github.com/codechu.
- Unicode block elements per The Unicode Standard.
- Conceptual lineage from Edward Tufte's "sparkline" notion (Beautiful Evidence, 2006).
MIT — see LICENSE.
Part of Codechu.