An open API service indexing awesome lists of open source software.

https://github.com/maxverwiebe/termspin

Spinners and ProgressBars in terminal-based CLIs
https://github.com/maxverwiebe/termspin

cli helper library progressbar python python3 spinner

Last synced: 10 months ago
JSON representation

Spinners and ProgressBars in terminal-based CLIs

Awesome Lists containing this project

README

          

# TermSpin

*A tiny Python 3 helper for stylish terminal feedback.*

![output](https://github.com/user-attachments/assets/86d6ac8c-1340-42e2-a4de-de430378797f)

---

## Features

* Animated **spinners** & progress **bars** with ANSI colours
* Context‑manager API (`with Spinner(): …`)
* Configurable speed, colours, symbols
* ETA calculation for progress bars
* Zero dependencies – pure standard library

## Installation

1. Clone this repo
2. Move termspin dir into your project src code
3. Import termspin as seen in the examples

*PyPi coming soon :)*

## Quick Start

```python
# example1.py
from termspin import Spinner, SpinnerStyle

with Spinner(text="Thinking", theme=SpinnerStyle.WAVE, color="\033[96m"):
heavy_calculation()
```

```python
# example2.py
from termspin import ProgressBar, BarStyle

bar = ProgressBar(total=100, style=BarStyle.STRIPED, show_eta=True)
for _ in range(100):
do_work()
bar.step()
bar.finish()
```

---

## Spinner Themes

| Enum | Preview | |
| ------- | ----------------- | - |
| `DOTS` | ⠋⠙⠹⠸⠼ … | |
| `LINE` | - \\ | / |
| `ARROW` | → ↘ ↓ ↙ ← ↖ ↑ ↗ | |
| `EARTH` | 🌍 🌎 🌏 | |
| `CLOCK` | 🕛 🕐 🕑 … 🕚 | |
| `WAVE` | ▁ ▂ ▃ ▄ ▅ ▆ ▇ █ … | |

## Progress‑Bar Styles

| Enum | Fill | Empty | Borders | |
| --------- | ---- | ----- | ------- | - |
| `CLASSIC` | = | - | \[ ] | |
| `BOLD` | ■ | ␣ | ❮ ❯ | |
| `MINIMAL` | \* | ␣ | | |
| `HASH` | # | . | \[ ] | |
| `EMOJI` | 🚀 | ✨ | 🚩 🎯 | |
| `ROUNDED` | ● | ○ | ( ) | |
| `STRIPED` | ▉ | ▏ | \[ ] | |
| `DOT` | • | · | { } | |
| `HEART` | ❤ | ♡ | ❤ ❤ | |
| `MUSIC` | ♫ | ♩ | ♪ ♪ | |
| `DNA` | ▰ | ▱ | ⎡ ⎤ | |
| `PIXEL` | █ | ░ | ▐ ▌ | |