spci-sonic-pulse 2.0.1__py3-none-any.whl → 2.0.5__py3-none-any.whl

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.
spci/mp.py CHANGED
@@ -1,3 +1,4 @@
1
+ import msvcrt
1
2
  import os
2
3
  import platform
3
4
  import subprocess
@@ -10,6 +11,7 @@ import yt_dlp
10
11
  import zipfile
11
12
  import io
12
13
  import random
14
+ import math
13
15
  from rich.console import Console
14
16
  from rich.table import Table
15
17
  from rich.progress import Progress, SpinnerColumn, BarColumn, TextColumn
@@ -18,15 +20,12 @@ from rich.panel import Panel
18
20
  from rich.live import Live
19
21
  from rich.align import Align
20
22
  from rich import box
21
- import math
22
- import random
23
- from rich.panel import Panel
24
23
 
25
24
  # External project modules
26
- from .getmusic import get_music
25
+ from getmusic import get_music
27
26
  from tinydb import TinyDB, Query
28
27
 
29
- __version__ = "2.0.0"
28
+ __version__ = "2.0.5"
30
29
 
31
30
  console = Console()
32
31
  app = typer.Typer()
@@ -146,9 +145,10 @@ def get_now_playing_panel(title, artist, is_offline=False, t=0.0):
146
145
 
147
146
 
148
147
 
149
- def get_controls_panel():
148
+ def get_controls_panel(repeat_mode: bool = False):
149
+ status = "[bold green]ON[/bold green]" if repeat_mode else "[bold red]OFF[/bold red]"
150
150
  return Panel(
151
- Align.center("[bold white]ACTIVE SESSION[/bold white]\n[dim]Press Ctrl+C to stop playback and return to terminal[/dim]"),
151
+ Align.center(f"[bold white]ACTIVE SESSION[/bold white] | REPEAT: {status}\n[dim]Press Ctrl+C to stop | Press Ctrl+R to toggle Repeat[/dim]"),
152
152
  title="Controls",
153
153
  border_style="blue"
154
154
  )
@@ -397,6 +397,7 @@ def play(query: str):
397
397
  vid = query
398
398
  audio_source = None
399
399
  is_offline = False
400
+
400
401
 
401
402
  if offline_entry:
402
403
  # Check for the file (supports multiple extensions for mpv)
@@ -441,21 +442,32 @@ def play(query: str):
441
442
 
442
443
  # UI EXECUTION
443
444
  layout = make_layout()
445
+ repeat = False
444
446
  try:
445
447
  with Live(layout, refresh_per_second=20, screen=True):
446
448
  # Uses mpv or ffplay based on OS detection
447
- process = subprocess.Popen(get_player_command() + [audio_source],
449
+ while True:
450
+ process = subprocess.Popen(get_player_command() + [audio_source],
448
451
  stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
449
- t = 0.0
450
- while process.poll() is None:
451
- layout["header"].update(get_header())
452
- layout["left"].update(get_now_playing_panel(title, artist, is_offline, t))
453
- layout["right"].update(get_stats_panel())
454
- layout["footer"].update(get_controls_panel())
455
- t += 0.12
456
- time.sleep(0.05)
452
+ t = 0.0
453
+ while process.poll() is None:
454
+ if msvcrt.kbhit():
455
+ key = msvcrt.getch()
456
+ # Allow 'r' or Ctrl+R (0x12) to toggle repeat
457
+ if key in [b'r', b'R', b'\x12']:
458
+ repeat = not repeat
459
+
460
+ layout["header"].update(get_header())
461
+ layout["left"].update(get_now_playing_panel(title, artist, is_offline, t))
462
+ layout["right"].update(get_stats_panel())
463
+ layout["footer"].update(get_controls_panel(repeat))
464
+ t += 0.12
465
+ time.sleep(0.05)
466
+ if not repeat:
467
+ break
457
468
  except KeyboardInterrupt:
458
- process.terminate()
469
+ if 'process' in locals():
470
+ process.terminate()
459
471
 
460
472
  @app.command(short_help="Remove a song from your offline favorites")
461
473
  def delete_fav(video_id: str):
@@ -0,0 +1,80 @@
1
+ Metadata-Version: 2.4
2
+ Name: spci-sonic-pulse
3
+ Version: 2.0.5
4
+ Summary: A CLI music player
5
+ License: MIT
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: License :: OSI Approved :: MIT License
8
+ Classifier: Operating System :: OS Independent
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: typer
12
+ Requires-Dist: rich
13
+ Requires-Dist: requests
14
+ Requires-Dist: yt-dlp
15
+ Requires-Dist: python-vlc
16
+ Requires-Dist: ytmusicapi
17
+ Requires-Dist: tinydb
18
+ Dynamic: license-file
19
+
20
+ # SPCI - Sonic Pulse CLI Music Player
21
+
22
+ A powerful and lightweight command-line music player that lets you search, play, and manage your favorite music directly from your terminal using YouTube and YouTube Music.
23
+
24
+ ## Features
25
+
26
+ - **Search:** Find music online from YouTube.
27
+ - **Play:** Play songs instantly (checks offline favorites first).
28
+ - **Favorites:** Save songs locally for offline access.
29
+ - **History:** Keep track of your recently played tracks.
30
+ - **Rich UI:** Beautiful terminal interface powered by `rich`.
31
+
32
+ ## Installation
33
+
34
+ ### Prerequisites
35
+
36
+ - **Python 3.8+**
37
+ - **VLC Media Player:** Ensure VLC is installed on your system as it is used for audio playback.
38
+ - **FFmpeg:** Required for processing audio streams.
39
+
40
+ ### Install via PyPI
41
+
42
+ ```bash
43
+ pip install spci-sonic-pulse
44
+ ```
45
+
46
+ ## Usage
47
+
48
+ Once installed, you can use the `spci` command:
49
+
50
+ ```bash
51
+ # Search for music
52
+ spci search "Your Song Name"
53
+
54
+ # Play a song
55
+ spci play "Your Song Name"
56
+
57
+ # View favorites
58
+ spci show-fav
59
+
60
+ # View play history
61
+ spci show-history
62
+
63
+ # Initial setup (if required)
64
+ spci setup
65
+ ```
66
+
67
+ ## Commands
68
+
69
+ - `search`: Find music online.
70
+ - `play`: Play a song (checks offline first).
71
+ - `show-fav`: View and manage your offline favorites.
72
+ - `add-fav`: Add a song to your favorites.
73
+ - `delete-fav`: Remove a song from your favorites.
74
+ - `show-history`: Display playback history.
75
+ - `clear-history`: Clear your playback history.
76
+ - `setup`: Run initial configuration.
77
+
78
+ ## License
79
+
80
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,9 @@
1
+ spci/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ spci/getmusic.py,sha256=4IOfsWqVxmTpV2yfhgwxlsBn91os_iM-ibLXFLO3c6c,1925
3
+ spci/mp.py,sha256=DuhusGZX6qVOzvVMjVYc2TX5yBAZ1fvnQo0L0mjczoM,20692
4
+ spci_sonic_pulse-2.0.5.dist-info/licenses/LICENSE,sha256=HYamLPSZx8P8FR7iau4geVcf_6dFTrKNOFMnaUnlJLE,1083
5
+ spci_sonic_pulse-2.0.5.dist-info/METADATA,sha256=NgdxSFYpxmPI3MAcbcNhOQT8mqzYM1sH3l--RYKitok,2109
6
+ spci_sonic_pulse-2.0.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
+ spci_sonic_pulse-2.0.5.dist-info/entry_points.txt,sha256=Jhr15wSXKlpmphjf6NlRFdDoAMBtKIjhf8HvIrdM6O0,37
8
+ spci_sonic_pulse-2.0.5.dist-info/top_level.txt,sha256=hx42bb8jVcX4BeZkgkaTpcA5Lh9x3ONYicda0hyczxU,5
9
+ spci_sonic_pulse-2.0.5.dist-info/RECORD,,
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ojasw
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,11 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: spci-sonic-pulse
3
- Version: 2.0.1
4
- Requires-Dist: typer
5
- Requires-Dist: rich
6
- Requires-Dist: requests
7
- Requires-Dist: yt-dlp
8
- Requires-Dist: python-vlc
9
- Requires-Dist: ytmusicapi
10
- Requires-Dist: tinydb
11
- Dynamic: requires-dist
@@ -1,8 +0,0 @@
1
- spci/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- spci/getmusic.py,sha256=4IOfsWqVxmTpV2yfhgwxlsBn91os_iM-ibLXFLO3c6c,1925
3
- spci/mp.py,sha256=q6bXuAz-BqAqnD5ekQvHgUqEeFg-OZEdqlwS-3qCepU,20103
4
- spci_sonic_pulse-2.0.1.dist-info/METADATA,sha256=H-aKF5dc5E37yM46h4ylR4M5Hdwfd4xYCMoyXFVW0s4,255
5
- spci_sonic_pulse-2.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
- spci_sonic_pulse-2.0.1.dist-info/entry_points.txt,sha256=Jhr15wSXKlpmphjf6NlRFdDoAMBtKIjhf8HvIrdM6O0,37
7
- spci_sonic_pulse-2.0.1.dist-info/top_level.txt,sha256=hx42bb8jVcX4BeZkgkaTpcA5Lh9x3ONYicda0hyczxU,5
8
- spci_sonic_pulse-2.0.1.dist-info/RECORD,,