shinyshell 0.2.0__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,492 @@
1
+ Metadata-Version: 2.4
2
+ Name: shinyshell
3
+ Version: 0.2.1
4
+ Summary: Beautiful terminal output for Python. Zero dependencies.
5
+ Home-page: https://github.com/adnanahamed66772ndpc/shinyshell
6
+ Author: Adnan Ahamed Himal
7
+ Keywords: terminal,shell,pretty,beautiful,output,cli,print,colors
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.8
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
+ Classifier: Topic :: Terminals
19
+ Classifier: Environment :: Console
20
+ Requires-Python: >=3.8
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Dynamic: author
24
+ Dynamic: classifier
25
+ Dynamic: description
26
+ Dynamic: description-content-type
27
+ Dynamic: home-page
28
+ Dynamic: keywords
29
+ Dynamic: license-file
30
+ Dynamic: requires-python
31
+ Dynamic: summary
32
+
33
+ # ✨ shinyshell
34
+
35
+ <p align="center">
36
+ <b>Beautiful terminal output for Python. Zero dependencies.</b><br>
37
+ <i>One import. 38 features. Pure stdlib.</i>
38
+ </p>
39
+
40
+ <p align="center">
41
+ <a href="https://pypi.org/project/shinyshell/"><img src="https://img.shields.io/pypi/v/shinyshell?color=green&label=PyPI" alt="PyPI"></a>
42
+ <a href="https://pypi.org/project/shinyshell/"><img src="https://img.shields.io/pypi/pyversions/shinyshell" alt="Python"></a>
43
+ <a href="https://github.com/adnanahamed66772ndpc/shinyshell/blob/main/LICENSE"><img src="https://img.shields.io/github/license/adnanahamed66772ndpc/shinyshell" alt="License"></a>
44
+ <a href="https://pypi.org/project/shinyshell/"><img src="https://img.shields.io/pypi/dm/shinyshell" alt="Downloads"></a>
45
+ </p>
46
+
47
+ ---
48
+
49
+ ## 📦 Install
50
+
51
+ ```bash
52
+ pip install shinyshell
53
+ ```
54
+
55
+ That's it. No dependencies. Works everywhere: **Linux, macOS, Windows (PowerShell/CMD/Terminal)**.
56
+
57
+ ---
58
+
59
+ ## 🚀 Quick Start
60
+
61
+ ```python
62
+ from shinyshell import Shell
63
+
64
+ sh = Shell()
65
+
66
+ # Basic messages
67
+ sh.success("Database migrated!")
68
+ sh.error("Connection failed")
69
+ sh.warning("Disk usage at 92%")
70
+ sh.info("Server running on port 8000")
71
+ ```
72
+
73
+ **Output:**
74
+ ```
75
+ ✨ Database migrated!
76
+ 💥 Connection failed
77
+ ⚠️ Disk usage at 92%
78
+ ℹ️ Server running on port 8000
79
+ ```
80
+
81
+ ---
82
+
83
+ ## 📚 Complete Feature Reference
84
+
85
+ ### 1. Headers & Banners
86
+
87
+ ```python
88
+ # Level 1 header (boxed)
89
+ sh.header("DEPLOYMENT REPORT")
90
+
91
+ # Level 2 header (simple)
92
+ sh.header("Configuration", level=2)
93
+
94
+ # ASCII banner
95
+ sh.banner("SHINY")
96
+ sh.banner("HELLO", color="magenta")
97
+ ```
98
+
99
+ ### 2. Status Messages
100
+
101
+ ```python
102
+ sh.success("Build completed!") # Green, checkmark
103
+ sh.error("API returned 500") # Red, cross
104
+ sh.warning("Memory at 85%") # Yellow, triangle
105
+ sh.info("Listening on :8000") # Cyan, info circle
106
+ ```
107
+
108
+ ### 3. Horizontal Rules
109
+
110
+ ```python
111
+ # Simple divider
112
+ sh.hr()
113
+
114
+ # Labeled divider
115
+ sh.hr("Section 2")
116
+ ```
117
+
118
+ ### 4. Tables
119
+
120
+ ```python
121
+ users = [
122
+ {"Name": "Alice Chen", "Role": "Backend", "Status": "Active"},
123
+ {"Name": "Bob Kumar", "Role": "Frontend", "Status": "On Leave"},
124
+ {"Name": "Carol Diaz", "Role": "DevOps", "Status": "Active"},
125
+ ]
126
+
127
+ sh.table(users, title="Team Members")
128
+
129
+ # Border styles: single, double, round, bold, dashed
130
+ sh.table(data, style="round")
131
+ ```
132
+
133
+ ### 5. Metrics Dashboard
134
+
135
+ ```python
136
+ sh.metrics({
137
+ "Users": 12483,
138
+ "Active Now": 342,
139
+ "Uptime": "✅ 99.9%",
140
+ "Error Rate": "0.02%",
141
+ "Avg Response": "23ms",
142
+ })
143
+ ```
144
+
145
+ ### 6. Boxed Content
146
+
147
+ ```python
148
+ sh.box(
149
+ "API Key: sk-****abcd\nEndpoint: /v1/chat\nModel: deepseek-v4",
150
+ title="Configuration"
151
+ )
152
+ ```
153
+
154
+ ### 7. Code Blocks
155
+
156
+ ```python
157
+ sh.code("""
158
+ def fibonacci(n):
159
+ # Base case
160
+ if n <= 1:
161
+ return n
162
+ return fibonacci(n-1) + fibonacci(n-2)
163
+ """)
164
+
165
+ # Supports Python keywords, strings, numbers, comments
166
+ ```
167
+
168
+ ### 8. Colored Diff
169
+
170
+ ```python
171
+ old_code = "def greet(name):\n return 'Hello'"
172
+ new_code = "def greet(name, title=''):\n return f'Hello {title} {name}'"
173
+
174
+ sh.diff(old_code, new_code, old_label="v1.py", new_label="v2.py")
175
+ ```
176
+
177
+ ### 9. Directory Tree
178
+
179
+ ```python
180
+ sh.tree("./myproject")
181
+ sh.tree("./src", max_depth=2)
182
+ sh.tree(".", exclude=["node_modules", ".git", "__pycache__"])
183
+ ```
184
+
185
+ ### 10. JSON Pretty Print
186
+
187
+ ```python
188
+ sh.json({
189
+ "user": {"name": "Alice", "age": 30, "active": True},
190
+ "stats": {"posts": 142, "followers": 1200},
191
+ })
192
+ # Syntax-colored output: green keys, yellow strings, cyan numbers, magenta booleans
193
+ ```
194
+
195
+ ### 11. Markdown Rendering
196
+
197
+ ```python
198
+ sh.markdown("""
199
+ # Main Title
200
+ ## Subtitle
201
+ ### Section
202
+
203
+ - Bullet point one
204
+ - Bullet point two
205
+
206
+ > This is a blockquote
207
+
208
+ **Bold text**
209
+ """)
210
+ ```
211
+
212
+ ### 12. Bar Charts
213
+
214
+ ```python
215
+ sh.bar({
216
+ "Python": 85,
217
+ "JavaScript": 62,
218
+ "Go": 45,
219
+ "Rust": 38,
220
+ "Ruby": 22,
221
+ }, title="Language Usage", color="magenta")
222
+ ```
223
+
224
+ ### 13. Timeline
225
+
226
+ ```python
227
+ sh.timeline([
228
+ {"date": "Jan 2024", "title": "v1.0 Released", "desc": "Initial launch with 17 features"},
229
+ {"date": "Mar 2024", "title": "v1.5 Update", "desc": "Added tables and metrics"},
230
+ {"date": "Jun 2024", "title": "v2.0 Major", "desc": "19 new features added"},
231
+ ])
232
+ ```
233
+
234
+ ### 14. Columns
235
+
236
+ ```python
237
+ features = ["success()", "error()", "table()", "code()", "tree()",
238
+ "diff()", "json()", "bar()", "qr()", "live()"]
239
+
240
+ sh.columns(features, cols=3)
241
+ ```
242
+
243
+ ### 15. Badges
244
+
245
+ ```python
246
+ print(sh.badge("v2.0", "green"))
247
+ print(sh.badge("BETA", "yellow"))
248
+ print(sh.badge("ERROR", "red"))
249
+ print(sh.badge("INFO", "cyan"))
250
+ ```
251
+
252
+ ### 16. QR Codes
253
+
254
+ ```python
255
+ sh.qr("https://github.com/adnanahamed66772ndpc/shinyshell", title="Scan to visit repo")
256
+ sh.qr("Hello World")
257
+ ```
258
+
259
+ ### 17. Clickable Links
260
+
261
+ ```python
262
+ print(sh.link("Visit GitHub", "https://github.com/adnanahamed66772ndpc/shinyshell"))
263
+ print(sh.link("Documentation", "https://pypi.org/project/shinyshell/"))
264
+ ```
265
+
266
+ ### 18. Secret Masking
267
+
268
+ ```python
269
+ print(sh.secret("sk-abc123def456ghi789")) # Output: sk-a****i789
270
+ print(sh.secret("my-password-here", visible=2)) # Output: my********re
271
+ ```
272
+
273
+ ### 19. Emoji Lookup
274
+
275
+ ```python
276
+ print(sh.emoji("rocket")) # 🚀
277
+ print(sh.emoji("fire")) # 🔥
278
+ print(sh.emoji("star")) # ⭐
279
+ print(sh.emoji("party")) # 🎉
280
+ ```
281
+
282
+ ### 20. Environment Variables
283
+
284
+ ```python
285
+ # Show all env vars
286
+ sh.env()
287
+
288
+ # Filter by prefix
289
+ sh.env("PYTHON")
290
+ sh.env("AWS_")
291
+
292
+ # Security: KEY, SECRET, TOKEN, PASSWORD values are auto-masked
293
+ ```
294
+
295
+ ### 21. Version Info
296
+
297
+ ```python
298
+ sh.version()
299
+ # Output: Python, OS, shinyshell version, terminal size, color support
300
+ ```
301
+
302
+ ### 22. Debug
303
+
304
+ ```python
305
+ user = {"name": "Alice", "age": 30}
306
+ status = "active"
307
+
308
+ sh.debug(user, status)
309
+
310
+ # Output:
311
+ # 🔍 app.py:42
312
+ # arg0 dict {'name': 'Alice', 'age': 30}
313
+ # arg1 str 'active'
314
+ ```
315
+
316
+ ---
317
+
318
+ ### 23. Benchmark
319
+
320
+ ```python
321
+ with sh.benchmark("Processing data"):
322
+ # Your heavy computation here
323
+ data = [i**2 for i in range(1000000)]
324
+
325
+ # Output:
326
+ # ⏱️ Processing data ........ 0.12s
327
+ ```
328
+
329
+ ### 24. Progress Bar
330
+
331
+ ```python
332
+ update = sh.progress("Uploading files")
333
+ for i in range(100):
334
+ time.sleep(0.02)
335
+ update(i + 1, 100)
336
+ ```
337
+
338
+ ### 25. Steps Tracker
339
+
340
+ ```python
341
+ step = sh.steps("Deploy to Production", total=5)
342
+
343
+ step("Building Docker image...")
344
+ step("Running tests...")
345
+ step("Pushing to registry...")
346
+ step("Updating service...")
347
+ step("Health check...")
348
+ ```
349
+
350
+ ### 26. Animated Spinner
351
+
352
+ ```python
353
+ sh.spinner("Installing dependencies...", duration=2.0)
354
+ ```
355
+
356
+ ### 27. Countdown
357
+
358
+ ```python
359
+ sh.countdown(5, "Launching rocket")
360
+ ```
361
+
362
+ ### 28. Live Display
363
+
364
+ ```python
365
+ with sh.live() as display:
366
+ for i in range(100):
367
+ display(f"Processing... {i+1}%")
368
+ time.sleep(0.03)
369
+ ```
370
+
371
+ ### 29. Confirm (Yes/No)
372
+
373
+ ```python
374
+ if sh.confirm("Deploy to production?"):
375
+ sh.success("Deploying...")
376
+ else:
377
+ sh.info("Deployment cancelled")
378
+ ```
379
+
380
+ ### 30. Choice (Pick from options)
381
+
382
+ ```python
383
+ env = sh.choice("Select environment:", ["Development", "Staging", "Production"])
384
+ sh.info(f"Selected: {env}")
385
+ ```
386
+
387
+ ### 31. Function Trace Decorator
388
+
389
+ ```python
390
+ @sh.trace
391
+ def process_data(items):
392
+ return len(items) * 2
393
+
394
+ result = process_data([1, 2, 3, 4, 5])
395
+
396
+ # Output:
397
+ # ⚙️ process_data([1, 2, 3, 4, 5]) → 0.001s
398
+
399
+ # Disable argument logging for sensitive functions:
400
+ @sh.trace(log_args=False)
401
+ def login(username, password):
402
+ return True
403
+ ```
404
+
405
+ ### 32. Image to ASCII Art
406
+
407
+ ```python
408
+ sh.image("screenshot.png", width=80)
409
+ sh.image("logo.jpg", width=60)
410
+
411
+ # Requires: pip install Pillow (optional)
412
+ ```
413
+
414
+ ### 33. Gradient Ruler
415
+
416
+ ```python
417
+ sh.rule()
418
+ sh.rule("API Response")
419
+ ```
420
+
421
+ ---
422
+
423
+ ## 🔧 Configuration
424
+
425
+ ```python
426
+ sh = Shell(
427
+ color=True, # Enable/disable ANSI colors
428
+ width=100, # Custom terminal width
429
+ )
430
+ ```
431
+
432
+ ---
433
+
434
+ ## 📊 Feature Summary
435
+
436
+ | Category | Features |
437
+ |----------|----------|
438
+ | Messages | `success`, `error`, `warning`, `info` |
439
+ | Layout | `header`, `banner`, `hr`, `rule`, `box` |
440
+ | Data Display | `table`, `metrics`, `json`, `bar`, `timeline`, `columns` |
441
+ | Code | `code`, `diff`, `markdown` |
442
+ | Progress | `spinner`, `progress`, `steps`, `countdown`, `benchmark`, `live` |
443
+ | Interactive | `confirm`, `choice` |
444
+ | Debug | `debug`, `trace`, `version`, `env` |
445
+ | Files | `tree`, `image` |
446
+ | Utilities | `badge`, `secret`, `link`, `emoji`, `qr` |
447
+ | **Total** | **38 features, 0 dependencies, ~950 lines** |
448
+
449
+ ---
450
+
451
+ ## 🌍 Platform Support
452
+
453
+ | Platform | Status |
454
+ |----------|--------|
455
+ | Linux (GNOME/KDE/tmux) | ✅ Full |
456
+ | macOS (Terminal/iTerm2) | ✅ Full |
457
+ | Windows Terminal | ✅ Full |
458
+ | Windows PowerShell | ✅ Full |
459
+ | Windows CMD | ✅ Full (Win 10+) |
460
+ | VS Code Terminal | ✅ Full |
461
+ | JetBrains Terminal | ✅ Full |
462
+ | CI/CD (GitHub Actions) | ✅ Full |
463
+
464
+ ---
465
+
466
+ ## 🤝 Contributing
467
+
468
+ ```bash
469
+ git clone https://github.com/adnanahamed66772ndpc/shinyshell.git
470
+ cd shinyshell
471
+ pip install -e .
472
+ ```
473
+
474
+ Pull requests welcome! Check [issues](https://github.com/adnanahamed66772ndpc/shinyshell/issues) for ideas.
475
+
476
+ ---
477
+
478
+ ## 📄 License
479
+
480
+ MIT — © 2026 [Adnan Ahamed Himal](https://adnanahamedhimal.com)
481
+
482
+ ---
483
+
484
+ ## ⭐ Support
485
+
486
+ If this library saved you time, **give it a star** on GitHub. It helps others find it too!
487
+
488
+ <p align="center">
489
+ <a href="https://github.com/adnanahamed66772ndpc/shinyshell">⭐ Star on GitHub</a>
490
+ &nbsp;·&nbsp;
491
+ <a href="https://pypi.org/project/shinyshell/">📦 View on PyPI</a>
492
+ </p>