scribe-cli 0.7.9__tar.gz → 0.7.10__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.7.9/scribe_cli.egg-info → scribe_cli-0.7.10}/PKG-INFO +10 -7
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/README.md +9 -6
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/scribe/_version.py +2 -2
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/scribe/app.py +29 -19
- {scribe_cli-0.7.9 → scribe_cli-0.7.10/scribe_cli.egg-info}/PKG-INFO +10 -7
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/.github/workflows/pypi.yml +0 -0
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/.gitignore +0 -0
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/LICENSE +0 -0
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/icon.xcf +0 -0
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/pyproject.toml +0 -0
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/scribe/__init__.py +0 -0
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/scribe/audio.py +0 -0
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/scribe/install_desktop.py +0 -0
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/scribe/keyboard.py +0 -0
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/scribe/models.py +0 -0
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/scribe/models.toml +0 -0
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/scribe/saverecording.py +0 -0
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/scribe/testpynput.py +0 -0
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/scribe/util.py +0 -0
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/scribe_cli.egg-info/SOURCES.txt +0 -0
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/scribe_cli.egg-info/dependency_links.txt +0 -0
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/scribe_cli.egg-info/entry_points.txt +0 -0
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/scribe_cli.egg-info/requires.txt +0 -0
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/scribe_cli.egg-info/top_level.txt +0 -0
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/scribe_data/__init__.py +0 -0
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/scribe_data/share/icon.png +0 -0
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/scribe_data/share/icon_recording.png +0 -0
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/scribe_data/share/icon_writing.png +0 -0
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/scribe_data/templates/scribe.desktop +0 -0
- {scribe_cli-0.7.9 → scribe_cli-0.7.10}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: scribe-cli
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.10
|
|
4
4
|
Summary: scribe is a local speech recognition tool that provides real-time transcription using vosk and whisper AI, with the goal of serving as a virtual keyboard on a computer
|
|
5
5
|
Author-email: Mahé Perrette <mahe.perrette@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -64,14 +64,17 @@ Requires-Dist: pystray; extra == "all"
|
|
|
64
64
|
[]()
|
|
65
65
|
[](https://pypi.org/project/scribe-cli)
|
|
66
66
|
|
|
67
|
-
# Scribe
|
|
67
|
+
# Scribe <img src="scribe_data/share/icon.png" width=48px>
|
|
68
68
|
|
|
69
69
|
`scribe` is a local speech recognition tool that provides real-time transcription using vosk and whisper AI, with the goal of serving as a virtual keyboard on a computer.
|
|
70
70
|
|
|
71
71
|
## Compatibility
|
|
72
72
|
|
|
73
|
-
In principle `scribe` is compatible with any OS but I develop it under Ubuntu (Wayland)
|
|
74
|
-
|
|
73
|
+
In principle `scribe` is compatible with any OS but I develop it under Ubuntu (Wayland) for my own purposes so glitches are likely on other configurations.
|
|
74
|
+
Moreover there are quite a bit of dependencies that rely on very OS-specific protocols under the hood, like access to the microphone, keyboard and clipboard,
|
|
75
|
+
and even though the python dependencies `scribe` relies on are not restricted to a single platform, there may be limitation and additional binaries to install.
|
|
76
|
+
This guide is based on python3.12 running on Ubuntu 24.04 with Gnome + Wayland, which is a relatively standard setting at the time of writing.
|
|
77
|
+
Note as of February 19, 2025 python 13 does not seem to produce any transcription (I am not sure which dependency is to blame).
|
|
75
78
|
A test on Mac OS (M1 Air with 8Gb RAM) worked with python 12, though with a much inferior performance compared to my own system (Lenovo T14 Gen 5 with i5 125U 32 Gb RAM).
|
|
76
79
|
|
|
77
80
|
## Installation
|
|
@@ -147,7 +150,7 @@ scribe --keyboard
|
|
|
147
150
|
It relies on the optional `pynput` dependency (installed together with `scribe` if you used the `[all]` or `[keyboard]` option).
|
|
148
151
|
Depending on your operating system, `pynput` may require additional configuration to work around its [limitations](https://pynput.readthedocs.io/en/latest/limitations.html).
|
|
149
152
|
|
|
150
|
-
#### Use the keyboard
|
|
153
|
+
#### Use the keyboard with Wayland (default for Ubuntu 24.04)
|
|
151
154
|
|
|
152
155
|
In my Ubuntu + Wayland system the keyboard simulation works out-of-the-box 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 !). I am told this is because Chromium runs an X server emulator and so is compatible with the default pynput backend.
|
|
153
156
|
|
|
@@ -161,7 +164,7 @@ sudo HOME=$HOME XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR PYNPUT_BACKEND_KEYBOARD=uinput
|
|
|
161
164
|
```
|
|
162
165
|
You're on the right path :)
|
|
163
166
|
|
|
164
|
-
### System tray icon (experimental)
|
|
167
|
+
### System tray icon (experimental) <img src="scribe_data/share/icon.png" width=48px>
|
|
165
168
|
|
|
166
169
|
To avoid switching back and forth with the terminal, it's possible to interact with the program via an icon tray.
|
|
167
170
|
To activate start with:
|
|
@@ -176,7 +179,7 @@ sudo apt install libcairo-dev libgirepository1.0-dev gir1.2-appindicator3-0.1
|
|
|
176
179
|
pip install PyGObject
|
|
177
180
|
```
|
|
178
181
|
|
|
179
|
-
### Start as an application in
|
|
182
|
+
### Start as an application in GNOME
|
|
180
183
|
|
|
181
184
|
If you run Ubuntu (or else?) with GNOME, the script `scribe-install [...]` will create a `scribe.desktop` file and place it under `$HOME/.local/share/applications`
|
|
182
185
|
to make it available from the quick launch menu. Any option will be passed on to `scribe`.
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
[]()
|
|
2
2
|
[](https://pypi.org/project/scribe-cli)
|
|
3
3
|
|
|
4
|
-
# Scribe
|
|
4
|
+
# Scribe <img src="scribe_data/share/icon.png" width=48px>
|
|
5
5
|
|
|
6
6
|
`scribe` is a local speech recognition tool that provides real-time transcription using vosk and whisper AI, with the goal of serving as a virtual keyboard on a computer.
|
|
7
7
|
|
|
8
8
|
## Compatibility
|
|
9
9
|
|
|
10
|
-
In principle `scribe` is compatible with any OS but I develop it under Ubuntu (Wayland)
|
|
11
|
-
|
|
10
|
+
In principle `scribe` is compatible with any OS but I develop it under Ubuntu (Wayland) for my own purposes so glitches are likely on other configurations.
|
|
11
|
+
Moreover there are quite a bit of dependencies that rely on very OS-specific protocols under the hood, like access to the microphone, keyboard and clipboard,
|
|
12
|
+
and even though the python dependencies `scribe` relies on are not restricted to a single platform, there may be limitation and additional binaries to install.
|
|
13
|
+
This guide is based on python3.12 running on Ubuntu 24.04 with Gnome + Wayland, which is a relatively standard setting at the time of writing.
|
|
14
|
+
Note as of February 19, 2025 python 13 does not seem to produce any transcription (I am not sure which dependency is to blame).
|
|
12
15
|
A test on Mac OS (M1 Air with 8Gb RAM) worked with python 12, though with a much inferior performance compared to my own system (Lenovo T14 Gen 5 with i5 125U 32 Gb RAM).
|
|
13
16
|
|
|
14
17
|
## Installation
|
|
@@ -84,7 +87,7 @@ scribe --keyboard
|
|
|
84
87
|
It relies on the optional `pynput` dependency (installed together with `scribe` if you used the `[all]` or `[keyboard]` option).
|
|
85
88
|
Depending on your operating system, `pynput` may require additional configuration to work around its [limitations](https://pynput.readthedocs.io/en/latest/limitations.html).
|
|
86
89
|
|
|
87
|
-
#### Use the keyboard
|
|
90
|
+
#### Use the keyboard with Wayland (default for Ubuntu 24.04)
|
|
88
91
|
|
|
89
92
|
In my Ubuntu + Wayland system the keyboard simulation works out-of-the-box 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 !). I am told this is because Chromium runs an X server emulator and so is compatible with the default pynput backend.
|
|
90
93
|
|
|
@@ -98,7 +101,7 @@ sudo HOME=$HOME XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR PYNPUT_BACKEND_KEYBOARD=uinput
|
|
|
98
101
|
```
|
|
99
102
|
You're on the right path :)
|
|
100
103
|
|
|
101
|
-
### System tray icon (experimental)
|
|
104
|
+
### System tray icon (experimental) <img src="scribe_data/share/icon.png" width=48px>
|
|
102
105
|
|
|
103
106
|
To avoid switching back and forth with the terminal, it's possible to interact with the program via an icon tray.
|
|
104
107
|
To activate start with:
|
|
@@ -113,7 +116,7 @@ sudo apt install libcairo-dev libgirepository1.0-dev gir1.2-appindicator3-0.1
|
|
|
113
116
|
pip install PyGObject
|
|
114
117
|
```
|
|
115
118
|
|
|
116
|
-
### Start as an application in
|
|
119
|
+
### Start as an application in GNOME
|
|
117
120
|
|
|
118
121
|
If you run Ubuntu (or else?) with GNOME, the script `scribe-install [...]` will create a `scribe.desktop` file and place it under `$HOME/.local/share/applications`
|
|
119
122
|
to make it available from the quick launch menu. Any option will be passed on to `scribe`.
|
|
@@ -112,16 +112,17 @@ def get_transcriber(o, prompt=True):
|
|
|
112
112
|
choices = list(zip(available_models, available_languages)) + [f" * [Any model from {ansi_link('https://alphacephei.com/vosk/models')}]"]
|
|
113
113
|
default_model = choices[0] # this is a tuple !!
|
|
114
114
|
|
|
115
|
-
print(f"For information about vosk models see: {ansi_link('https://alphacephei.com/vosk/models')}")
|
|
116
115
|
if prompt:
|
|
116
|
+
print(f"For information about vosk models see: {ansi_link('https://alphacephei.com/vosk/models')}")
|
|
117
117
|
model = prompt_choices(choices, default=default_model, label="model") # this always returns a string
|
|
118
118
|
else:
|
|
119
119
|
model = default_model[0] if isinstance(default_model, tuple) else default_model # tuple -> string
|
|
120
120
|
|
|
121
121
|
elif backend == "whisper":
|
|
122
122
|
default_model = "small"
|
|
123
|
-
print("Some models have a specialized English version (.en) which will be selected as default is `-l en` was requested, but can also be requested explicitly below (option not listed). See [documentation](https://github.com/openai/whisper?tab=readme-ov-file#available-models-and-languages).")
|
|
124
123
|
if prompt:
|
|
124
|
+
# print("Some models have a specialized English version (.en) which will be selected as default is `-l en` was requested, but can also be requested explicitly below (option not listed). See [documentation](https://github.com/openai/whisper?tab=readme-ov-file#available-models-and-languages).")
|
|
125
|
+
print(f"See {ansi_link('https://github.com/openai/whisper?tab=readme-ov-file#available-models-and-languages')} for available models.")
|
|
125
126
|
model = prompt_choices(whisper_models, default=default_model, label="model",
|
|
126
127
|
hidden_models=whisper_english_models)
|
|
127
128
|
else:
|
|
@@ -338,38 +339,47 @@ def main(args=None):
|
|
|
338
339
|
micro = Microphone(samplerate=o.samplerate, device=o.microphone_device)
|
|
339
340
|
|
|
340
341
|
transcriber = None
|
|
341
|
-
|
|
342
|
-
toggle = {True: "On", False: "Off"}
|
|
342
|
+
details = False
|
|
343
343
|
|
|
344
344
|
while True:
|
|
345
345
|
if transcriber is None:
|
|
346
346
|
transcriber = get_transcriber(o, prompt=o.prompt)
|
|
347
347
|
print(f"Model [{colored(transcriber.model_name, 'light_blue', attrs=['bold'])}] from [{colored(transcriber.backend, 'light_blue', attrs=['bold'])}] selected.")
|
|
348
|
+
show_options = ["clipboard", "keyboard", "ascii", "app"]
|
|
349
|
+
activated_options = [colored(option, 'light_blue') for option in show_options if getattr(o, option)]
|
|
350
|
+
print(f"Options: {' | '.join(activated_options)}")
|
|
348
351
|
if o.prompt:
|
|
349
352
|
print(f"Choose any of the following actions")
|
|
350
353
|
print(f"{colored('[q]', 'light_yellow')} quit")
|
|
351
354
|
print(f"{colored('[e]', 'light_yellow')} change model")
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
355
|
+
if details:
|
|
356
|
+
print(f"{colored('[x]', 'light_yellow')} app is {colored(o.app, 'light_blue')} toggle?")
|
|
357
|
+
print(f"{colored('[c]', 'light_yellow')} clipboard is {colored(o.clipboard, 'light_blue')} toggle?")
|
|
358
|
+
print(f"{colored('[k]', 'light_yellow')} keyboard is {colored(o.keyboard, 'light_blue')} toggle?")
|
|
359
|
+
if o.keyboard:
|
|
360
|
+
print(f"{colored('[latency]', 'light_yellow')} between keystrokes is {colored(o.latency, 'light_blue')} s")
|
|
361
|
+
if transcriber.backend == "whisper":
|
|
362
|
+
print(f"{colored('[t]', 'light_yellow')} change duration (currently {colored(transcriber.timeout, 'light_blue')} s)")
|
|
363
|
+
print(f"{colored('[b]', 'light_yellow')} change silence (currently {colored(transcriber.silence_duration, 'light_blue')} s)")
|
|
364
|
+
print(f"{colored('[a]', 'light_yellow')} auto-restart after silence is {colored(transcriber.restart_after_silence, 'light_blue')} toggle?")
|
|
365
|
+
exclude_flags = ["keyboard", "clipboard", "app", "prompt", "restart_after_silence"]
|
|
366
|
+
display_flags = [a.dest for a in parser._actions if a.help != argparse.SUPPRESS]
|
|
367
|
+
for key, value in vars(o).items():
|
|
368
|
+
if key not in display_flags or key in exclude_flags or not isinstance(value, bool):
|
|
369
|
+
continue
|
|
370
|
+
print(f"{colored(f'[{key}]', 'light_yellow')} is {colored(value, 'light_blue')} toggle?")
|
|
371
|
+
print(f"{colored('[o]', 'light_yellow')} hide options")
|
|
372
|
+
else:
|
|
373
|
+
print(f"{colored('[o]', 'light_yellow')} show options")
|
|
367
374
|
|
|
368
375
|
print(colored(f"Press [Enter] to start recording.", attrs=["bold"]))
|
|
369
376
|
|
|
370
377
|
key = input()
|
|
371
378
|
if key == "q":
|
|
372
379
|
exit(0)
|
|
380
|
+
if key == "o":
|
|
381
|
+
details = not details
|
|
382
|
+
continue
|
|
373
383
|
if key == "e":
|
|
374
384
|
transcriber = None
|
|
375
385
|
o.model = None
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: scribe-cli
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.10
|
|
4
4
|
Summary: scribe is a local speech recognition tool that provides real-time transcription using vosk and whisper AI, with the goal of serving as a virtual keyboard on a computer
|
|
5
5
|
Author-email: Mahé Perrette <mahe.perrette@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -64,14 +64,17 @@ Requires-Dist: pystray; extra == "all"
|
|
|
64
64
|
[]()
|
|
65
65
|
[](https://pypi.org/project/scribe-cli)
|
|
66
66
|
|
|
67
|
-
# Scribe
|
|
67
|
+
# Scribe <img src="scribe_data/share/icon.png" width=48px>
|
|
68
68
|
|
|
69
69
|
`scribe` is a local speech recognition tool that provides real-time transcription using vosk and whisper AI, with the goal of serving as a virtual keyboard on a computer.
|
|
70
70
|
|
|
71
71
|
## Compatibility
|
|
72
72
|
|
|
73
|
-
In principle `scribe` is compatible with any OS but I develop it under Ubuntu (Wayland)
|
|
74
|
-
|
|
73
|
+
In principle `scribe` is compatible with any OS but I develop it under Ubuntu (Wayland) for my own purposes so glitches are likely on other configurations.
|
|
74
|
+
Moreover there are quite a bit of dependencies that rely on very OS-specific protocols under the hood, like access to the microphone, keyboard and clipboard,
|
|
75
|
+
and even though the python dependencies `scribe` relies on are not restricted to a single platform, there may be limitation and additional binaries to install.
|
|
76
|
+
This guide is based on python3.12 running on Ubuntu 24.04 with Gnome + Wayland, which is a relatively standard setting at the time of writing.
|
|
77
|
+
Note as of February 19, 2025 python 13 does not seem to produce any transcription (I am not sure which dependency is to blame).
|
|
75
78
|
A test on Mac OS (M1 Air with 8Gb RAM) worked with python 12, though with a much inferior performance compared to my own system (Lenovo T14 Gen 5 with i5 125U 32 Gb RAM).
|
|
76
79
|
|
|
77
80
|
## Installation
|
|
@@ -147,7 +150,7 @@ scribe --keyboard
|
|
|
147
150
|
It relies on the optional `pynput` dependency (installed together with `scribe` if you used the `[all]` or `[keyboard]` option).
|
|
148
151
|
Depending on your operating system, `pynput` may require additional configuration to work around its [limitations](https://pynput.readthedocs.io/en/latest/limitations.html).
|
|
149
152
|
|
|
150
|
-
#### Use the keyboard
|
|
153
|
+
#### Use the keyboard with Wayland (default for Ubuntu 24.04)
|
|
151
154
|
|
|
152
155
|
In my Ubuntu + Wayland system the keyboard simulation works out-of-the-box 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 !). I am told this is because Chromium runs an X server emulator and so is compatible with the default pynput backend.
|
|
153
156
|
|
|
@@ -161,7 +164,7 @@ sudo HOME=$HOME XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR PYNPUT_BACKEND_KEYBOARD=uinput
|
|
|
161
164
|
```
|
|
162
165
|
You're on the right path :)
|
|
163
166
|
|
|
164
|
-
### System tray icon (experimental)
|
|
167
|
+
### System tray icon (experimental) <img src="scribe_data/share/icon.png" width=48px>
|
|
165
168
|
|
|
166
169
|
To avoid switching back and forth with the terminal, it's possible to interact with the program via an icon tray.
|
|
167
170
|
To activate start with:
|
|
@@ -176,7 +179,7 @@ sudo apt install libcairo-dev libgirepository1.0-dev gir1.2-appindicator3-0.1
|
|
|
176
179
|
pip install PyGObject
|
|
177
180
|
```
|
|
178
181
|
|
|
179
|
-
### Start as an application in
|
|
182
|
+
### Start as an application in GNOME
|
|
180
183
|
|
|
181
184
|
If you run Ubuntu (or else?) with GNOME, the script `scribe-install [...]` will create a `scribe.desktop` file and place it under `$HOME/.local/share/applications`
|
|
182
185
|
to make it available from the quick launch menu. Any option will be passed on to `scribe`.
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|