{"id":9493,"library":"asciichartpy","title":"Asciichartpy","description":"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.","status":"active","version":"1.5.25","language":"en","source_language":"en","source_url":"https://github.com/kroitor/asciichart","tags":["charting","cli","ascii","terminal","visualization"],"install":[{"cmd":"pip install asciichartpy","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"symbol":"plot","correct":"from asciichartpy import plot"}],"quickstart":{"code":"import asciichartpy\nimport math\n\n# Generate some sample data (a sine wave)\nseries_data = [2 * math.sin(i / 10.0) + 5 for i in range(120)]\n\n# Plot the series with a specified height\nchart_output = asciichartpy.plot(series_data, {'height': 10})\nprint(chart_output)\n\n# Plot multiple series\nseries_data_2 = [1 * math.cos(i / 15.0) + 5 for i in range(120)]\nmulti_series_output = asciichartpy.plot([series_data, series_data_2], {'height': 12})\nprint(\"\\n--- Multiple Series ---\\n\")\nprint(multi_series_output)","lang":"python","description":"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."},"warnings":[{"fix":"Ensure all elements in your input series are integers or floats before passing them to `plot()`.","message":"Input data for plotting must be numeric (list of floats or integers). Passing non-numeric types will result in runtime errors.","severity":"gotcha","affected_versions":"All"},{"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.","message":"For plotting multiple series, the input must be a list of lists. A single list is interpreted as a single series.","severity":"gotcha","affected_versions":"All"},{"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.","message":"The 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.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"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()]`.","cause":"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.","error":"TypeError: unsupported operand type(s) for +: 'int' and 'str'"},{"fix":"Call the correct function: `asciichartpy.plot(...)` or `from asciichartpy import plot; plot(...)`.","cause":"Incorrect function name. The primary plotting function in `asciichartpy` is named `plot`, not `chart`.","error":"AttributeError: module 'asciichartpy' has no attribute 'chart'"},{"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.","cause":"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.","error":"Chart output appears garbled or lines are broken/misaligned."}]}