Skip to main content

Beautiful terminal output for Python. Zero dependencies.

Project description

✨ shinyshell

Beautiful terminal output for Python. Zero dependencies.
One import. 38 features. Pure stdlib.

PyPI Python License Downloads


📦 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.1.tar.gz (20.9 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.1-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: shinyshell-0.2.1.tar.gz
  • Upload date:
  • Size: 20.9 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.1.tar.gz
Algorithm Hash digest
SHA256 d08e2c19040a9caef6cb5781bc0034512d6eed28ff2f5cc9b53fc96f0b601fa8
MD5 99e14d889bdfe207f8ea8277338e9b81
BLAKE2b-256 1beaab4e0de30a534e509463ec1f7d0e4eca746fb047471b00e1772b3b5cc2c2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shinyshell-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 17.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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bd1141fb168fdfba59b26035079eab5cf49b617a2a3cc7a05941c988c627dcc3
MD5 e8436e180ea1753efb6e191a7a7e929c
BLAKE2b-256 ecc3db1371dbd33b1b2242aa0577498281c036ead2558ae899f2a40cc5dd716a

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