bliplot
Stupidly simple terminal graphs. One function with zero config needed and sub-character resolution.
from bliplot import plot
print(plot([1, 4, 2, 8, 5, 7, 3, 9, 6]))
That's it. That's the whole API.
Why
Every terminal-plotting library makes you learn its DSL before you can see a
single number. bliplot is one function that takes a list and gives you back
a string. Print it, log it, pipe it, stream it... It doesn't care. It's yours !
Install
pip install bliplot
or, if you're using uv:
uv add bliplot
Usage
import math
from bliplot import plot
def generate_waveform(x: float) -> float:
return math.sin(x / 10) * math.cos(x / 5) * 10
data_points = [generate_waveform(x) for x in range(100)]
graph = plot(data_points, width=70, height=15, color="CYAN")
print(graph)
Live / streaming graphs
Because plot() just returns a string, you can call it in a loop for a
live-updating graph. No special "live mode" needed:
import math
import time
from bliplot import plot
CLEAR = "\033[H\033[J"
WIDTH = 80
HEIGHT = 15
# We run this for 200 frames of animation
for t in range(200):
lst = []
for x in range(WIDTH):
# Moving the x offset by t * 0.2 causes the wave to travel left to right
x_moving = x - (t * 0.2)
# Base wave + high frequency noise
wave = math.sin(x_moving * 0.2) * math.cos(x_moving * 0.05)
noise = 0.2 * math.sin(x_moving * 1.5)
# Center envelope to keep the edges clean
envelope = math.exp(-((x - (WIDTH / 2)) / (WIDTH / 3)) ** 2)
lst.append((wave + noise) * envelope)
# Overwrite the screen
print(
CLEAR + plot(lst, width=WIDTH, height=HEIGHT, color="GREEN"), end="", flush=True
)
time.sleep(0.04) # ~25 frames per second
The clear-screen escape redraws the graph in place instead of scrolling a new one down the terminal on every iteration.
Parameters
plot(lst: list, width: int = None, height: int = None, color: str = None) -> str
| Param | Type | Default | Description |
|---|---|---|---|
lst |
list | — | Y values to plot. X values are inferred from index. |
width |
int | terminal width | Graph width in characters. |
height |
int | terminal height | Graph height in characters. |
color |
str | None (renders as white) |
One of RESET, GREEN, CYAN, YELLOW, RED, MAGENTA, BLUE, WHITE, BLACK. |
Returns a string, ready to print().
NaN, +Inf, and -Inf values in lst are treated as 0.
How it works
Terminal graphs are usually blocky because each character cell can only be
"on" or "off" so you lose all the resolution between one row of blocks and
the next. bliplot fixes this by spliting each value into an integer part and a fractional
remainder. The integer part decides how many full blocks (█) to stack.
The remainder picks which of the 8 partial block glyphs
(▁▂▃▄▅▆▇█) caps the column, giving you roughly 8x the vertical resolution.
Negative values use the upper-eighth block set (▔🮂🮃▀🮄🮅🮆█) so bars
growing downward from the midline look correct rather than upside-down.
License
MIT
Release files for bliplot 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bliplot-0.1.4.tar.gz | 3.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bliplot-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.0 kB
Release files / bliplot-0.1.4.tar.gz
| Download URL | bliplot-0.1.4.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7792b04adb271deabf8d5f8aff5849b6aa1da184ce2be48e1cb3259a1d860c8b
|
|
BLAKE2b-256 checksum How to use checksums |
f9aa57bfc9970b8178060e1c80ea722487ecc2e3ab4669786643db171cc621f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / bliplot-0.1.4-py3-none-any.whl
| Download URL | bliplot-0.1.4-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d44260d1126c00586acbf506f49e9f67c01c6616661f8d772fc44d16edeb027f
|
|
BLAKE2b-256 checksum How to use checksums |
d6a1516cccfd74a9150dc676f085fb687de791d66d2ca5eecb0173f6e2f3b809
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|