Skip to main content

Python library for beautiful terminal output — colored printing, tables, progress bars, syntax highlighting, bar charts, QR codes, and more. Zero dependencies.

Project description

✨ shinyshell — Beautiful Terminal Output Library for Python

Python library for beautiful CLI output, colored terminal printing, progress bars,
tables, syntax highlighting, ASCII art, and interactive prompts — all with zero dependencies.

One import. 38 features. Pure Python stdlib. No pip install headaches.

PyPI Python Versions MIT License Downloads GitHub Stars


📦 Why shinyshell?

  • Zero dependencies — uses only Python standard library (os, sys, shutil)
  • 38 built-in features — tables, progress bars, code highlighting, diff viewer, JSON formatter, bar charts, QR codes, ASCII art, and more
  • Cross-platform — Linux, macOS, Windows Terminal, PowerShell, CMD, VS Code, PyCharm
  • Beginner-friendly — one import, intuitive API, no configuration needed
  • Production-ready — works in scripts, CLIs, CI/CD pipelines, Docker containers
  • Lightweight — ~950 lines of code, installs in seconds

Use Cases

Use Case Features You'll Use
CLI tool developer progress bars, spinners, headers, tables, confirm dialogs
Data scientist tables, bar charts, metrics dashboard, JSON viewer
DevOps engineer colored messages, benchmarks, env viewer, code blocks
Backend developer debug(), trace(), diff viewer, secret masking
Student/learner markdown renderer, ASCII art, QR codes, emoji helper

vs Alternatives

shinyshell rich colorama termcolor
Dependencies 0 10+ 0 0
Features 38 50+ 3 5
Install size ~25KB ~50MB ~20KB ~15KB
Tables
Progress bars
Code highlight
Bar charts
Timeline
QR codes
Debug/trace
Interactive

shinyshell is the sweet spot: rich's feature set with colorama's simplicity.


📦 Install

pip install shinyshell

That's it. No dependencies. Works everywhere: Linux, macOS, Windows (PowerShell/CMD/Terminal).


🚀 Quick Start

from shinyshell import Shell

sh = Shell()

# Basic messages
sh.success("Database migrated!")
sh.error("Connection failed")
sh.warning("Disk usage at 92%")
sh.info("Server running on port 8000")

Output:

 ✨ Database migrated!
 💥 Connection failed
 ⚠️ Disk usage at 92%
 ℹ️ Server running on port 8000

📚 Complete Feature Reference

1. Headers & Banners

# Level 1 header (boxed)
sh.header("DEPLOYMENT REPORT")

# Level 2 header (simple)
sh.header("Configuration", level=2)

# ASCII banner
sh.banner("SHINY")
sh.banner("HELLO", color="magenta")

2. Status Messages

sh.success("Build completed!")     # Green, checkmark
sh.error("API returned 500")       # Red, cross
sh.warning("Memory at 85%")        # Yellow, triangle
sh.info("Listening on :8000")      # Cyan, info circle

3. Horizontal Rules

# Simple divider
sh.hr()

# Labeled divider
sh.hr("Section 2")

4. Tables

users = [
    {"Name": "Alice Chen", "Role": "Backend", "Status": "Active"},
    {"Name": "Bob Kumar", "Role": "Frontend", "Status": "On Leave"},
    {"Name": "Carol Diaz", "Role": "DevOps", "Status": "Active"},
]

sh.table(users, title="Team Members")

# Border styles: single, double, round, bold, dashed
sh.table(data, style="round")

5. Metrics Dashboard

sh.metrics({
    "Users": 12483,
    "Active Now": 342,
    "Uptime": "✅ 99.9%",
    "Error Rate": "0.02%",
    "Avg Response": "23ms",
})

6. Boxed Content

sh.box(
    "API Key: sk-****abcd\nEndpoint: /v1/chat\nModel: deepseek-v4",
    title="Configuration"
)

7. Code Blocks

sh.code("""
def fibonacci(n):
    # Base case
    if n <= 1:
        return n
    return fibonacci(n-1) + fibonacci(n-2)
""")

# Supports Python keywords, strings, numbers, comments

8. Colored Diff

old_code = "def greet(name):\n    return 'Hello'"
new_code = "def greet(name, title=''):\n    return f'Hello {title} {name}'"

sh.diff(old_code, new_code, old_label="v1.py", new_label="v2.py")

9. Directory Tree

sh.tree("./myproject")
sh.tree("./src", max_depth=2)
sh.tree(".", exclude=["node_modules", ".git", "__pycache__"])

10. JSON Pretty Print

sh.json({
    "user": {"name": "Alice", "age": 30, "active": True},
    "stats": {"posts": 142, "followers": 1200},
})
# Syntax-colored output: green keys, yellow strings, cyan numbers, magenta booleans

11. Markdown Rendering

sh.markdown("""
# Main Title
## Subtitle
### Section

- Bullet point one
- Bullet point two

> This is a blockquote

**Bold text**
""")

12. Bar Charts

sh.bar({
    "Python": 85,
    "JavaScript": 62,
    "Go": 45,
    "Rust": 38,
    "Ruby": 22,
}, title="Language Usage", color="magenta")

13. Timeline

sh.timeline([
    {"date": "Jan 2024", "title": "v1.0 Released", "desc": "Initial launch with 17 features"},
    {"date": "Mar 2024", "title": "v1.5 Update", "desc": "Added tables and metrics"},
    {"date": "Jun 2024", "title": "v2.0 Major", "desc": "19 new features added"},
])

14. Columns

features = ["success()", "error()", "table()", "code()", "tree()",
            "diff()", "json()", "bar()", "qr()", "live()"]

sh.columns(features, cols=3)

15. Badges

print(sh.badge("v2.0", "green"))
print(sh.badge("BETA", "yellow"))
print(sh.badge("ERROR", "red"))
print(sh.badge("INFO", "cyan"))

16. QR Codes

sh.qr("https://github.com/adnanahamed66772ndpc/shinyshell", title="Scan to visit repo")
sh.qr("Hello World")

17. Clickable Links

print(sh.link("Visit GitHub", "https://github.com/adnanahamed66772ndpc/shinyshell"))
print(sh.link("Documentation", "https://pypi.org/project/shinyshell/"))

18. Secret Masking

print(sh.secret("sk-abc123def456ghi789"))  # Output: sk-a****i789
print(sh.secret("my-password-here", visible=2))  # Output: my********re

19. Emoji Lookup

print(sh.emoji("rocket"))     # 🚀
print(sh.emoji("fire"))       # 🔥
print(sh.emoji("star"))       # ⭐
print(sh.emoji("party"))      # 🎉

20. Environment Variables

# Show all env vars
sh.env()

# Filter by prefix
sh.env("PYTHON")
sh.env("AWS_")

# Security: KEY, SECRET, TOKEN, PASSWORD values are auto-masked

21. Version Info

sh.version()
# Output: Python, OS, shinyshell version, terminal size, color support

22. Debug

user = {"name": "Alice", "age": 30}
status = "active"

sh.debug(user, status)

# Output:
# 🔍 app.py:42
#  arg0 dict {'name': 'Alice', 'age': 30}
#  arg1 str 'active'

23. Benchmark

with sh.benchmark("Processing data"):
    # Your heavy computation here
    data = [i**2 for i in range(1000000)]

# Output:
# ⏱️  Processing data ........ 0.12s

24. Progress Bar

update = sh.progress("Uploading files")
for i in range(100):
    time.sleep(0.02)
    update(i + 1, 100)

25. Steps Tracker

step = sh.steps("Deploy to Production", total=5)

step("Building Docker image...")
step("Running tests...")
step("Pushing to registry...")
step("Updating service...")
step("Health check...")

26. Animated Spinner

sh.spinner("Installing dependencies...", duration=2.0)

27. Countdown

sh.countdown(5, "Launching rocket")

28. Live Display

with sh.live() as display:
    for i in range(100):
        display(f"Processing... {i+1}%")
        time.sleep(0.03)

29. Confirm (Yes/No)

if sh.confirm("Deploy to production?"):
    sh.success("Deploying...")
else:
    sh.info("Deployment cancelled")

30. Choice (Pick from options)

env = sh.choice("Select environment:", ["Development", "Staging", "Production"])
sh.info(f"Selected: {env}")

31. Function Trace Decorator

@sh.trace
def process_data(items):
    return len(items) * 2

result = process_data([1, 2, 3, 4, 5])

# Output:
# ⚙️ process_data([1, 2, 3, 4, 5]) → 0.001s

# Disable argument logging for sensitive functions:
@sh.trace(log_args=False)
def login(username, password):
    return True

32. Image to ASCII Art

sh.image("screenshot.png", width=80)
sh.image("logo.jpg", width=60)

# Requires: pip install Pillow (optional)

33. Gradient Ruler

sh.rule()
sh.rule("API Response")

🔧 Configuration

sh = Shell(
    color=True,   # Enable/disable ANSI colors
    width=100,    # Custom terminal width
)

📊 Feature Summary

Category Features
Messages success, error, warning, info
Layout header, banner, hr, rule, box
Data Display table, metrics, json, bar, timeline, columns
Code code, diff, markdown
Progress spinner, progress, steps, countdown, benchmark, live
Interactive confirm, choice
Debug debug, trace, version, env
Files tree, image
Utilities badge, secret, link, emoji, qr
Total 38 features, 0 dependencies, ~950 lines

🌍 Platform Support

Platform Status
Linux (GNOME/KDE/tmux) ✅ Full
macOS (Terminal/iTerm2) ✅ Full
Windows Terminal ✅ Full
Windows PowerShell ✅ Full
Windows CMD ✅ Full (Win 10+)
VS Code Terminal ✅ Full
JetBrains Terminal ✅ Full
CI/CD (GitHub Actions) ✅ Full

🤝 Contributing

git clone https://github.com/adnanahamed66772ndpc/shinyshell.git
cd shinyshell
pip install -e .

Pull requests welcome! Check issues for ideas.


📄 License

MIT — © 2026 Adnan Ahamed Himal


⭐ Support

If this library saved you time, give it a star on GitHub. It helps others find it too!

⭐ Star on GitHub  ·  📦 View on PyPI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shinyshell-0.2.2.tar.gz (23.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shinyshell-0.2.2-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file shinyshell-0.2.2.tar.gz.

File metadata

  • Download URL: shinyshell-0.2.2.tar.gz
  • Upload date:
  • Size: 23.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for shinyshell-0.2.2.tar.gz
Algorithm Hash digest
SHA256 515658de056856b47059f01986d8903caf9d6a03a387aec7831c873fc578a16c
MD5 f6ec0cb3b886f6959ecc4e28b6b6426e
BLAKE2b-256 83be54d755dff4b1c5e6946415d14d61455831e646312fd2cb1377e71632af89

See more details on using hashes here.

File details

Details for the file shinyshell-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: shinyshell-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for shinyshell-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0e2acfb16e0f0c2f8f856ddb3c5d08d545735a91bc7c57bd61a6c74e433e4bbb
MD5 6a9d5cf6ffbff6913f39f8caf228c137
BLAKE2b-256 5f0223e59b66a5194b791d90d4b7404c06b651da55701259b594f5994148f38c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page