AnkiMiningAssistant
The aim of this project is to develop a cross-platoform software to facilitate the creation of useful Anki cards while sentence mining by automatically (or manually) adding screenshots and sentence audio.
Both screenshots and audio recording are obtained using platform dependant native methods, meaning there is no need to install or setup third-party software, thus simplifying the setup process and reducing the total
NOTE: This program is still in its early stages and has not been thoroughly tested, if you encounter any problem make sure to open an Issue. Apple Silicon mac and most linux distros have never been tested.
Demo
https://github.com/user-attachments/assets/454570c5-b7b6-4351-979c-d6014fb1e3f2
Features
Current
- Automatic and manual update of last card added
- Native system audio monitoring
- Native window screenshots
- Select specific window for screenshots
- Select screen section for screenshots
- Support multiple sessions with different settings
- Automatically show Expression and Sentence of the last anki card added
- Use AnkiConnect to facilitate deck and note-type config
- Voice detection using silero-vad
- Automatically pause monitoring after specified amount of silence and restart upon new lines received
- Automatically identify end of sentence audio
- Option to preview card info before adding to Anki
- Manually modify audio selection if necessary
- Choose different screenshot
- Modify Sentence field
- Switch between automatic and manual update of cards
- And more... (Check Usage and Configuration)
Planned
- Compiled Binary/App Bundle
- Add custom tags to anki card
- Modify which tags to include in the card preview window
- Better support for multi monitor setups
- Ability to update an older anki card instead of just the last one added
- More flexible note type fields handling
- Automatic audio transcription when using manual mode
- Instructions page when opening the program for the first time
- Updates checker
- Ability to create new card from just audio buffer
Installation
As of right now, the app is only available as a python package. In the future binaries/App bundle will be made available.
To install the python package it is recommended to use uv tool:
- Install uv
- If you are on
linuxyou may need to install the following dependecies:gccpkg-configorpkgconflibpipewire-0.3PortAudiolibrary.
- run the following command in terminal
uv tool install AnkiMiningAssistant --pyhton 3.12
After installing, you can use the following command to open the application
anki-mining-assistant
Opening the app for the first time will take a while, even if nothing seems to be happening let it run. Subsequent runs should open normally.
Configuration
Here are the necessary settings for the program to work, for all other refer to the descriptions provided under each settings.
General
Make sure the WebSocket Port selected does not conflict with any other software you are using. In most cases the default will work.
Add a custom websocket server to listen to in order to receive text from the media you are mining from. Already included as default are:
- localhost:6677 (default used by mpv_websocket_subs and mpv_websocket)
- localhost:2333 (default used by LunaTranslator)
Anki
Make sure AnkiConnect addon is installed on Anki.
Verify that AnkiConnect PORT matches the one in AnkiConnect settings. The default should work most of the time.
Once connection with Anki is established, Media Directory should be populated automatically.
Add your preferred Note Types by selecting them from the drop down menu and pressing the + button.
For each note type you added you need to select the matching fields
Expression: word or expression learned in the card. Will be shown in main interface for the last note addedSentence: sentence being mined. Will be shown in main interface for the last note addedSentence Audio: audio recorded from this program will be added to this fieldPicture: screenshots from this program will be added to this field
Audio
Should work with the default.
If you notice problems with the voice detection, try changing Vad Threshold between 0.1 and 0.9.
A higher value will be stricter (too high might lead to some false negatives), while a lower will be laxer (too low might lead to some false positives).
Image
Should work with the default.
If you notice problems with screenshots being cutoff or scaled wrong, try clicking the Calibrate button. This is especially necessary on linux under wayland because the program has no access to the window coordinates.
Usage
Interface
Session Settings
On Linux distros under Wayland, app/window selection will occur while choosing the source for the recording.
-
Session name: Use
+and-button to add or delete a session. When adding a session the exact time of its creation is used as name but that can be edited at any moment. -
App: Select the App that owns the window you wish to screenshot. If none is selected, a screenshot of the entire screen will be used.
-
Window: Select the window you wish to screenshot. If none is selected, a screenshot of the entire screen will be used.
-
Audio Input: Device used when monitoring audio. Loopback devices to record system audio should be available on all platform by default.
-
Use screen region: If selected, ignores window selection and takes a screenshot of a portion of the screen of your choosing.
-
Continuous Recording: By default recordings are paused after the specified time of voice inactivity in settings (default: 10 s). If this is toggled, recordings will not pause.
Buttons
-
Icon buttons
-
Screenshot (top): Add screenshot to Anki Note.
-
Audio (middle): Add audio to Anki Note.
-
Screenshot/Audio (bottom): Add screenshot and audio to Anki Note.
-
-
Start Monitoring: Start monitoring audio and saving screenshots at constant intervals (default: 1 s). The default buffer is set to 300s but can be changed in settings.
-
Play: Play/Pause current audio buffer content.
-
Settings: Open Settings
-
Show Lines: Show/Hide current lines available in database. Allow for selection of multiple consecutive lines (feature still in development).
Anki Specific
-
Anki Note Monitor: Show
ExpressionandSentencefor the anki note that will be modified. -
Auto Update: automatically attempt to update a note as soon as it is added to Anki.
-
Open in Browser: open Anki note browser after updating the note
-
Preview Note: before updating note, show preview and allow user to adjust screenshot and audio timings.
Status Indicators
- Anki: Connection to Anki
- Listening: Connection to outside websocket server to receive sentence text and timings.
- WS: Local WebSocket server. Used to redirect text received from the websockets above.
RED = Failed to start; Orange = Ready to connect; GREEN = Connected
Dependencies
| Name | LICENSE |
|---|---|
| PySide6 | LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| websockets | BSD-3-Clause |
| SoundCard | BSD 3-clause |
| sounddevice | MIT |
| soundfile | BSD 3-Clause License |
| torch | BSD-3-Clause |
| torchaudio | BSD-2-Clause license |
| silero-vad | MIT License |
| pillow | MIT-CMU |
| numpy | BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0 |
| cffi | MIT |
| pyobjc | MIT |
| PyWinCtl | BSD-3-Clause |
| python-xlib | GNU Lesser General Public License v2 or later (LGPLv2+) (LGPLv2+) |
| jeepney | MIT |
| pywin32 | Python Software Foundation License (PSF)*[1] |
Metadata
Release files for AnkiMiningAssistant 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ankiminingassistant-0.1.7.tar.gz | 494.0 kB | Without provenance | Details for ankiminingassistant-0.1.7.tar.gz |
Release files / ankiminingassistant-0.1.7.tar.gz
| Download URL | ankiminingassistant-0.1.7.tar.gz |
|---|---|
| Size | 494.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d1c0f5553f61d769ed4339cccf9f00ef681f7bfe5443384542b1b99f8933f3e9
|
|
BLAKE2b-256 checksum How to use checksums |
bbaf74b90d57f8d2a10de5b77cc6df27730c8f2826ebf6f83e4e450ca745cd95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for AnkiMiningAssistant 0.1.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.