Registry / data / asciichartpy

asciichartpy

JSON →
library1.5.25pypypi✓ verified 85d ago

Asciichartpy is a lightweight Python library for drawing nice-looking console ASCII line charts directly in your terminal. It offers simple, dependency-free charting for command-line applications and scripts. The current version is 1.5.25, with releases occurring periodically to address minor issues and improvements.

pip install asciichartpy
INSTALL
IMPORT
SIG · ASCIICHARTPY
A
asciichartpy
datapythonv1.5.25
Install
1.8s avg
Import
Disk
19MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.5.25 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 1.8s · import 0.000s · 18MB
19MB installed
● package 19MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plot
from asciichartpy import plot

This quickstart demonstrates how to plot a single numeric series and multiple series using `asciichartpy.plot`. It generates a sine wave as sample data and prints the ASCII chart directly to the console. The `height` option is used to control the chart's vertical size.

import asciichartpy import math # Generate some sample data (a sine wave) series_data = [2 * math.sin(i / 10.0) + 5 for i in range(120)] # Plot the series with a specified height chart_output = asciichartpy.plot(series_data, {'height': 10}) print(chart_output) # Plot multiple series series_data_2 = [1 * math.cos(i / 15.0) + 5 for i in range(120)] multi_series_output = asciichartpy.plot([series_data, series_data_2], {'height': 12}) print("\n--- Multiple Series ---\n") print(multi_series_output)
Debug
Known issues
gotchaInput data for plotting must be numeric (list of floats or integers). Passing non-numeric types will result in runtime errors.
fix
Ensure all elements in your input series are integers or floats before passing them to `plot()`.
affects: All
gotchaFor plotting multiple series, the input must be a list of lists. A single list is interpreted as a single series.
fix
If you have `series1` and `series2`, pass them as `asciichartpy.plot([series1, series2], ...)` not `asciichartpy.plot(series1, series2, ...)`. Each inner list represents one series.
affects: All
gotchaThe visual quality of ASCII charts can vary depending on your terminal emulator, font, and window width. Charts might appear truncated or misaligned in narrow terminals or with non-monospaced fonts.
fix
Use a monospaced font, ensure your terminal window is sufficiently wide, and experiment with the `height` and `offset` options to optimize rendering for your environment.
affects: All
Errors
Common errors & fixes
TypeError: unsupported operand type(s) for +: 'int' and 'str'
Attempting to plot a series containing non-numeric data (e.g., strings mixed with numbers). `asciichartpy` expects all series values to be integers or floats.
fix
Cleanse your data to ensure all values in the series are convertible to numbers. Example: `data = [float(x) for x in raw_data if x.isdigit()]`.
AttributeError: module 'asciichartpy' has no attribute 'chart'
Incorrect function name. The primary plotting function in `asciichartpy` is named `plot`, not `chart`.
fix
Call the correct function: `asciichartpy.plot(...)` or `from asciichartpy import plot; plot(...)`.
Chart output appears garbled or lines are broken/misaligned.
This often occurs when the terminal's character encoding is not correctly interpreted, or due to a font issue, especially on Windows or older terminals.
fix
Ensure your terminal is using a UTF-8 encoding (e.g., `chcp 65001` on Windows CMD/PowerShell, or check locale settings on Linux/macOS). Using a modern terminal emulator (like Windows Terminal, Alacritty, iTerm2) and a suitable monospaced font (e.g., Fira Code, Source Code Pro) can resolve most rendering issues.
Upgrade
Version history
1.5.25latest on PyPI · released Aug 17, 2020
Audit
Dependencies

No dependency data recorded yet.

Agent activity
49 hits · last 30 days
node
44
OpenAI (training)
1
Resources
asciichartpy — pip install asciichartpy · libregistry