scribe-cli 0.6.2__tar.gz → 0.7.0__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.
- {scribe_cli-0.6.2/scribe_cli.egg-info → scribe_cli-0.7.0}/PKG-INFO +16 -1
- {scribe_cli-0.6.2 → scribe_cli-0.7.0}/README.md +14 -0
- {scribe_cli-0.6.2 → scribe_cli-0.7.0}/pyproject.toml +2 -1
- {scribe_cli-0.6.2 → scribe_cli-0.7.0}/scribe/_version.py +2 -2
- scribe_cli-0.6.2/scribe/streamer.py → scribe_cli-0.7.0/scribe/app.py +45 -1
- {scribe_cli-0.6.2 → scribe_cli-0.7.0/scribe_cli.egg-info}/PKG-INFO +16 -1
- {scribe_cli-0.6.2 → scribe_cli-0.7.0}/scribe_cli.egg-info/SOURCES.txt +1 -1
- {scribe_cli-0.6.2 → scribe_cli-0.7.0}/scribe_cli.egg-info/entry_points.txt +1 -1
- {scribe_cli-0.6.2 → scribe_cli-0.7.0}/scribe_cli.egg-info/requires.txt +1 -0
- {scribe_cli-0.6.2 → scribe_cli-0.7.0}/.github/workflows/pypi.yml +0 -0
- {scribe_cli-0.6.2 → scribe_cli-0.7.0}/.gitignore +0 -0
- {scribe_cli-0.6.2 → scribe_cli-0.7.0}/LICENSE +0 -0
- {scribe_cli-0.6.2 → scribe_cli-0.7.0}/scribe/__init__.py +0 -0
- {scribe_cli-0.6.2 → scribe_cli-0.7.0}/scribe/audio.py +0 -0
- {scribe_cli-0.6.2 → scribe_cli-0.7.0}/scribe/install_desktop.py +0 -0
- {scribe_cli-0.6.2 → scribe_cli-0.7.0}/scribe/keyboard.py +0 -0
- {scribe_cli-0.6.2 → scribe_cli-0.7.0}/scribe/models.py +0 -0
- {scribe_cli-0.6.2 → scribe_cli-0.7.0}/scribe/models.toml +0 -0
- {scribe_cli-0.6.2 → scribe_cli-0.7.0}/scribe/saverecording.py +0 -0
- {scribe_cli-0.6.2 → scribe_cli-0.7.0}/scribe/testpynput.py +0 -0
- {scribe_cli-0.6.2 → scribe_cli-0.7.0}/scribe/util.py +0 -0
- {scribe_cli-0.6.2 → scribe_cli-0.7.0}/scribe_cli.egg-info/dependency_links.txt +0 -0
- {scribe_cli-0.6.2 → scribe_cli-0.7.0}/scribe_cli.egg-info/top_level.txt +0 -0
- {scribe_cli-0.6.2 → scribe_cli-0.7.0}/scribe_data/__init__.py +0 -0
- {scribe_cli-0.6.2 → scribe_cli-0.7.0}/scribe_data/share/icon.jpg +0 -0
- {scribe_cli-0.6.2 → scribe_cli-0.7.0}/scribe_data/templates/scribe.desktop +0 -0
- {scribe_cli-0.6.2 → scribe_cli-0.7.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: scribe-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
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.
|
|
53
|
+
scribe = "scribe.app:main"
|
|
53
54
|
scribe-install = "scribe.install_desktop:main"
|
|
@@ -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,11 @@ def main(args=None):
|
|
|
271
311
|
print("Invalid duration. Must be an integer.")
|
|
272
312
|
continue
|
|
273
313
|
|
|
274
|
-
|
|
314
|
+
if o.app:
|
|
315
|
+
app = create_app(micro, transcriber, clipboard=o.clipboard, keyboard=o.keyboard, latency=o.latency)
|
|
316
|
+
app.run()
|
|
317
|
+
else:
|
|
318
|
+
start_recording(micro, transcriber, clipboard=o.clipboard, keyboard=o.keyboard, latency=o.latency)
|
|
275
319
|
|
|
276
320
|
# if we arrived so far, that means we pressed Ctrl + C anyway, and need Enter to move on.
|
|
277
321
|
# 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.
|
|
3
|
+
Version: 0.7.0
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|