Skip to content
ahnaf-labPublic

About

A terminal TUI where you type any short string, a name, a quote, and it deterministically generates a unique constellation from the hash of that text: star positions, brightness, connecting lines,…

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

starbind

A terminal tool that turns any short string into a deterministic constellation. Type a name, a quote, anything, and the same text always produces the same sky: the same star positions, the same brightness, the same shape. Hand someone your input and their sky looks exactly like yours.

Currently implemented: hashing an input string into a seeded random number generator, placing a star field (position and brightness per star) from it, connecting the stars with a deterministic spanning-tree line pattern (the minimum spanning tree over star positions), an interactive terminal viewer with pan and zoom, and a short mythological legend assembled from a template grammar seeded the same way as the stars.

Install

No external dependencies — everything here is Python standard library (hashlib, random, argparse, dataclasses, curses). Requires Python 3.9+. curses ships with Python on Linux and macOS; the interactive viewer (--tui) needs a real terminal and is not available on stock Windows Python, but the plain text listing works everywhere.

Clone the repository and run it directly from the project root; no build step or package install is required:

git clone <this-repo>
cd starbind

Usage

Run the CLI module with any string to see the star field and the lines connecting it:

python3 -m starbind "hello world"

Optional flags control the sky's dimensions and how many stars can appear:

python3 -m starbind "hello world" --width 100 --height 30 --min-stars 8 --max-stars 16

Running the same text with the same flags always prints the same stars, the same connecting lines, and the same legend below them: a constellation name and a short two-sentence myth assembled from fixed word lists chosen by the same kind of seeded random draw used for the stars.

Add --tui to open an interactive full-screen viewer of the same star field instead of the text listing:

python3 -m starbind "hello world" --tui

Controls in the viewer: arrow keys or h/j/k/l pan the sky, +/- zoom in and out, i toggles the legend in the status line, and q (or Esc) quits.

Run the test suite with:

python3 -m unittest discover -s tests

The suite includes golden tests (tests/test_golden.py) that pin exact star positions, line endpoints, and legend text for a handful of fixed inputs, so an unintended change to the generation algorithms is caught even if it still happens to be internally self-consistent.

Status

This project is being built autonomously, milestone by milestone. Each milestone is only kept if it builds cleanly and its automated tests pass.

About

A terminal TUI where you type any short string, a name, a quote, and it deterministically generates a unique constellation from the hash of that text: star positions, brightness, connecting lines,…

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages