scribe-cli 0.6.2__tar.gz → 0.7.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.
Files changed (27) hide show
  1. {scribe_cli-0.6.2/scribe_cli.egg-info → scribe_cli-0.7.1}/PKG-INFO +16 -1
  2. {scribe_cli-0.6.2 → scribe_cli-0.7.1}/README.md +14 -0
  3. {scribe_cli-0.6.2 → scribe_cli-0.7.1}/pyproject.toml +2 -1
  4. {scribe_cli-0.6.2 → scribe_cli-0.7.1}/scribe/_version.py +2 -2
  5. scribe_cli-0.6.2/scribe/streamer.py → scribe_cli-0.7.1/scribe/app.py +46 -1
  6. {scribe_cli-0.6.2 → scribe_cli-0.7.1/scribe_cli.egg-info}/PKG-INFO +16 -1
  7. {scribe_cli-0.6.2 → scribe_cli-0.7.1}/scribe_cli.egg-info/SOURCES.txt +1 -1
  8. {scribe_cli-0.6.2 → scribe_cli-0.7.1}/scribe_cli.egg-info/entry_points.txt +1 -1
  9. {scribe_cli-0.6.2 → scribe_cli-0.7.1}/scribe_cli.egg-info/requires.txt +1 -0
  10. {scribe_cli-0.6.2 → scribe_cli-0.7.1}/.github/workflows/pypi.yml +0 -0
  11. {scribe_cli-0.6.2 → scribe_cli-0.7.1}/.gitignore +0 -0
  12. {scribe_cli-0.6.2 → scribe_cli-0.7.1}/LICENSE +0 -0
  13. {scribe_cli-0.6.2 → scribe_cli-0.7.1}/scribe/__init__.py +0 -0
  14. {scribe_cli-0.6.2 → scribe_cli-0.7.1}/scribe/audio.py +0 -0
  15. {scribe_cli-0.6.2 → scribe_cli-0.7.1}/scribe/install_desktop.py +0 -0
  16. {scribe_cli-0.6.2 → scribe_cli-0.7.1}/scribe/keyboard.py +0 -0
  17. {scribe_cli-0.6.2 → scribe_cli-0.7.1}/scribe/models.py +0 -0
  18. {scribe_cli-0.6.2 → scribe_cli-0.7.1}/scribe/models.toml +0 -0
  19. {scribe_cli-0.6.2 → scribe_cli-0.7.1}/scribe/saverecording.py +0 -0
  20. {scribe_cli-0.6.2 → scribe_cli-0.7.1}/scribe/testpynput.py +0 -0
  21. {scribe_cli-0.6.2 → scribe_cli-0.7.1}/scribe/util.py +0 -0
  22. {scribe_cli-0.6.2 → scribe_cli-0.7.1}/scribe_cli.egg-info/dependency_links.txt +0 -0
  23. {scribe_cli-0.6.2 → scribe_cli-0.7.1}/scribe_cli.egg-info/top_level.txt +0 -0
  24. {scribe_cli-0.6.2 → scribe_cli-0.7.1}/scribe_data/__init__.py +0 -0
  25. {scribe_cli-0.6.2 → scribe_cli-0.7.1}/scribe_data/share/icon.jpg +0 -0
  26. {scribe_cli-0.6.2 → scribe_cli-0.7.1}/scribe_data/templates/scribe.desktop +0 -0
  27. {scribe_cli-0.6.2 → scribe_cli-0.7.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: scribe-cli
3
- Version: 0.6.2
3
+ Version: 0.7.1
4
4
  Summary: scribe is a local speech recognition tool that provides real-time transcription using vosk and whisper AI.
5
5
  Author-email: Mahé Perrette <mahe.perrette@gmail.com>
6
6
  License: MIT License
@@ -44,6 +44,7 @@ Requires-Dist: sounddevice
44
44
  Requires-Dist: tqdm
45
45
  Requires-Dist: requests
46
46
  Requires-Dist: pyperclip
47
+ Requires-Dist: pystray
47
48
  Provides-Extra: keyboard
48
49
  Requires-Dist: pynput; extra == "keyboard"
49
50
  Provides-Extra: whisper
@@ -131,6 +132,20 @@ It relies on the optional `pynput` dependency (installed together with `scribe`
131
132
 
132
133
  `pynput` may require [some configuration](https://pynput.readthedocs.io/en/latest/limitations.html). It has [limitations]((https://pynput.readthedocs.io/en/latest/limitations.html)). In my Ubuntu + Wayland system it works in chromium based applications (including vscode) but it does not in firefox and sublime text and any of the rest (not even in a terminal !). Workarounds include using the Xorg version of GNOME: in `etc/gdm3/custom.conf` uncomment `# WaylandEnable=false` and restart.
133
134
 
135
+ ### System try icon (experimental)
136
+
137
+ To avoid switching back and forth with the terminal, it's possible to interact with the program via an icon tray.
138
+ To activate start with:
139
+ ```bash
140
+ scribe --app
141
+ ```
142
+ or toggle the app option in the interactive menu. The scribe icon will show, with Record or Quit options.
143
+ That option requires `pystray` to be installed. This is included with the `pip install ...[all]` option. In Ubuntu the following dependencies were required to make the menus appear:
144
+
145
+ ```bash
146
+ sudo apt install libcairo-dev libgirepository1.0-dev gir1.2-appindicator3-0.1
147
+ pip install PyGObject
148
+ ```
134
149
 
135
150
  ### Start as an application in Ubuntu
136
151
 
@@ -74,6 +74,20 @@ It relies on the optional `pynput` dependency (installed together with `scribe`
74
74
 
75
75
  `pynput` may require [some configuration](https://pynput.readthedocs.io/en/latest/limitations.html). It has [limitations]((https://pynput.readthedocs.io/en/latest/limitations.html)). In my Ubuntu + Wayland system it works in chromium based applications (including vscode) but it does not in firefox and sublime text and any of the rest (not even in a terminal !). Workarounds include using the Xorg version of GNOME: in `etc/gdm3/custom.conf` uncomment `# WaylandEnable=false` and restart.
76
76
 
77
+ ### System try icon (experimental)
78
+
79
+ To avoid switching back and forth with the terminal, it's possible to interact with the program via an icon tray.
80
+ To activate start with:
81
+ ```bash
82
+ scribe --app
83
+ ```
84
+ or toggle the app option in the interactive menu. The scribe icon will show, with Record or Quit options.
85
+ That option requires `pystray` to be installed. This is included with the `pip install ...[all]` option. In Ubuntu the following dependencies were required to make the menus appear:
86
+
87
+ ```bash
88
+ sudo apt install libcairo-dev libgirepository1.0-dev gir1.2-appindicator3-0.1
89
+ pip install PyGObject
90
+ ```
77
91
 
78
92
  ### Start as an application in Ubuntu
79
93
 
@@ -18,6 +18,7 @@ dependencies = [
18
18
  "tqdm",
19
19
  "requests",
20
20
  "pyperclip",
21
+ "pystray",
21
22
  ]
22
23
  optional-dependencies = { keyboard = ["pynput"], whisper = ["openai-whisper"], vosk = ["vosk"], all = ["pynput", "openai-whisper", "vosk"] }
23
24
 
@@ -49,5 +50,5 @@ write_to = "scribe/_version.py"
49
50
  Homepage = "https://github.com/perrette/scribe"
50
51
 
51
52
  [project.scripts]
52
- scribe = "scribe.streamer:main"
53
+ scribe = "scribe.app:main"
53
54
  scribe-install = "scribe.install_desktop:main"
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.6.2'
16
- __version_tuple__ = version_tuple = (0, 6, 2)
15
+ __version__ = version = '0.7.1'
16
+ __version_tuple__ = version_tuple = (0, 7, 1)
@@ -144,6 +144,7 @@ def get_parser():
144
144
  help="An alias for preselected models when using the vosk backend, or 'en' for the English version of whisper models.")
145
145
 
146
146
  parser.add_argument("--no-prompt", action="store_false", dest="prompt", help="Disable prompts for backend and model selection and jump to recording")
147
+ parser.add_argument("--app", action="store_true", help="Start in app mode (relies on pystray)")
147
148
 
148
149
  parser.add_argument("--samplerate", default=16000, type=int, help=argparse.SUPPRESS)
149
150
  parser.add_argument("--keyboard", action="store_true")
@@ -211,6 +212,41 @@ def start_recording(micro, transcriber, clipboard=True, keyboard=False, latency=
211
212
  print("Copied to clipboard.")
212
213
 
213
214
 
215
+ def create_app(micro, transcriber, **kwargs):
216
+ import pystray
217
+ from pystray import Menu as pystrayMenu, MenuItem as Item
218
+ from PIL import Image
219
+ import PIL.ImageOps
220
+
221
+ import scribe_data
222
+
223
+ # Load an image from a file
224
+ image = Image.open(Path(scribe_data.__file__).parent / "share" / "icon.jpg")
225
+
226
+ def callback_quit(icon, item):
227
+ icon.visible = False
228
+ icon.stop()
229
+
230
+ def callback_record(icon, item):
231
+ print(f"Clicked {item}")
232
+ # icon.icon = PIL.ImageOps.invert(icon.icon)
233
+ # icon.icon = PIL.ImageOps.invert(image)
234
+ # icon.update_menu()
235
+ start_recording(micro, transcriber, **kwargs)
236
+ # icon.icon = image
237
+ # icon.update_menu()
238
+
239
+ # Create a menu
240
+ menu = pystrayMenu(
241
+ Item('Record', callback_record),
242
+ Item('Quit', callback_quit),
243
+ )
244
+
245
+ # Create the system tray icon
246
+ icon = pystray.Icon('name', image, "My App", menu)
247
+
248
+ return icon
249
+
214
250
 
215
251
  def main(args=None):
216
252
 
@@ -233,6 +269,7 @@ def main(args=None):
233
269
  print(f"Choose any of the following actions:")
234
270
  print(f"[q] quit")
235
271
  print(f"[e] change model")
272
+ print(f"[x] toggle app [{toggle[o.app]}] -> [{toggle[not o.app]}]")
236
273
  print(f"[k] toggle keyboard [{toggle[o.keyboard]}] -> [{toggle[not o.keyboard]}]")
237
274
  print(f"[c] toggle clipboard [{toggle[o.clipboard]}] -> [{toggle[not o.clipboard]}]")
238
275
  if transcriber.backend == "whisper":
@@ -253,6 +290,9 @@ def main(args=None):
253
290
  if key == "c":
254
291
  o.clipboard = not o.clipboard
255
292
  continue
293
+ if key == "x":
294
+ o.app = not o.app
295
+ continue
256
296
  if key == "a":
257
297
  transcriber.restart_after_silence = not transcriber.restart_after_silence
258
298
  continue
@@ -271,7 +311,12 @@ def main(args=None):
271
311
  print("Invalid duration. Must be an integer.")
272
312
  continue
273
313
 
274
- start_recording(micro, transcriber, clipboard=o.clipboard, keyboard=o.keyboard, latency=o.latency)
314
+ if o.app:
315
+ app = create_app(micro, transcriber, clipboard=o.clipboard, keyboard=o.keyboard, latency=o.latency)
316
+ print("Starting app...")
317
+ app.run()
318
+ else:
319
+ start_recording(micro, transcriber, clipboard=o.clipboard, keyboard=o.keyboard, latency=o.latency)
275
320
 
276
321
  # if we arrived so far, that means we pressed Ctrl + C anyway, and need Enter to move on.
277
322
  # So we leave the wider range of options to change the model.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: scribe-cli
3
- Version: 0.6.2
3
+ Version: 0.7.1
4
4
  Summary: scribe is a local speech recognition tool that provides real-time transcription using vosk and whisper AI.
5
5
  Author-email: Mahé Perrette <mahe.perrette@gmail.com>
6
6
  License: MIT License
@@ -44,6 +44,7 @@ Requires-Dist: sounddevice
44
44
  Requires-Dist: tqdm
45
45
  Requires-Dist: requests
46
46
  Requires-Dist: pyperclip
47
+ Requires-Dist: pystray
47
48
  Provides-Extra: keyboard
48
49
  Requires-Dist: pynput; extra == "keyboard"
49
50
  Provides-Extra: whisper
@@ -131,6 +132,20 @@ It relies on the optional `pynput` dependency (installed together with `scribe`
131
132
 
132
133
  `pynput` may require [some configuration](https://pynput.readthedocs.io/en/latest/limitations.html). It has [limitations]((https://pynput.readthedocs.io/en/latest/limitations.html)). In my Ubuntu + Wayland system it works in chromium based applications (including vscode) but it does not in firefox and sublime text and any of the rest (not even in a terminal !). Workarounds include using the Xorg version of GNOME: in `etc/gdm3/custom.conf` uncomment `# WaylandEnable=false` and restart.
133
134
 
135
+ ### System try icon (experimental)
136
+
137
+ To avoid switching back and forth with the terminal, it's possible to interact with the program via an icon tray.
138
+ To activate start with:
139
+ ```bash
140
+ scribe --app
141
+ ```
142
+ or toggle the app option in the interactive menu. The scribe icon will show, with Record or Quit options.
143
+ That option requires `pystray` to be installed. This is included with the `pip install ...[all]` option. In Ubuntu the following dependencies were required to make the menus appear:
144
+
145
+ ```bash
146
+ sudo apt install libcairo-dev libgirepository1.0-dev gir1.2-appindicator3-0.1
147
+ pip install PyGObject
148
+ ```
134
149
 
135
150
  ### Start as an application in Ubuntu
136
151
 
@@ -5,13 +5,13 @@ pyproject.toml
5
5
  .github/workflows/pypi.yml
6
6
  scribe/__init__.py
7
7
  scribe/_version.py
8
+ scribe/app.py
8
9
  scribe/audio.py
9
10
  scribe/install_desktop.py
10
11
  scribe/keyboard.py
11
12
  scribe/models.py
12
13
  scribe/models.toml
13
14
  scribe/saverecording.py
14
- scribe/streamer.py
15
15
  scribe/testpynput.py
16
16
  scribe/util.py
17
17
  scribe_cli.egg-info/PKG-INFO
@@ -1,3 +1,3 @@
1
1
  [console_scripts]
2
- scribe = scribe.streamer:main
2
+ scribe = scribe.app:main
3
3
  scribe-install = scribe.install_desktop:main
@@ -3,6 +3,7 @@ sounddevice
3
3
  tqdm
4
4
  requests
5
5
  pyperclip
6
+ pystray
6
7
 
7
8
  [all]
8
9
  pynput
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes