GithubHelp home page GithubHelp logo

xxyzz / worddumb Goto Github PK

View Code? Open in Web Editor NEW
334.0 4.0 17.0 3.86 MB

A calibre plugin that generates Kindle Word Wise and X-Ray files for KFX, AZW3, MOBI and EPUB eBook.

Home Page: https://xxyzz.github.io/WordDumb/

License: GNU General Public License v3.0

Python 100.00%
calibre calibre-plugin kindle ebook python spacy wikipedia dictionary language-learning books

worddumb's Introduction

WordDumb

A calibre plugin that generates Kindle Word Wise and X-Ray files and EPUB footnotes then send them to e-reader. Supports KFX, AZW3, AZW, MOBI and EPUB eBooks.

Test plugin will be uploaded to GitHub Actions Artifacts at each git push automatically.

screenshot

Document

xxyzz.github.io/WordDumb

I need about tree-fiddy

Donate using Liberapay

License

This work is licensed under GPL version 3 or later.

Icon made by Freepik from www.flaticon.com.

worddumb's People

Contributors

dependabot[bot] avatar kianmeng avatar miipop avatar vuizur avatar xxyzz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

worddumb's Issues

Cant Install

calibre, version 5.44.0
ERROR: Unhandled exception: InvalidPlugin:The plugin in 'C:\Users\LENOVO\Downloads\WordDumbmaster.zip' is invalid. It does not contain a top-level init.py file

calibre 5.44 embedded-python: True is64bit: False
Windows-10-10.0.18362 Windows ('32bit', 'WindowsPE')
32bit process running on 64bit windows
('Windows', '10', '10.0.18362')
Python 3.8.5
Windows: ('10', '10.0.18362', '', 'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 49, 0) && Package KFX (from KFX Input) (1, 49, 0) && KFX metadata reader (from KFX Input) (1, 49, 0) && KFX Input (1, 49, 0) && Set KFX metadata (from KFX Output) (1, 63, 0) && KFX Output (1, 63, 0)
Traceback (most recent call last):
File "calibre\gui2\preferences\plugins.py", line 326, in add_plugin
File "calibre\customize\ui.py", line 476, in add_plugin
File "calibre\customize\ui.py", line 64, in load_plugin
File "calibre\customize\zipplugin.py", line 283, in load
File "calibre\customize\zipplugin.py", line 378, in _locate_code
calibre.customize.InvalidPlugin: The plugin in 'C:\Users\LENOVO\Downloads\WordDumbmaster.zip' is invalid. It does not contain a top-level init.py file

TypeError: 'NoneType' object is not subscriptable

Recently I've found your plugin and it is brilliant.
However, when I perform WordDumb on some books, I get a TypeError: 'NoneType' object is not subscriptable.
Details (copy from calibre):

calibre, version 5.16.0
ERROR: Unhandled exception: <b>TypeError</b>:'NoneType' object is not subscriptable

calibre 5.16 [64bit]  embedded-python: True is64bit: True
Windows-10-10.0.19041 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19041')
Python 3.8.5
Windows: ('10', '10.0.19041', '', 'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: Find Duplicates (1, 8, 5) && WordDumb (3, 6, 3)
Traceback (most recent call last):
  File "calibre\gui2\__init__.py", line 499, in dispatch
  File "calibre_plugins.worddumb.main", line 71, in done
  File "calibre_plugins.worddumb.send_file", line 69, in send
  File "calibre_plugins.worddumb.send_file", line 36, in send_files
TypeError: 'NoneType' object is not subscriptable

Anyway, thanks for your help and brilliant work!

Ocurrence of words in X-Ray are not found in KFX format

Describe the bug

I've detected that sometimes there are words included in X-Ray asc file generated by the plugin that are not found when you look for it in a KFX book.
I enclose an example. The book and the generated ASC file.
Looking inside the ASC file, the word "catafracto" has only one ocurrence, but actually there are a lot of them.

System Information

OS: windows 11
All last versions.

Error message

No error message

Reproduce steps

Double tap in "catagfracto" word

Screenshots or videos

image
image
Posteguillo, Santiago.zip

Error while generating Word Wise

Hi, it's me again 😂
Recently, I've installed WordDumb on my younger sister's Windows 10 computer and encountered this error while performing WordDumb on a book.

calibre, version 5.18.0 (win32, embedded-python: True)
Dumb error: Failed: Generating Word Wise for Atomic Habits

Starting job: Generating Word Wise for Atomic Habits 
Job: "Generating Word Wise for Atomic Habits" failed with error: 
Traceback (most recent call last):
  File "calibre\gui2\threaded_jobs.py", line 83, in start_work
  File "calibre_plugins.worddumb.parse_job", line 17, in do_job
  File "calibre_plugins.worddumb.unzip", line 26, in install_libs
  File "calibre_plugins.worddumb.unzip", line 88, in pip_install
  File "subprocess.py", line 364, in check_call
subprocess.CalledProcessError: Command '['python3', '-m', 'pip', 'install', '-t', WindowsPath('C:/Users/user/AppData/Roaming/calibre/plugins/worddumb-libs/nltk3.6.2'), 'nltk==3.6.2']' returned non-zero exit status 9009.
 
Called with args: ((2, 'MOBI', 'BBOOWNQWA7', 'C:\\Users\\user\\Calibre Library\\James Clear\\Atomic Habits (2)\\Atomic Habits - James Clear.mobi', <calibre.ebooks.metadata.book.base.Metadata object at 0x000001A8248C59A0>), True) {'notifications': <queue.Queue object at 0x000001A8248C5400>, 'abort': <threading.Event object at 0x000001A8248C12E0>, 'log': <calibre.utils.logging.GUILog object at 0x000001A8248C1670>}

After running WordDumb and facing this error, I check the C:/Users/user/AppData/Roaming/calibre/plugins/ directory but don't see worddumb-libs directory there.

FYI: I've tried installing nltk 3.6.2 manually but it didn't help, the same error still occurs.

Can't use "customize kindle word wise" function

Describe the bug

calibre 6.2.1 embedded-python: True
Windows-10-10.0.19044-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19044')
Python 3.10.1
Windows: ('10', '10.0.19044', 'SP0', 'Multiprocessor Free')
Interface language: zh_TW
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 49, 0) && DeDRM (10, 0, 3) && Package KFX (from KFX Input) (1, 49, 0) && Chinese Text Conversion (2, 4, 0) && EpubMerge (2, 14, 0) && KFX metadata reader (from KFX Input) (1, 49, 0) && KFX Input (1, 49, 0) && Set KFX metadata (from KFX Output) (1, 64, 0) && KFX Output (1, 64, 0) && WordDumb (3, 24, 0) && X-Ray Creator (3, 2, 1)
Traceback (most recent call last):
File "calibre\gui2\main.py", line 456, in send_message
File "calibre\gui2\listener.py", line 91, in send_message_in_process
OSError: Failed to connect to Listener at: \.\pipe\CalibreGUI-kayuex with error: QLocalSocket::connectToServer: Invalid name

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "calibre\gui2\main.py", line 460, in send_message
File "calibre\gui2\listener.py", line 91, in send_message_in_process
OSError: Failed to connect to Listener at: \.\pipe\CalibreGUI-kayuex with error: QLocalSocket::connectToServer: Invalid name

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "calibre\gui2\main.py", line 548, in main
File "calibre\gui2\main.py", line 561, in run_main
File "calibre\gui2\main.py", line 494, in communicate
File "calibre\gui2\main.py", line 465, in send_message
calibre.gui2.main.FailedToCommunicate: retrying

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "calibre_plugins.worddumb.config", line 187, in open_custom_lemmas_dialog
File "calibre_plugins.worddumb.custom_lemmas", line 46, in init
File "calibre_plugins.worddumb.custom_lemmas", line 237, in init
TypeErroTypeErrorr: expected str, bytes or os.PathLike object, not NoneType

System Information

calibre 6.2.1 ,64bit
Windows-10-10.0.19044-SP0 Windows ('64bit', 'WindowsPE')
Python 3.10.1 ,64bit
Worddumb 3.24.0

Error message

calibre 6.2.1  embedded-python: True
Windows-10-10.0.19044-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19044')
Python 3.10.1
Windows: ('10', '10.0.19044', 'SP0', 'Multiprocessor Free')
Interface language: zh_TW
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 49, 0) && DeDRM (10, 0, 3) && Package KFX (from KFX Input) (1, 49, 0) && Chinese Text Conversion (2, 4, 0) && EpubMerge (2, 14, 0) && KFX metadata reader (from KFX Input) (1, 49, 0) && KFX Input (1, 49, 0) && Set KFX metadata (from KFX Output) (1, 64, 0) && KFX Output (1, 64, 0) && WordDumb (3, 24, 0) && X-Ray Creator (3, 2, 1)
Traceback (most recent call last):
  File "calibre\gui2\main.py", line 456, in send_message
  File "calibre\gui2\listener.py", line 91, in send_message_in_process
OSError: Failed to connect to Listener at: \\.\pipe\CalibreGUI-kayuex with error: QLocalSocket::connectToServer: Invalid name

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "calibre\gui2\main.py", line 460, in send_message
  File "calibre\gui2\listener.py", line 91, in send_message_in_process
OSError: Failed to connect to Listener at: \\.\pipe\CalibreGUI-kayuex with error: QLocalSocket::connectToServer: Invalid name

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "calibre\gui2\main.py", line 548, in main
  File "calibre\gui2\main.py", line 561, in run_main
  File "calibre\gui2\main.py", line 494, in communicate
  File "calibre\gui2\main.py", line 465, in send_message
calibre.gui2.main.FailedToCommunicate: retrying

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "calibre_plugins.worddumb.config", line 187, in open_custom_lemmas_dialog
  File "calibre_plugins.worddumb.custom_lemmas", line 46, in __init__
  File "calibre_plugins.worddumb.custom_lemmas", line 237, in __init__
**TypeErroTypeErrorr: expected str, bytes or os.PathLike object, not NoneType**

Reproduce steps

When I click the "customize kindle word wise" button, it pops up an error message
TypeErroTypeErrorr: expected str, bytes or os.PathLike object, not NoneType

Screenshots or videos

擷取

eBook gets transferred without cover image

Describe the bug
Everything worked flawlessly, my only complaint is that the cover of the ebook doesn't get transferred to the Kindle Basic (10th Gen).

System Information

  • OS: macOS Monterey
  • calibre version: 5.40
  • Python version: 2.17.18
  • Plugin version 3.19.0

Error message
N/A

To Reproduce
Send a book with WordDumb over to your Kindle device using a USB cable and notice that it doesn't have any cover.

Expected behavior
For it to have a cover. I was able to get it with cover even when I tried to manually send the .mobi file generated by Calibre.

Screenshots or videos
If applicable, add screenshots or videos to help explain your problem.

Additional context
Add any other context about the problem here.

Problem with new test feature: Word Wise for EPUB books

Describe the bug

All Spanish books I've test are perfectly generated, by English books are bad generated. Many lines over the word without definition or repeated definitions.
I enclose examples.

System Information

OS: Windows 11
calibre version: Last one
Phyton version: Python 3.10.5
Plugin version: 3,24.0 (last in GitHub Actions right now)

Error message

No error message

Reproduce steps

  1. Generate epub with word wise

Screenshots or videos

1
2

How to fix this ???

Describe the bug

I can not use word wise

System Information

OS: [e.g. Windows 10, 64bit]
calibre version: [e.g. 5.24.0, 64bit]
Python version: [e.g. 3.9.6, 64bit]
Plugin version [e.g. 3.10.4]

Error message

calibre, version 5.40.0 (win32, embedded-python: True)
Tonnerre de Brest!: An error occurred, please copy error message then report bug at GitHub. 

Starting job: Generating X-Ray for [Title here] 
Job: "Generating X-Ray for [Title here]" failed with error: 
Traceback (most recent call last):
  File "calibre\gui2\threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 63, in do_job
  File "calibre_plugins.worddumb.deps", line 23, in __init__
  File "calibre_plugins.worddumb.deps", line 65, in install_x_ray_deps
  File "calibre_plugins.worddumb.deps", line 75, in pip_install
  File "subprocess.py", line 512, in run
subprocess.CalledProcessError: Command '['py', '-m', 'pip', 'install', '-U', '-t', WindowsPath('C:/Users/Kaoru/AppData/Roaming/calibre/plugins/worddumb-libs-py3.8'), '--no-deps', 'https://github.com/explosion/spacy-models/releases/download/en_core_web_lg-3.2.0/en_core_web_lg-3.2.0-py3-none-any.whl']' returned non-zero exit status 2.
 
Called with args: ((67, 'EPUB', 'C:\\Users\\Kaoru\\Calibre Library\\Mishima Yomu volume 3\\[Title here] (67)\\[Title here] - Mishima Yomu volume 3.epub', <calibre.ebooks.metadata.book.base.Metadata object at 0x00000267E6784CD0>, {'spacy': 'en_core_web_', 'wiki': 'en'}), False, True) {'notifications': <queue.Queue object at 0x00000267E6784F70>, 'abort': <threading.Event object at 0x00000267E67849D0>, 'log': <calibre.utils.logging.GUILog object at 0x00000267E6784910>} 
ERROR: Exception:
Traceback (most recent call last):
  File "C:\Users\Kaoru\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pip\_internal\cli\base_command.py", line 188, in main
    status = self.run(options, args)
  File "C:\Users\Kaoru\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pip\_internal\commands\install.py", line 345, in run
    resolver.resolve(requirement_set)
  File "C:\Users\Kaoru\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pip\_internal\legacy_resolve.py", line 196, in resolve
    self._resolve_one(requirement_set, req)
  File "C:\Users\Kaoru\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pip\_internal\legacy_resolve.py", line 359, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "C:\Users\Kaoru\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pip\_internal\legacy_resolve.py", line 305, in _get_abstract_dist_for
    abstract_dist = self.preparer.prepare_linked_requirement(
  File "C:\Users\Kaoru\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pip\_internal\operations\prepare.py", line 195, in prepare_linked_requirement
    unpack_url(
  File "C:\Users\Kaoru\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pip\_internal\download.py", line 1058, in unpack_url
    unpack_http_url(
  File "C:\Users\Kaoru\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pip\_internal\download.py", line 920, in unpack_http_url
    from_path, content_type = _download_http_url(link,
  File "C:\Users\Kaoru\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pip\_internal\download.py", line 1152, in _download_http_url
    _download_url(resp, link, content_file, hashes, progress_bar)
  File "C:\Users\Kaoru\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pip\_internal\download.py", line 863, in _download_url
    consume(downloaded_chunks)
  File "C:\Users\Kaoru\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pip\_internal\utils\misc.py", line 1056, in consume
    deque(iterator, maxlen=0)
  File "C:\Users\Kaoru\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pip\_internal\download.py", line 829, in written_chunks
    for chunk in chunks:
  File "C:\Users\Kaoru\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pip\_internal\utils\ui.py", line 156, in iter
    for x in it:
  File "C:\Users\Kaoru\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pip\_internal\download.py", line 794, in resp_read
    for chunk in resp.raw.stream(
  File "C:\Users\Kaoru\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pip\_vendor\urllib3\response.py", line 531, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "C:\Users\Kaoru\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pip\_vendor\urllib3\response.py", line 479, in read
    data = self._fp.read(amt)
  File "C:\Users\Kaoru\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 63, in read
    self.__buf.write(data)
MemoryError
WARNING: You are using pip version 19.2.3, however version 22.0.4 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

Reproduce steps

  1. Go to ...
  2. Click on ...
  3. Scroll down to ...
  4. See error

Screenshots or videos

No response

How can I fix this error

Describe the bug

when I run the wordDumb ,I got an error like below.

System Information

OS:windows 11 64bit
Calibre version:5.43 64bit
python version:I installed anaconda(64bit)instead of directly install python
plugin version:3.21.2

Error message

calibre, version 5.43.0 (win32, embedded-python: True)
Tonnerre de Brest!: An error occurred, please copy error message then report bug at GitHub.

Starting job: Generating Word Wise and X-Ray for Great Expectations (远大前程) (免费公版书) 
Job: "Generating Word Wise and X-Ray for Great Expectations (远大前程) (免费公版书)" failed with error: 
Traceback (most recent call last):
  File "calibre\gui2\threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 68, in do_job
  File "calibre_plugins.worddumb.deps", line 25, in install_deps
  File "calibre_plugins.worddumb.deps", line 43, in which_python
  File "calibre_plugins.worddumb.utils", line 37, in run_subprocess
  File "subprocess.py", line 512, in run
subprocess.CalledProcessError: Command '['python', '-c', 'import sys; print(sys.maxsize > 2**32)']' returned non-zero exit status 9009.
 
Called with args: ((63, 'AZW3', 'F:\\EBooks\\Calibre Library\\Dickens,Charles\\Great Expectations (Yuan Da Qian Che (63)\\Great Expectations (Yuan Da Qia - Dickens,Charles.azw3', <calibre.ebooks.metadata.book.base.Metadata object at 0x000001C70E4B8160>, {'spacy': 'en_core_web_', 'wiki': 'en'}), True, True) {'notifications': <queue.Queue object at 0x000001C70E4B84F0>, 'abort': <threading.Event object at 0x000001C70E4D2C70>, 'log': <calibre.utils.logging.GUILog object at 0x000001C70E4D2E20>}

Reproduce steps

1.run wordDumb
2.error occurred

Screenshots or videos

image

Can't generate xray on a book I downloaded

Describe the bug

I tried to Generate X-Ray and Wordwise for a book, a bug happened and it didn't succet.

System Information

OS: Windows 11 21H2 x64
Calibre version: 5.41, 64bit
Python version: 3.10.4, 64bit
Plugin version: 3.19.0

Error message

calibre, version 5.41.0 (win32, embedded-python: True)
Tonnerre de Brest!: An error occurred, please copy error message then report bug at GitHub. 

Starting job: Generating X-Ray for The Intelligent Investor, Rev. Ed: The Definitive Book on Value Investing 
Job: "Generating X-Ray for The Intelligent Investor, Rev. Ed: The Definitive Book on Value Investing" failed with error: 
Traceback (most recent call last):
  File "calibre\gui2\threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 101, in do_job
  File "calibre_plugins.worddumb.parse_job", line 197, in create_files
  File "calibre_plugins.worddumb.x_ray_epub", line 126, in modify_epub
  File "calibre_plugins.worddumb.x_ray_epub", line 238, in zip_extract_folder
  File "shutil.py", line 737, in rmtree
  File "shutil.py", line 610, in _rmtree_unsafe
  File "shutil.py", line 619, in _rmtree_unsafe
  File "shutil.py", line 617, in _rmtree_unsafe
PermissionError: [WinError 5] Access is denied: 'X:\\#Others\\Calibre_Data\\Biblioteca\\Benjamin Graham\\The Intelligent Investor, Rev. Ed_ (512)\\extract\\META-INF'
 
Called with args: ((512, 'EPUB', 'X:\\#Others\\Calibre_Data\\Biblioteca\\Benjamin Graham\\The Intelligent Investor, Rev. Ed_ (512)\\The Intelligent Investor, Rev. - Benjamin Graham.epub', <calibre.ebooks.metadata.book.base.Metadata object at 0x00000151D4A53250>, {'spacy': 'en_core_web_', 'wiki': 'en'}), False, True) {'notifications': <queue.Queue object at 0x00000151D4A53460>, 'abort': <threading.Event object at 0x00000151D4A535E0>, 'log': <calibre.utils.logging.GUILog object at 0x00000151D4A53790>}

Reproduce steps

  1. Download this book https://libgen.rocks/ads.php?md5=4E11C78A1F1B15126DC967F34751B72D
  2. add it to calibre library
  3. In WordDumb, click "create X-Ray and WordWise

Screenshots or videos

No response

Error message while trying to use wordwise

Describe the bug

I tried creating word wise for a book, an error popped up, saying I should report it here. No idea what caused it.

System Information

Windows 11 x64 21H2
Plugin v3.23.1
Calibre 6.0.1 x64
Python 3.10 x64

Error message

calibre, version 6.1.0 (win32, embedded-python: True)
Tonnerre de Brest!: An error occurred, please copy error message then report bug at GitHub.

Starting job: Generating Word Wise and X-Ray for Structure and Interpretation of Computer Programs 
Job: "Generating Word Wise and X-Ray for Structure and Interpretation of Computer Programs" failed with error: 
Traceback (most recent call last):
  File "calibre\gui2\threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 149, in do_job
  File "calibre_plugins.worddumb.parse_job", line 246, in create_files
  File "calibre_plugins.worddumb.parse_job", line 570, in load_spacy
  File "C:\Users\ezbie\AppData\Roaming\calibre\plugins\worddumb-libs-py3.10\spacy\__init__.py", line 6, in <module>
  File "C:\Users\ezbie\AppData\Roaming\calibre\plugins\worddumb-libs-py3.10\spacy\errors.py", line 2, in <module>
  File "C:\Users\ezbie\AppData\Roaming\calibre\plugins\worddumb-libs-py3.10\spacy\compat.py", line 38, in <module>
  File "C:\Users\ezbie\AppData\Roaming\calibre\plugins\worddumb-libs-py3.10\thinc\api.py", line 2, in <module>
  File "C:\Users\ezbie\AppData\Roaming\calibre\plugins\worddumb-libs-py3.10\thinc\initializers.py", line 4, in <module>
  File "C:\Users\ezbie\AppData\Roaming\calibre\plugins\worddumb-libs-py3.10\thinc\backends\__init__.py", line 8, in <module>
  File "C:\Users\ezbie\AppData\Roaming\calibre\plugins\worddumb-libs-py3.10\thinc\backends\cupy_ops.py", line 4, in <module>
  File "thinc\backends\numpy_ops.pyx", line 1, in init thinc.backends.numpy_ops
ModuleNotFoundError: No module named 'cymem.cymem'
 
Called with args: ((516, 'EPUB', 'X:\\#Others\\Calibre_Data\\Biblioteca\\Harold Abelson\\Structure and Interpretation of Com (516)\\Structure and Interpretation of - Harold Abelson.epub', <calibre.ebooks.metadata.book.base.Metadata object at 0x000001BE85760220>, {'spacy': 'en_core_web_', 'wiki': 'en', 'kaikki': 'English'}), True, True) {'notifications': <queue.Queue object at 0x000001BE85762140>, 'abort': <threading.Event object at 0x000001BE833D3130>, 'log': <calibre.utils.logging.GUILog object at 0x000001BE833D1FC0>}

Reproduce steps

1 Select given book
2. Click on worddumb
3. select option to create wordwise plus x ray
4. get the error message

Screenshots or videos

No response

I need some help for the latest plugin 3.23.1 creat x-ray

Describe the bug

I downloaded the latest version of the plugin, the dictionary function is available, but x-ray is not available for all books, the previous version can be used. I'm a new programmer and even this passage was written in a translator, so I couldn't solve the problem in the error message myself, so please give me some help if you can.

System Information

OS: Windows 10 64
Calibre 6.1
Python 3.10
Plugin 3.23.1

Error message

calibre, version 6.1.0 (win32, embedded-python: True)
Tonnerre de Brest!: An error occurred, please copy error message then report bug at GitHub.

Starting job: Generating Word Wise and X-Ray for Harry Potter and the Philosopher's Stone 
Job: "Generating Word Wise and X-Ray for Harry Potter and the Philosopher's Stone" failed with error: 
Traceback (most recent call last):
  File "calibre\gui2\threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 149, in do_job
  File "calibre_plugins.worddumb.parse_job", line 246, in create_files
  File "calibre_plugins.worddumb.parse_job", line 570, in load_spacy
  File "C:\Users\86153\AppData\Roaming\calibre\plugins\worddumb-libs-py3.10\spacy\__init__.py", line 6, in <module>
  File "C:\Users\86153\AppData\Roaming\calibre\plugins\worddumb-libs-py3.10\spacy\errors.py", line 2, in <module>
  File "C:\Users\86153\AppData\Roaming\calibre\plugins\worddumb-libs-py3.10\spacy\compat.py", line 3, in <module>
  File "C:\Users\86153\AppData\Roaming\calibre\plugins\worddumb-libs-py3.10\thinc\__init__.py", line 5, in <module>
  File "C:\Users\86153\AppData\Roaming\calibre\plugins\worddumb-libs-py3.10\thinc\config.py", line 14, in <module>
  File "C:\Users\86153\AppData\Roaming\calibre\plugins\worddumb-libs-py3.10\srsly\__init__.py", line 1, in <module>
  File "C:\Users\86153\AppData\Roaming\calibre\plugins\worddumb-libs-py3.10\srsly\_json_api.py", line 6, in <module>
  File "C:\Users\86153\AppData\Roaming\calibre\plugins\worddumb-libs-py3.10\srsly\ujson\__init__.py", line 1, in <module>
ModuleNotFoundError: No module named 'srsly.ujson.ujson'
 
Called with args: ((10, 'AZW3', "C:\\Users\\86153\\书库\\J.K. Rowling\\Harry Potter and the Philosopher's S (10)\\Harry Potter and the Philosophe - J.K. Rowling.azw3", <calibre.ebooks.metadata.book.base.Metadata object at 0x000001D33DCBA260>, {'spacy': 'en_core_web_', 'wiki': 'en', 'kaikki': 'English'}), True, True) {'notifications': <queue.Queue object at 0x000001D33DCBBF10>, 'abort': <threading.Event object at 0x000001D33DCB93F0>, 'log': <calibre.utils.logging.GUILog object at 0x000001D33DCB8F40>}

Reproduce steps

1.chose one book
2.just click the pink star
3.no more than 10second here is this error message

Screenshots or videos

No response

An error occured

Describe the bug

Create X-Ray suddenly stopped working.

Two error messages is attached.

System Information

OS: macOS Big Sur 11.6, Mac mini M1 2020
calibre 5.43.0
WordDumb 3.21.0

Error message

// Error 1
calibre, version 5.43.0 (darwin, embedded-python: True)
Tonnerre de Brest!: An error occurred, please copy error message then report bug at GitHub.

Starting job: Generating X-Ray for Deep Work 
Job: "Generating X-Ray for Deep Work" failed with error: 
Traceback (most recent call last):
  File "calibre/gui2/threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 68, in do_job
    install_deps(model, book_fmt, notifications)
  File "calibre_plugins.worddumb.deps", line 25, in install_deps
    PY_PATH, PY_VERSION = which_python()
  File "calibre_plugins.worddumb.deps", line 47, in which_python
    py = mac_python(True)
  File "calibre_plugins.worddumb.deps", line 64, in mac_python
    upgrade_mac_pip()
  File "calibre_plugins.worddumb.deps", line 126, in upgrade_mac_pip
    r = run_subprocess([PY_PATH, "-m", "pip", "--version"])
NameError: name 'PY_PATH' is not defined
 
Called with args: ((81, 'EPUB', '/Users/carlo/Calibre Library/Cal Newport/Deep Work (81)/Deep Work - Cal Newport.epub', <calibre.ebooks.metadata.book.base.Metadata object at 0x13bb20e20>, {'spacy': 'en_core_web_', 'wiki': 'en'}), False, True) {'notifications': <queue.Queue object at 0x13bb20c70>, 'abort': <threading.Event object at 0x13b9d44c0>, 'log': <calibre.utils.logging.GUILog object at 0x13b9d48b0>} 

// Error 2
calibre, version 5.43.0 (darwin, embedded-python: True)
Tonnerre de Brest!: An error occurred, please copy error message then report bug at GitHub.

Starting job: Generating X-Ray for Can't Hurt Me: Master Your Mind and Defy the Odds 
Job: "Generating X-Ray for Can't Hurt Me: Master Your Mind and Defy the Odds" failed with error: 
Traceback (most recent call last):
  File "calibre/gui2/threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 68, in do_job
    install_deps(model, book_fmt, notifications)
  File "calibre_plugins.worddumb.deps", line 25, in install_deps
    PY_PATH, PY_VERSION = which_python()
  File "calibre_plugins.worddumb.deps", line 47, in which_python
    py = mac_python(True)
  File "calibre_plugins.worddumb.deps", line 64, in mac_python
    upgrade_mac_pip()
  File "calibre_plugins.worddumb.deps", line 126, in upgrade_mac_pip
    r = run_subprocess([PY_PATH, "-m", "pip", "--version"])
NameError: name 'PY_PATH' is not defined
 
Called with args: ((82, 'EPUB', "/Users/carlo/Calibre Library/David Goggins/Can't Hurt Me_ Master Your Mind and Defy the Odds (82)/Can't Hurt Me_ Master Your Mind and Defy t - David Goggins.epub", <calibre.ebooks.metadata.book.base.Metadata object at 0x13ba49cd0>, {'spacy': 'en_core_web_', 'wiki': 'en'}), False, True) {'notifications': <queue.Queue object at 0x13ba49eb0>, 'abort': <threading.Event object at 0x13be9f190>, 'log': <calibre.utils.logging.GUILog object at 0x13be9f2e0>}

Reproduce steps

  1. Click dropdown icon of WordDumb
  2. Click 'Create X-ray'
  3. Error

Screenshots or videos

No response

Error message while trying to use wordwise

Describe the bug

Error message while trying to use wordwise

System Information

Mac os 11.6.2
calibre version: 6.1.0
Python version: 3.10.4, 64bit

Error message

calibre, version 6.1.0 (darwin, embedded-python: True)
Tonnerre de Brest!: An error occurred, please copy error message then report bug at GitHub.

Starting job: Generating Word Wise for Influence 
Job: "Generating Word Wise for Influence" failed with error: 
Traceback (most recent call last):
  File "calibre/gui2/threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 87, in do_job
    dump_wiktionary_job(plugin_path, lang, True, notifications=notifications)
  File "calibre_plugins.worddumb.parse_job", line 188, in dump_wiktionary_job
    download_and_dump_wiktionary(
  File "calibre_plugins.worddumb.data.wiktionary", line 142, in download_and_dump_wiktionary
    extract_wiktionary(download_path, lang["wiki"], kindle_lemmas, notif)
  File "calibre_plugins.worddumb.data.wiktionary", line 45, in extract_wiktionary
    data = json.loads(line)
  File "json/__init__.py", line 346, in loads
  File "json/decoder.py", line 337, in decode
  File "json/decoder.py", line 353, in raw_decode
json.decoder.JSONDecodeError: Unterminated string starting at: line 1 column 899 (char 898)
 
Called with args: ((81, 'EPUB', '/Users/afshany/Calibre Library/Robert B. Cialdini, PhD/Influence (81)/Influence - Robert B. Cialdini, PhD.epub', <calibre.ebooks.metadata.book.base.Metadata object at 0x1252da4d0>, {'spacy': 'en_core_web_', 'wiki': 'en', 'kaikki': 'English'}), True, False) {'notifications': <queue.Queue object at 0x125278c10>, 'abort': <threading.Event object at 0x125278ac0>, 'log': <calibre.utils.logging.GUILog object at 0x125278a00>}

Reproduce steps

1 Select the given book
2. Click on worddumb
3. select the option to create wordwise
4. get the error message

Screenshots or videos

No response

No Wordwise with abnormal: sqlite3.OperationalError

Describe the bug

The wordwise feature of the plugin cannot work with an abnormal 'sqlite3.OperationalError: no such table'

System Information

OS: MacOS Monterey 12.4
calibre, version: 5.44.0
python verion: 3.9
plugin version: 3.21.2

Error message

错误: 未处理的异常: <b>OperationalError</b>:no such table: lemmas

calibre 5.44  embedded-python: True is64bit: True
macOS-10.16-x86_64-i386-64bit Darwin ('64bit', '')
('Darwin', '21.5.0', 'Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:29 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T8101')
Python 3.8.5
OSX: ('10.16', ('', '', ''), 'x86_64')
Interface language: zh_CN
Successfully initialized third party plugins: WordDumb (3, 21, 2)
Traceback (most recent call last):
  File "calibre_plugins.worddumb.config", line 170, in open_custom_lemmas_dialog
    custom_lemmas_dlg = CustomLemmasDialog(self)
  File "calibre_plugins.worddumb.custom_lemmas", line 31, in __init__
    self.lemmas_model = LemmasTableModle()
  File "calibre_plugins.worddumb.custom_lemmas", line 79, in __init__
    for (lemma, sense_id, short_def, full_def) in klld_conn.execute(
sqlite3.OperationalError: no such table: lemmas

Reproduce steps

  1. Connect Kindle
  2. Go to 'Calibre", pick an AZW3
  3. Click on 'WordDumb' to create WordWise and no task is added
  4. Open the preference of WordDumb, and click on 'Customize Word Wise lemmas' -- An error occurs.

Screenshots or videos

No response

Use other dictionaries instead of Wiktionary for word wise

The newly added feature that adds word wise to epubs is great!

Since the quality of Wiktionary is relatively low sometimes, I'm wondering if it's possible to use some customized dictionaries for word wise. A good example is this plugin for Anki: https://github.com/sth2018/FastWordQuery

Another request is if WordDumb can support "fuzzy query", meaning that it would hit the word with different forms.

It might be too much to ask! Thank you so much!

Use locally downloaded Wiktionary data to generate Word Wise for epubs

Describe the bug

Thank you so much for creating this great plugin!

I encountered the following error while trying to generate Word Wise for an epub file. I think it's because the access to the website hosting the Wiktionary data is blocked.

Since I can download the database manually via a browser routed with a proxy, is it possible to add an option asking the Worddumb plugin to use the database on my computer I downloaded?

System Information

calibre, version 6.1.0 (win32, embedded-python: True)

Error message

Tonnerre de Brest!: An error occurred, please copy error message then report bug at GitHub.

Starting job: Generating Word Wise for How to Lie with Statistics 
Job: "Generating Word Wise for How to Lie with Statistics" failed with error: 
Traceback (most recent call last):
  File "calibre\gui2\threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 87, in do_job
  File "calibre_plugins.worddumb.parse_job", line 188, in dump_wiktionary_job
  File "calibre_plugins.worddumb.data.wiktionary", line 144, in download_and_dump_wiktionary
  File "calibre_plugins.worddumb.data.wiktionary", line 47, in extract_wiktionary
  File "json\__init__.py", line 346, in loads
  File "json\decoder.py", line 337, in decode
  File "json\decoder.py", line 353, in raw_decode
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 4954 (char 4953)

Reproduce steps

Called with args: ((517, 'EPUB', 'C:\Users\Administrator\Calibre Library\Darrell Huff; Irving Geis\How to Lie with Statistics (517)\How to Lie with Statistics - Darrell Huff; Irving Geis.epub', <calibre.ebooks.metadata.book.base.Metadata object at 0x00000284096F0A30>, {'spacy': 'en_core_web_', 'wiki': 'en', 'kaikki': 'English'}), True, False) {'notifications': <queue.Queue object at 0x00000284096F0BB0>, 'abort': <threading.Event object at 0x00000284096F08E0>, 'log': <calibre.utils.logging.GUILog object at 0x00000284096F0C40>}

Screenshots or videos

No response

File not found error on certain books

Describe the bug

When running with certain books it hands off an error

System Information

OS:Windows 10 Pro
Calibre: 6.3
Python: 3.5.2
Plugin: 3.25.0

Error message

calibre, version 6.3.0 (win32, embedded-python: True)
Tonnerre de Brest!: An error occurred, please copy error message then report bug at GitHub.

Starting job: Generating Word Wise and X-Ray for Mistborn: The Final Empire 
Job: "Generating Word Wise and X-Ray for Mistborn: The Final Empire" failed with error: 
Traceback (most recent call last):
  File "calibre\gui2\threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 82, in do_job
  File "calibre_plugins.worddumb.deps", line 170, in download_wiktionary
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Fluff\\AppData\\Roaming\\calibre\\plugins\\worddumb-lemmas\\wiktionary_en_v0.1.0.tar.gz'
 
Called with args: ((32, 'EPUB', 'C:\\Users\\Fluff\\Calibre Library\\Brandon Sanderson\\Mistborn_ The Final Empire (32)\\Mistborn_ The Final Empire - Brandon Sanderson.epub', <calibre.ebooks.metadata.book.base.Metadata object at 0x000002BEB7EE3760>, {'spacy': 'en_core_web_', 'wiki': 'en', 'kaikki': 'English'}), True, True) {'notifications': <queue.Queue object at 0x000002BEB7EDE6E0>, 'abort': <threading.Event object at 0x000002BEB7EDE7A0>, 'log': <calibre.utils.logging.GUILog object at 0x000002BEB7EDE830>}

Reproduce steps

Select books
Run the plugin

Screenshots or videos

No response

X-Ray is not hideen beyond the point of reading

Describe the bug

As you can see in the screenshots (second to the end), X-Ray is hidden beyond the point of reading to protect the appareances of the character in future reading (spoilers). This not happen is your X-Ray files as you can see in the first screenshot. All of the images have been taken having the point of reading in the middle of the book more or less. By the way, with the standard way of working, if you want to go beyond the point of reading, you can do it, as you can see in the other screenshots.
I enclose a correct X-Ray file.

System Information

OS: Windows 11
calibre version: Last one
Phyton version: Python 3.10.5
Plugin version: 3,24.0

Error message

None

Reproduce steps

  1. Tap in a X-Ray word
  2. Go to X-Ray

Screenshots or videos

screenshot_2022_07_30T08_35_37+0100
Captura de pantalla 2022-07-30 094033
screenshot_2022_07_30T08_42_02+0100
screenshot_2022_07_30T08_42_09+0100

Sira - Maria Duenas Vinuesa.zip

Nonsense error message appears generating only X-Ray

Wonderful plugin. More than expected. When generating X-Ray in Spanish (Create X-Ray option), it does work perfectly, but a nonsense error message appears. It says:
Non-English book: For Kindle format books, Word Wise is only available in books in English.
I'm not traying to generate Word Wise, only X-Ray. I think this message should not appear in this menu option.

Wordwise works but X-Ray doesn't

Wordwise seems to run fine, X-Ray errors :

Traceback (most recent call last):
File "calibre\gui2\threaded_jobs.py", line 83, in start_work
File "calibre_plugins.worddumb.parse_job", line 37, in do_job
File "C:\Users\USERNAME\AppData\Roaming\calibre\plugins\worddumb-libs\spacy_3.1.1_3.8\spacy\__init__.py", line 11, in <module>
File "C:\Users\USERNAME\AppData\Roaming\calibre\plugins\worddumb-libs\thinc_8.0.8_3.8\thinc\__init__.py", line 5, in <module>
File "C:\Users\USERNAME\AppData\Roaming\calibre\plugins\worddumb-libs\thinc_8.0.8_3.8\thinc\config.py", line 14, in <module>
File "C:\Users\USERNAME\AppData\Roaming\calibre\plugins\worddumb-libs\srsly_2.4.1_3.8\srsly\__init__.py", line 1, in <module>
File "C:\Users\USERNAME\AppData\Roaming\calibre\plugins\worddumb-libs\srsly_2.4.1_3.8\srsly\_json_api.py", line 6, in <module>
File "C:\Users\USERNAME\AppData\Roaming\calibre\plugins\worddumb-libs\srsly_2.4.1_3.8\srsly\ujson\__init__.py", line 1, in <module>
ModuleNotFoundError: No module named 'srsly.ujson.ujson'

pip says srsly is installed correctly, and C:\Users\USERNAME\AppData\Roaming\calibre\plugins\worddumb-libs\srsly_2.4.1_3.8\srsly\ujson
exists and has ujson.c inside among other files..

(unrelated? : I had to manually add blis_0.7.4_3.8 to the worddumb-libs on Windows 10 to clear an other error)

C:\Users\USERNAME\AppData\Roaming\calibre\plugins\worddumb-libs\srsly_2.4.1_3.8\srsly\ujson_init_.py line 1 is :

from .ujson import decode, encode, dump, dumps, load, loads # noqa: F401

Called with args: ((1587, 'MOBI', 'BBGL0Z779A', 'book.mobi', <calibre.ebooks.metadata.book.base.Metadata object at 0x082C44C0>, {'spacy': 'en_core_web_', 'wiki': 'en'}), False, True) {'notifications': <queue.Queue object at 0x082C46B8>, 'abort': <threading.Event object at 0x082C45F8>, 'log': <calibre.utils.logging.GUILog object at 0x082C45C8>}

Windows 10
Python 3.9
Calibre - 5.24

Installed the plugin today.

How to fix this please?

Describe the bug

It just don't work.

System Information

Python Version: 3.9 (64-bit)
Plugin version: 3.19.0

Error message

calibre, version 5.41.0 (win32, embedded-python: True)
Tonnerre de Brest!: An error occurred, please copy error message then report bug at GitHub. 

Starting job: Generating Word Wise and X-Ray for Good Rich People 
Job: "Generating Word Wise and X-Ray for Good Rich People" failed with error: 
Traceback (most recent call last):
  File "calibre\gui2\threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 101, in do_job
  File "calibre_plugins.worddumb.parse_job", line 169, in create_files
  File "C:\Users\tibor\AppData\Roaming\calibre\plugins\worddumb-libs-py3.8\spacy\__init__.py", line 11, in <module>
  File "C:\Users\tibor\AppData\Roaming\calibre\plugins\worddumb-libs-py3.8\thinc\api.py", line 2, in <module>
  File "C:\Users\tibor\AppData\Roaming\calibre\plugins\worddumb-libs-py3.8\thinc\initializers.py", line 4, in <module>
  File "C:\Users\tibor\AppData\Roaming\calibre\plugins\worddumb-libs-py3.8\thinc\backends\__init__.py", line 8, in <module>
  File "C:\Users\tibor\AppData\Roaming\calibre\plugins\worddumb-libs-py3.8\thinc\backends\cupy_ops.py", line 19, in <module>
  File "thinc\backends\numpy_ops.pyx", line 1, in init thinc.backends.numpy_ops
  File "thinc\backends\linalg.pyx", line 2, in init thinc.backends.linalg
ValueError: source code string cannot contain null bytes
 
Called with args: ((733, 'KFX', 'C:\\Users\\tibor\\Calibre Library\\Eliza Jane Brazier\\Good Rich People (733)\\Good Rich People - Eliza Jane Brazier.kfx', <calibre.ebooks.metadata.book.base.Metadata object at 0x000001F5B40BB1F0>, {'spacy': 'en_core_web_', 'wiki': 'en'}), True, True) {'notifications': <queue.Queue object at 0x000001F5B40BB340>, 'abort': <threading.Event object at 0x000001F5B40BB460>, 'log': <calibre.utils.logging.GUILog object at 0x000001F5B40BB5B0>}

Reproduce steps

It does not work. HELP PLESE

Screenshots or videos

No response

I got this error message while creating x ray (HELP)

calibre, version 5.37.0 (darwin, embedded-python: True)
Mille millions de mille milliards de mille sabords!: subprocess.run() failed, please copy error message then report bug at GitHub

Starting job: Generating X-Ray for Napoleon the Great
Job: "Generating X-Ray for Napoleon the Great" failed with error:
Traceback (most recent call last):
File "calibre/gui2/threaded_jobs.py", line 82, in start_work
File "calibre_plugins.worddumb.parse_job", line 58, in do_job
subprocess.run(
File "subprocess.py", line 512, in run
subprocess.CalledProcessError: Command '['/usr/bin/python3', '/Users/moinqureshi/Library/Preferences/calibre/plugins/WordDumb.zip', 'BBPNNLKU26', '/Users/moinqureshi/Calibre Library/Andrew Roberts/Napoleon the Great (39)/Napoleon the Great - Andrew Roberts.kfx', 'CR!SXGJ70N16NVGGGN1XQJDOBYOZLPU', '', 'en_core_web_md', 'en', '', '/Users/moinqureshi/Library/Preferences/calibre/plugins/WordDumb.zip', '3.18.4', 'cn', '', '-s']' returned non-zero exit status 1.

Called with args: ((39, 'KFX', '/Users/moinqureshi/Calibre Library/Andrew Roberts/Napoleon the Great (39)/Napoleon the Great - Andrew Roberts.kfx', <calibre.ebooks.metadata.book.base.Metadata object at 0x133f93f40>, {'spacy': 'en_core_web_', 'wiki': 'en'}), False, True) {'notifications': <queue.Queue object at 0x133f93550>, 'abort': <threading.Event object at 0x134053820>, 'log': <calibre.utils.logging.GUILog object at 0x1340530a0>}
Traceback (most recent call last):
File "/Users/moinqureshi/Library/Preferences/calibre/plugins/worddumb-libs-py3.8/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/Users/moinqureshi/Library/Preferences/calibre/plugins/worddumb-libs-py3.8/urllib3/connectionpool.py", line 449, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "/Users/moinqureshi/Library/Preferences/calibre/plugins/worddumb-libs-py3.8/urllib3/connectionpool.py", line 444, in _make_request
httplib_response = conn.getresponse()
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/http/client.py", line 1344, in getresponse
response.begin()
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/http/client.py", line 307, in begin
version, status, reason = self._read_status()
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/http/client.py", line 268, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
ConnectionResetError: [Errno 54] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/moinqureshi/Library/Preferences/calibre/plugins/worddumb-libs-py3.8/requests/adapters.py", line 440, in send
resp = conn.urlopen(
File "/Users/moinqureshi/Library/Preferences/calibre/plugins/worddumb-libs-py3.8/urllib3/connectionpool.py", line 785, in urlopen
retries = retries.increment(
File "/Users/moinqureshi/Library/Preferences/calibre/plugins/worddumb-libs-py3.8/urllib3/util/retry.py", line 550, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/Users/moinqureshi/Library/Preferences/calibre/plugins/worddumb-libs-py3.8/urllib3/packages/six.py", line 769, in reraise
raise value.with_traceback(tb)
File "/Users/moinqureshi/Library/Preferences/calibre/plugins/worddumb-libs-py3.8/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/Users/moinqureshi/Library/Preferences/calibre/plugins/worddumb-libs-py3.8/urllib3/connectionpool.py", line 449, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "/Users/moinqureshi/Library/Preferences/calibre/plugins/worddumb-libs-py3.8/urllib3/connectionpool.py", line 444, in _make_request
httplib_response = conn.getresponse()
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/http/client.py", line 1344, in getresponse
response.begin()
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/http/client.py", line 307, in begin
version, status, reason = self._read_status()
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/http/client.py", line 268, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/Users/moinqureshi/Library/Preferences/calibre/plugins/WordDumb.zip/main.py", line 37, in
File "/Users/moinqureshi/Library/Preferences/calibre/plugins/WordDumb.zip/parse_job.py", line 105, in create_files
File "/Users/moinqureshi/Library/Preferences/calibre/plugins/WordDumb.zip/parse_job.py", line 187, in find_named_entity
File "/Users/moinqureshi/Library/Preferences/calibre/plugins/WordDumb.zip/x_ray.py", line 168, in search
File "/Users/moinqureshi/Library/Preferences/calibre/plugins/WordDumb.zip/x_ray.py", line 133, in insert_entity
File "/Users/moinqureshi/Library/Preferences/calibre/plugins/WordDumb.zip/x_ray.py", line 148, in insert_description
File "/Users/moinqureshi/Library/Preferences/calibre/plugins/WordDumb.zip/x_ray.py", line 85, in search_wikipedia
File "/Users/moinqureshi/Library/Preferences/calibre/plugins/worddumb-libs-py3.8/requests/sessions.py", line 542, in get
return self.request('GET', url, **kwargs)
File "/Users/moinqureshi/Library/Preferences/calibre/plugins/worddumb-libs-py3.8/requests/sessions.py", line 529, in request
resp = self.send(prep, **send_kwargs)
File "/Users/moinqureshi/Library/Preferences/calibre/plugins/worddumb-libs-py3.8/requests/sessions.py", line 645, in send
r = adapter.send(request, **kwargs)
File "/Users/moinqureshi/Library/Preferences/calibre/plugins/worddumb-libs-py3.8/requests/adapters.py", line 501, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))

Cannot run WordDumb (Flatpak install)

Describe the bug

I cannot use WordDumb, is it because my installation is from flatpak ? Any way to fix this ?
This plugin looks really cool, congrats !

System Information

OS: Fedora 35

Error message

calibre, version 5.40.0 (linux, embedded-python: True)
Hello, my name is Philip, but everyone calls me Pip, because they hate me.: Run the command "sudo apt install python3-pip" to install pip module if you are using Debian based distro. 

If you still have this error, make sure you installed calibre with the binary install command but not from Flathub or Snap Store. 

Starting job: Generating X-Ray for Alice's Adventures in Wonderland 
Job: "Generating X-Ray for Alice's Adventures in Wonderland" failed with error: 
Traceback (most recent call last):
  File "calibre/gui2/threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 63, in do_job
    install_deps = InstallDeps(model, plugin_path, book_fmt, notifications)
  File "calibre_plugins.worddumb.deps", line 23, in __init__
    self.install_x_ray_deps()
  File "calibre_plugins.worddumb.deps", line 59, in install_x_ray_deps
    self.pip_install(
  File "calibre_plugins.worddumb.deps", line 83, in pip_install
    subprocess.run(args, check=True, capture_output=True, text=True)
  File "subprocess.py", line 512, in run
subprocess.CalledProcessError: Command '['python3', '-m', 'pip', 'install', '-U', '-t', PosixPath('/home/hidden/.var/app/com.calibre_ebook.calibre/config/calibre/plugins/worddumb-libs-py3.8'), '--no-deps', 'Jinja2==3.1.1']' returned non-zero exit status 1.
 
Called with args: ((2, 'EPUB', "/home/hidden/Calibre Library/Lewis Carroll/Alice's Adventures in Wonderland (2)/Alice's Adventures in Wonderland - Lewis Carroll.epub", <calibre.ebooks.metadata.book.base.Metadata object at 0x7f2244c58400>, {'spacy': 'en_core_web_', 'wiki': 'en'}), False, True) {'notifications': <queue.Queue object at 0x7f2244c582e0>, 'abort': <threading.Event object at 0x7f2244c58fa0>, 'log': <calibre.utils.logging.GUILog object at 0x7f2244cba850>} 
/usr/bin/python3: No module named pip

Reproduce steps

  1. Open Calibre
  2. Run WordDumb
  3. Get error

Screenshots or videos

No response

msvcrt unsurprisingly missing under Linux

Describe the bug

Thanks for the error message but there's no "worddumb-libs-py*" directory (which I expected to find at/below $HOME/.config/calibre/plugins/).

This is using a fresh installation of the plugin. "python3 -m pip --version --disable-pip-version-check" returns 0 but I expect you're using some other version...

System Information

OS: Fedora 36, x86_64
calibre version: 6.2.0, 64-bit
Python version: 3.10.5, 64-bit
Plugin version: 3.24.0

Error message

calibre, version 6.2.0 (linux, embedded-python: True)
Welcome to dependency hell: Please delete the 'msvcrt*' folder from the 'worddumb-libs-py*' folder and try again.

Starting job: Generating X-Ray for Sörensen hat Angst 
Job: "Generating X-Ray for Sörensen hat Angst" failed with error: 
Traceback (most recent call last):
  File "calibre/gui2/threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 105, in do_job
    install_deps(model, book_fmt, notifications)
  File "calibre_plugins.worddumb.deps", line 22, in install_deps
    PY_PATH, PY_VERSION = which_python()
  File "calibre_plugins.worddumb.deps", line 56, in which_python
    upgrade_pip(py)
  File "calibre_plugins.worddumb.deps", line 127, in upgrade_pip
    r = run_subprocess(
  File "calibre_plugins.worddumb.utils", line 48, in run_subprocess
    return subprocess.run(
  File "subprocess.py", line 524, in run
subprocess.CalledProcessError: Command '['python3', '-m', 'pip', '--version', '--disable-pip-version-check']' returned non-zero exit status 1.
 
Called with args: ((10440, 'KFX', '/home/krueger/calibre/Sven Stricker/Sorensen hat Angst (10440)/Sorensen hat Angst - Sven Stricker.kfx', <calibre.ebooks.metadata.book.base.Metadata object at 0x7f6c4f123e20>, {'spacy': 'de_core_news_', 'wiki': 'de', 'kaikki': 'German'}), False, True) {'notifications': <queue.Queue object at 0x7f6c4f122aa0>, 'abort': <threading.Event object at 0x7f6c4f1222f0>, 'log': <calibre.utils.logging.GUILog object at 0x7f6c4f123220>} 
Traceback (most recent call last):
  File "/usr/lib/python3.10/subprocess.py", line 69, in <module>
    import msvcrt
ModuleNotFoundError: No module named 'msvcrt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.10/site-packages/pip/__main__.py", line 29, in <module>
    from pip._internal.cli.main import main as _main
  File "/usr/lib/python3.10/site-packages/pip/_internal/cli/main.py", line 9, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/usr/lib/python3.10/site-packages/pip/_internal/cli/autocompletion.py", line 10, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/usr/lib/python3.10/site-packages/pip/_internal/cli/main_parser.py", line 8, in <module>
    from pip._internal.cli import cmdoptions
  File "/usr/lib/python3.10/site-packages/pip/_internal/cli/cmdoptions.py", line 21, in <module>
    from pip._vendor.packaging.utils import canonicalize_name
  File "/usr/lib/python3.10/site-packages/pip/_vendor/packaging/utils.py", line 8, in <module>
    from .tags import Tag, parse_tag
  File "/usr/lib/python3.10/site-packages/pip/_vendor/packaging/tags.py", line 6, in <module>
    import platform
  File "/usr/lib/python3.10/platform.py", line 119, in <module>
    import subprocess
  File "/usr/lib/python3.10/subprocess.py", line 74, in <module>
    import _posixsubprocess
ModuleNotFoundError: No module named '_posixsubprocess'



### Reproduce steps

Just trying to generate Xray files is enough

### Screenshots or videos

_No response_

Error while running wordwise

Describe the bug

Hi,

I get the following error while running wordwise

Thanks
Ravi

System Information

OS: MACOS 12.3.1
Calibre: 6.1
Plugin: 3.23.1
Python: 3.7

Error message

Starting job: Generating Word Wise and X-Ray for Buy This, Not That: How to Spend Your Way to Wealth and Freedom 
Job: "Generating Word Wise and X-Ray for Buy This, Not That: How to Spend Your Way to Wealth and Freedom" failed with error: 
Traceback (most recent call last):
  File "calibre/gui2/threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 105, in do_job
    install_deps(model, book_fmt, notifications)
  File "calibre_plugins.worddumb.deps", line 33, in install_deps
    install_x_ray_deps(model, reinstall, notif)
  File "calibre_plugins.worddumb.deps", line 67, in install_x_ray_deps
    pip_install_pkgs(
  File "calibre_plugins.worddumb.deps", line 106, in pip_install_pkgs
    pip_install(
  File "calibre_plugins.worddumb.deps", line 101, in pip_install
    run_subprocess(args)
  File "calibre_plugins.worddumb.utils", line 48, in run_subprocess
    return subprocess.run(
  File "subprocess.py", line 524, in run
subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'pip', 'install', '-U', '-t', PosixPath('/Users/rtm/Library/Preferences/calibre/plugins/worddumb-libs-py3.7'), '--no-deps', '--no-cache-dir', '--disable-pip-version-check', '--python-version', '3.7', 'numpy==1.23.1']' returned non-zero exit status 1.
 
Called with args: ((80, 'AZW3', '/Users/rtm/Calibre Library/Sam Dogen/Buy This, Not That_ How to Spend Your Way to Wealth and Freedom (80)/Buy This, Not That_ How to Spend Your Way - Sam Dogen.azw3', , {'spacy': 'en_core_web_', 'wiki': 'en', 'kaikki': 'English'}), True, True) {'notifications': , 'abort': , 'log': } 


### Reproduce steps

1. Clicked the book
2. Clicked generated wordwise and X-ray
3. Got error in the job list

"String not found"Error

Describe the bug

Hi, it's me again, when I try to use WordDumb for some of my azw3 books, the error message with "string not found" error poped up sometimes at the very begining. It happens for both word wise and X-ray creation. I noticed that some books have this issue while the others do not, and I just couldn't figure out what is wrong with these azw3 files.

System Information

OS: Windows 11
Calibre: 5.43.0 64bit
Python: 3.10.5 64bit
Plugin: 3.21.1

Error message

calibre, version 5.43.0 (win32, embedded-python: True)
Tonnerre de Brest!: An error occurred, please copy error message then report bug at GitHub.

Starting job: Generating Word Wise and X-Ray for Gardens of the Moon: Book One of The Malazan Book of the Fallen 
Job: "Generating Word Wise and X-Ray for Gardens of the Moon: Book One of The Malazan Book of the Fallen" failed with error: 
Traceback (most recent call last):
  File "calibre\gui2\threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 108, in do_job
  File "calibre_plugins.worddumb.parse_job", line 207, in create_files
  File "calibre_plugins.worddumb.parse_job", line 335, in find_named_entity
  File "calibre_plugins.worddumb.parse_job", line 256, in index_in_escaped_text
ValueError: substring not found
 
Called with args: ((10, 'AZW3', 'C:\\Users\\justi\\Calibre Library\\Steven Erikson\\Gardens of the Moon_ Book One of The (10)\\Gardens of the Moon_ Book One o - Steven Erikson.azw3', <calibre.ebooks.metadata.book.base.Metadata object at 0x0000029157830E50>, {'spacy': 'en_core_web_', 'wiki': 'en'}), True, True) {'notifications': <queue.Queue object at 0x0000029157830E80>, 'abort': <threading.Event object at 0x000002915087E8E0>, 'log': <calibre.utils.logging.GUILog object at 0x000002915087E820>}

Reproduce steps

  1. Go to Calibre
  2. Click on WordDumb
  3. Error message occured

Screenshots or videos

No response

X-Ray footnotes for EPUB: Option to unconditionally create them

Right now, X-Ray footnotes for EPUB books are only created if EPUB is the only format. Usually, though, I keep EPUB and KFX (at least) versions of all my ebooks. (I use both KOReader which consumes EPUB and Kindles (KFX).)

Thus, it would be useful if the plugin had an option to unconditionally create the new EPUB with X-Ray footnotes.

No Wordwise because Worddumb output to different folder

Describe the bug
The Kindle's wordwise feature doesn't able to recognize output from Calibre Worddumb plugin WHEN the meta data "Author(s)" and "Author sort" contains different values.

For example,

Book Title: I’m Still Standing: Bond King Bill Gross and the PIMCO Express
Author(s): William Gross
Author sort: Gross, William

Calibre Library: C:\Users\reporter\Calibre Library\William Gross\I'm Still Standing_ Bond King Bill G (20)
Kindle Drive: F:\documents\Gross, William\I'm Still Standing_ Bond King Bill Gross and the PIMCO Express - William Gross.sdr

The wordwise is ON but doesn't get activate on Kindle e-reader when open this book.

System Information

  • OS: Windows 10, 64bit
  • calibre version: 5.40, 64bit
  • Python version: 3.10.2, 64bit
  • Plugin version: 3.19.0

Error message
No errors while executing the "WordDumb" plugin

To Reproduce
Steps to reproduce the behavior:
0. Connect Kindle & ensure wordwise feature turns ON

  1. Go to 'Calibre", pick a file with different Author(s) and Author sort
  2. Click on 'WordDumb'
  3. Disconnect Kindle
  4. Open the newly upload file in Kindle -- No wordwise activated

To "workaround" it:

  1. Clean-up
  • Remove the ebook from kindle from Kindle Library UI
  • Connect Kindle and remove the empty folder "Gross, William"
  1. Right click on the ebook and Edit meta-data

  2. Ensure both Author(s) and Author sort field contains exactly the same value

  3. Repeat the steps in "To reproduce" and it will just works!

Expected behavior
The Worddumb shall works even when the Author(s) and Author sort contains different values.

Screenshots or videos
no applicable

Additional context
Add any other context about the problem here.

X-ray errors

`calibre, version 5.23.0 (win32, embedded-python: True)
Eh!: 失败: Generating X-Ray for 三体全集

Starting job: Generating X-Ray for 三体全集
Job: "Generating X-Ray for 三体全集" failed with error:
Traceback (most recent call last):
File "calibre\gui2\threaded_jobs.py", line 83, in start_work
File "calibre_plugins.worddumb.parse_job", line 46, in do_job
File "calibre_plugins.worddumb.parse_job", line 144, in find_named_entity
File "calibre_plugins.worddumb.x_ray", line 192, in search
File "calibre_plugins.worddumb.x_ray", line 149, in insert_entity
File "calibre_plugins.worddumb.x_ray", line 166, in insert_description
File "calibre_plugins.worddumb.x_ray", line 95, in search_wikipedia
File "C:\Users\goxji\AppData\Roaming\calibre\plugins\worddumb-libs-py3.8\requests\sessions.py", line 555, in get
File "C:\Users\goxji\AppData\Roaming\calibre\plugins\worddumb-libs-py3.8\requests\sessions.py", line 542, in request
File "C:\Users\goxji\AppData\Roaming\calibre\plugins\worddumb-libs-py3.8\requests\sessions.py", line 655, in send
File "C:\Users\goxji\AppData\Roaming\calibre\plugins\worddumb-libs-py3.8\requests\adapters.py", line 439, in send
File "C:\Users\goxji\AppData\Roaming\calibre\plugins\worddumb-libs-py3.8\urllib3\connectionpool.py", line 696, in urlopen
File "C:\Users\goxji\AppData\Roaming\calibre\plugins\worddumb-libs-py3.8\urllib3\connectionpool.py", line 964, in prepare_proxy
File "C:\Users\goxji\AppData\Roaming\calibre\plugins\worddumb-libs-py3.8\urllib3\connection.py", line 359, in connect
File "C:\Users\goxji\AppData\Roaming\calibre\plugins\worddumb-libs-py3.8\urllib3\connection.py", line 500, in connect_tls_proxy
File "C:\Users\goxji\AppData\Roaming\calibre\plugins\worddumb-libs-py3.8\urllib3\util\ssl
.py", line 453, in ssl_wrap_socket
File "C:\Users\goxji\AppData\Roaming\calibre\plugins\worddumb-libs-py3.8\urllib3\util\ssl
.py", line 495, in _ssl_wrap_socket_impl
File "ssl.py", line 500, in wrap_socket
File "ssl.py", line 997, in _create
ValueError: check_hostname requires server_hostname

Called with args: ((214, 'KFX', 'C:\Users\goxji\Calibre 书库\Liu Ci Xin\San Ti Quan Ji (214)\San Ti Quan Ji - Liu Ci Xin.kfx', <calibre.ebooks.metadata.book.base.Metadata object at 0x000002002360E0D0>, {'spacy': 'zh_core_web_', 'wiki': 'zh'}), False, True) {'notifications': <queue.Queue object at 0x000002002371E6A0>, 'abort': <threading.Event object at 0x000002002371EDC0>, 'log': <calibre.utils.logging.GUILog object at 0x000002002371EC10>}
`

Multithreading support?

Hi, not sure if multithreading is the correct word for it, but you'll get the gist of it.
I'm a brand new user, apologies if I'm missing anythingn but on my install, when generating word wise & x-ray for ~50 ebooks, it takes about 15 mins I was a little surprised since it also froze calibre for a few seconds, I then checked the job list and the plugin was going through the books one by one, so here I am.

Is the behaviour described the correct one?
Are there any way improvements can be made? for example following calibre's max simultaneous job limit, custom amount set in the preferences, etc...

Edit: Wording

Word dumb generation error in Macbook Pro M1

Describe the bug

On trying to generate the word wise, the following error occurs.

System Information

OS: MacOS Monterey 12.4
Calibre Version: 6.1.0
WordDumb version: 3.23.1
Python Version: 3.9.13

Error message

calibre, version 6.1.0 (darwin, embedded-python: True)
Tonnerre de Brest!: An error occurred, please copy error message then report bug at GitHub.

Starting job: Generating Word Wise and X-Ray for Leonardo da Vinci 
Job: "Generating Word Wise and X-Ray for Leonardo da Vinci" failed with error: 
Traceback (most recent call last):
  File "calibre/gui2/threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 147, in do_job
    run_subprocess(args, input_str)
  File "calibre_plugins.worddumb.utils", line 48, in run_subprocess
    return subprocess.run(
  File "subprocess.py", line 524, in run
subprocess.CalledProcessError: Command '['/usr/bin/python3', '/Users/****/Library/Preferences/calibre/plugins/WordDumb.zip', '', PosixPath('/Users/***/Calibre Library/Walter Isaacson/Leonardo da Vinci (3)/Leonardo da Vinci - Walter Isaacson.epub'), '', '', 'en_core_web_lg', 'en', '', '3.23.1', 'cn', '', 'EPUB', '1', '/Users/***/Library/Preferences/calibre/plugins/WordDumb.zip', '', '-l', '-x', '-s', '-m']' returned non-zero exit status 1.
 
Called with args: ((3, 'EPUB', '/Users/***/Calibre Library/Walter Isaacson/Leonardo da Vinci (3)/Leonardo da Vinci - Walter Isaacson.epub', <calibre.ebooks.metadata.book.base.Metadata object at 0x117faa620>, {'spacy': 'en_core_web_', 'wiki': 'en', 'kaikki': 'English'}), True, True) {'notifications': <queue.Queue object at 0x117faa560>, 'abort': <threading.Event object at 0x1181c3670>, 'log': <calibre.utils.logging.GUILog object at 0x1181c00d0>} 
Traceback (most recent call last):
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/***/Library/Preferences/calibre/plugins/WordDumb.zip/__main__.py", line 55, in <module>
  File "/Users/***/Library/Preferences/calibre/plugins/WordDumb.zip/parse_job.py", line 246, in create_files
  File "/Users/***/Library/Preferences/calibre/plugins/WordDumb.zip/parse_job.py", line 570, in load_spacy
  File "/Users/***/Library/Preferences/calibre/plugins/worddumb-libs-py3.8/spacy/__init__.py", line 6, in <module>
    from .errors import setup_default_warnings
  File "/Users/***/Library/Preferences/calibre/plugins/worddumb-libs-py3.8/spacy/errors.py", line 2, in <module>
    from .compat import Literal
  File "/Users/***/Library/Preferences/calibre/plugins/worddumb-libs-py3.8/spacy/compat.py", line 3, in <module>
    from thinc.util import copy_array
  File "/Users/***/Library/Preferences/calibre/plugins/worddumb-libs-py3.8/thinc/__init__.py", line 5, in <module>
    from .config import registry
  File "/Users/***/Library/Preferences/calibre/plugins/worddumb-libs-py3.8/thinc/config.py", line 14, in <module>
    import srsly
  File "/Users/***/Library/Preferences/calibre/plugins/worddumb-libs-py3.8/srsly/__init__.py", line 1, in <module>
    from ._json_api import read_json, read_gzip_json, write_json, write_gzip_json
  File "/Users/***/Library/Preferences/calibre/plugins/worddumb-libs-py3.8/srsly/_json_api.py", line 6, in <module>
    from . import ujson
  File "/Users/***/Library/Preferences/calibre/plugins/worddumb-libs-py3.8/srsly/ujson/__init__.py", line 1, in <module>
    from .ujson import decode, encode, dump, dumps, load, loads  # noqa: F401
ModuleNotFoundError: No module named 'srsly.ujson.ujson'

Reproduce steps

  1. Select a notebook
  2. Click on Plugin
  3. Click on Calibre jobs

Screenshots or videos

Screenshot 2022-07-22 at 6 45 31 PM

utf-8 error

Hi there!

I'm getting this issue:

calibre, version 5.33.2
ERROR: Excepción no considerada: UnicodeDecodeError:'utf-8' codec can't decode byte 0xf3 in position 13: invalid continuation byte

calibre 5.33.2 Portable embedded-python: True is64bit: False
Windows-10-10.0.19041 Windows ('32bit', 'WindowsPE')
32bit process running on 64bit windows
('Windows', '10', '10.0.19041')
Python 3.8.5
Windows: ('10', '10.0.19041', '', 'Multiprocessor Free')
Interface language: es
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 45, 0) && DeDRM (7, 0, 0) && Package KFX (from KFX Input) (1, 45, 0) && Count Pages (1, 11, 1) && KFX metadata reader (from KFX Input) (1, 45, 0) && KFX Input (1, 45, 0) && Set KFX metadata (from KFX Output) (1, 58, 0) && KFX Output (1, 58, 0) && Kindle Collections (1, 7, 29) && Reading List (1, 7, 6) && WordDumb (3, 14, 3)
Traceback (most recent call last):
File "calibre\gui2_init_.py", line 502, in dispatch
File "calibre_plugins.worddumb.main", line 52, in done
File "calibre_plugins.worddumb.main", line 82, in job_failed
File "calibre_plugins.worddumb.main", line 105, in subprocess_error
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf3 in position 13: invalid continuation byte

Hope you can help me.

Thanks.

ERROR: No matching distribution found for MarkupSafe==2.1.1

I am not able to run X-Ray because plugin cannot find the library.

calibre, version 6.2.1 (darwin, embedded-python: True)
Tonnerre de Brest!: An error occurred, please copy error message then report bug at GitHub.

Starting job: Generating X-Ray for Permission to Feel: Unlocking the Power of Emotions to Help Our Kids, Ourselves, and Our Society Thrive 
Job: "Generating X-Ray for Permission to Feel: Unlocking the Power of Emotions to Help Our Kids, Ourselves, and Our Society Thrive" failed with error: 
Traceback (most recent call last):
  File "calibre/gui2/threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 105, in do_job
    install_deps(model, book_fmt, notifications)
  File "calibre_plugins.worddumb.deps", line 34, in install_deps
    install_x_ray_deps(model, reinstall, notif)
  File "calibre_plugins.worddumb.deps", line 68, in install_x_ray_deps
    pip_install_pkgs(
  File "calibre_plugins.worddumb.deps", line 108, in pip_install_pkgs
    pip_install(
  File "calibre_plugins.worddumb.deps", line 103, in pip_install
    run_subprocess(args)
  File "calibre_plugins.worddumb.utils", line 48, in run_subprocess
    return subprocess.run(
  File "subprocess.py", line 524, in run
subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'pip', 'install', '-U', '-t', PosixPath('/Users/amansingh/Library/Preferences/calibre/plugins/worddumb-libs-py3.8'), '--no-deps', '--no-cache-dir', '--disable-pip-version-check', '--no-user', '--python-version', '3.8', 'MarkupSafe==2.1.1']' returned non-zero exit status 1.
 
Called with args: ((9, 'MOBI', '/Users/amansingh/Calibre Library/Marc Brackett, Ph.d_/Permission to Feel_ Unlocking the Power of Emotions to Help Our Kids, Ourselves, and Our Society (9)/Permission to Feel_ Unlocking the Power of - Marc Brackett, Ph.d_.mobi', <calibre.ebooks.metadata.book.base.Metadata object at 0x137bde980>, {'spacy': 'en_core_web_', 'wiki': 'en', 'kaikki': 'English'}), False, True) {'notifications': <queue.Queue object at 0x137bde740>, 'abort': <threading.Event object at 0x137bde7d0>, 'log': <calibre.utils.logging.GUILog object at 0x137bdea10>} 
ERROR: Could not find a version that satisfies the requirement MarkupSafe==2.1.1 (from versions: 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 1.0, 1.1.0, 1.1.1, 2.0.0a1, 2.0.0rc1, 2.0.0rc2, 2.0.0, 2.0.1)
ERROR: No matching distribution found for MarkupSafe==2.1.1

Network is unreachable

calibre, version 5.18.0 (linux, embedded-python: True)
Dumb error: Failed: Generating Word Wise for Range: Why Generalists Triumph in a Specialized World

Starting job: Generating Word Wise for Range: Why Generalists Triumph in a Specialized World
Job: "Generating Word Wise for Range: Why Generalists Triumph in a Specialized World" failed with error:
Traceback (most recent call last):
File "urllib/request.py", line 1350, in do_open
File "http/client.py", line 1255, in request
File "http/client.py", line 1301, in _send_request
File "http/client.py", line 1250, in endheaders
File "http/client.py", line 1010, in _send_output
File "http/client.py", line 950, in send
File "http/client.py", line 1417, in connect
File "http/client.py", line 921, in connect
File "socket.py", line 808, in create_connection
File "socket.py", line 796, in create_connection
OSError: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "calibre/gui2/threaded_jobs.py", line 83, in start_work
File "calibre_plugins.worddumb.parse_job", line 32, in do_job
find_named_entity(start, text, x_ray)
File "calibre_plugins.worddumb.parse_job", line 112, in find_named_entity
x_ray.search(token, node.label(), token_start, text[index:])
File "calibre_plugins.worddumb.x_ray", line 134, in search
self.insert_entity(name, tag, start, text)
File "calibre_plugins.worddumb.x_ray", line 104, in insert_entity
self.search_wikipedia()
File "calibre_plugins.worddumb.x_ray", line 55, in search_wikipedia
with urllib.request.urlopen(req) as f:
File "urllib/request.py", line 222, in urlopen
File "urllib/request.py", line 525, in open
File "urllib/request.py", line 542, in _open
File "urllib/request.py", line 502, in _call_chain
File "urllib/request.py", line 1393, in https_open
File "urllib/request.py", line 1353, in do_open
urllib.error.URLError: <urlopen error [Errno 101] Network is unreachable>

Called with args: ((64, 'AZW3', 'B07H1ZYWTM', '/home/ali/Calibre Library/David Epstein/Range_ Why Generalists Triumph in a Specialized World (64)/Range_ Why Generalists Triumph in a Specia - David Epstein.azw3', <calibre.ebooks.metadata.book.base.Metadata object at 0x7f07ec67ffa0>), True) {'notifications': <queue.Queue object at 0x7f07ec67f8e0>, 'abort': <threading.Event object at 0x7f07f1549880>, 'log': <calibre.utils.logging.GUILog object at 0x7f07f1549280>}

There is no item named 'lemmas_dump' in the archive

Describe the bug

When I select my book and click the star I see the error below.
Not sure what to do.

System Information

Windows 10
Calibre 6.1.0 x64
Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)] on win32

Error message

Starting job: Generating Word Wise and X-Ray for Book Name
Job: "Generating Word Wise and X-Ray for Book Name" failed with error: 
Traceback (most recent call last):
  File "calibre\gui2\threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 149, in do_job
  File "calibre_plugins.worddumb.parse_job", line 242, in create_files
  File "calibre_plugins.worddumb.utils", line 90, in load_lemmas_dump
  File "calibre_plugins.worddumb.utils", line 33, in load_json_or_pickle
  File "zipfile.py", line 1503, in open
  File "zipfile.py", line 1430, in getinfo
KeyError: "There is no item named 'lemmas_dump' in the archive"
 
Called with args: ((8253, 'KFX', '\\\\nas5\\GregsDocs\\Calibre Library\\Author Name\\Book Name (8253)\\Book Name - Author Name.kfx', <calibre.ebooks.metadata.book.base.Metadata object at 0x0000013BE98C29B0>, {'spacy': 'en_core_web_', 'wiki': 'en', 'kaikki': 'English'}), True, True) {'notifications': <queue.Queue object at 0x0000013BE98C2BF0>, 'abort': <threading.Event object at 0x0000013BE98C2920>, 'log': <calibre.utils.logging.GUILog object at 0x0000013BE98C2A40>}

Reproduce steps

Select book, click on star

Screenshots or videos

No response

xray issue

my log was too long for here. view log file here: https://pastebin.com/B0pPGrvb

Last portion:


ERROR: Failed building wheel for numpy
ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly
WARNING: You are using pip version 20.2.3; however, version 22.0.3 is available.
You should consider upgrading via the '/Library/Developer/CommandLineTools/usr/bin/python3 -m pip install --upgrade pip' command.

X-ray inaccuracies

After using this module for months, i noticed that the X-ray generated for books contained a lot of inaccuracies :
*Sometime a letter got an x-ray entry
*Some word like 'chapter' also getting entries

I have also tried https://github.com/Ephemerality/xray-builder.gui , and it gave better X-ray files, would be great if you could give a look and maybe incorporate it inside Worddumb, Thanks !
photo_2021-08-31_07-52-45

x-ray didn't show up on kindle

Describe the bug
when i transfer the file to kindle, the x-ray didn't show up

System Information

  • OS: Macos 12.2.1
  • calibre version: 5.37, 64bit
  • Python version: 2.7.18
  • Plugin version 3.18.4

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'WordDumb plugin'
  2. Click on 'generate x-ray'
  3. after the job is done send it to your kindle
  4. x-ray doesn't appear

Extra Information
the kindle stays on airplane mode

Fails with Error

Describe the bug

When running the plugin on any book it will fail with similar errors.

System Information

Mac OS 12.4, Calibre 6.1, Python 3

Error message

Starting job: Generating Word Wise and X-Ray for Becoming 
Job: "Generating Word Wise and X-Ray for Becoming" failed with error: 
Traceback (most recent call last):
  File "calibre/gui2/threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 147, in do_job
    run_subprocess(args, input_str)
  File "calibre_plugins.worddumb.utils", line 48, in run_subprocess
    return subprocess.run(
  File "subprocess.py", line 524, in run
subprocess.CalledProcessError: Command '['/usr/bin/python3', '/Users/samuel/Library/Preferences/calibre/plugins/WordDumb.zip', 'BBEX21IOI6', '/Users/samuel/OneDrive/Calibre Library/Michelle Obama/Becoming (133)/Becoming - Michelle Obama.mobi', 'Becoming', 'e6ccc3c0', 'en_core_web_md', 'en', 'utf-8', '3.23.1', 'cn', '', 'MOBI', '1', '/Users/samuel/Library/Preferences/calibre/plugins/WordDumb.zip', '', '-l', '-x']' returned non-zero exit status 1.
 
Called with args: ((133, 'MOBI', '/Users/samuel/OneDrive/Calibre Library/Michelle Obama/Becoming (133)/Becoming - Michelle Obama.mobi', , {'spacy': 'en_core_web_', 'wiki': 'en', 'kaikki': 'English'}), True, True) {'notifications': , 'abort': , 'log': } 


Another one:

Starting job: Generating Word Wise and X-Ray for Becoming 
Job: "Generating Word Wise and X-Ray for Becoming" failed with error: 
Traceback (most recent call last):
  File "calibre/gui2/threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 147, in do_job
    run_subprocess(args, input_str)
  File "calibre_plugins.worddumb.utils", line 48, in run_subprocess
    return subprocess.run(
  File "subprocess.py", line 524, in run
subprocess.CalledProcessError: Command '['/usr/bin/python3', '/Users/samuel/Library/Preferences/calibre/plugins/WordDumb.zip', 'BBEX21IOI6', '/Users/samuel/OneDrive/Calibre Library/Michelle Obama/Becoming (133)/Becoming - Michelle Obama.mobi', 'Becoming', 'e6ccc3c0', 'en_core_web_md', 'en', 'utf-8', '3.23.1', 'cn', '', 'MOBI', '1', '/Users/samuel/Library/Preferences/calibre/plugins/WordDumb.zip', '', '-l', '-x']' returned non-zero exit status 1.
 
Called with args: ((133, 'MOBI', '/Users/samuel/OneDrive/Calibre Library/Michelle Obama/Becoming (133)/Becoming - Michelle Obama.mobi', <calibre.ebooks.metadata.book.base.Metadata object at 0x124601990>, {'spacy': 'en_core_web_', 'wiki': 'en', 'kaikki': 'English'}), True, True) {'notifications': <queue.Queue object at 0x124601b40>, 'abort': <threading.Event object at 0x124601a50>, 'log': <calibre.utils.logging.GUILog object at 0x124601c00>} 
Traceback (most recent call last):
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/samuel/Library/Preferences/calibre/plugins/WordDumb.zip/__main__.py", line 55, in <module>
  File "/Users/samuel/Library/Preferences/calibre/plugins/WordDumb.zip/parse_job.py", line 322, in create_files
  File "/Users/samuel/Library/Preferences/calibre/plugins/WordDumb.zip/x_ray.py", line 196, in finish
  File "/Users/samuel/Library/Preferences/calibre/plugins/WordDumb.zip/x_ray.py", line 83, in insert_descriptions
  File "/Users/samuel/Library/Preferences/calibre/plugins/WordDumb.zip/mediawiki.py", line 257, in inception_text
ValueError: Invalid isoformat string: 'http://www.wikidata.org/.well-known/genid/7ea35d4504b835fc37b90f06a6e522a'

Reproduce steps

Run word dumb

Screenshots or videos

No response

X-RAY error

calibre, version 5.29.0 (win32, embedded-python: True)
Weak: subprocess.run() failed

Starting job: Generating X-Ray for Range: Why Generalists Triumph in a Specialized World
Job: "Generating X-Ray for Range: Why Generalists Triumph in a Specialized World" failed with error:
Traceback (most recent call last):
File "calibre\gui2\threaded_jobs.py", line 83, in start_work
File "calibre_plugins.worddumb.parse_job", line 24, in do_job
File "calibre_plugins.worddumb.unzip", line 63, in install_libs
File "calibre_plugins.worddumb.unzip", line 86, in pip_install
File "subprocess.py", line 512, in run
subprocess.CalledProcessError: Command '['py', '-m', 'pip', 'install', '-U', '-t', WindowsPath('C:/Users/menghui1126/AppData/Roaming/calibre/plugins/worddumb-libs-py3.8'), '--no-deps', 'packaging==21.0']' returned non-zero exit status 2.

Called with args: ((38, 'MOBI', 'C:\Users\menghui1126\OneDrive\Calibre 书库\David Epstein\Range_ Why Generalists Triumph in a (38)\Range_ Why Generalists Triumph - David Epstein.mobi', <calibre.ebooks.metadata.book.base.Metadata object at 0x0000019C6912BB80>, {'spacy': 'en_core_web_', 'wiki': 'en'}), False, True) {'notifications': <queue.Queue object at 0x0000019C6912BC10>, 'abort': <threading.Event object at 0x0000019C6912B4C0>, 'log': <calibre.utils.logging.GUILog object at 0x0000019C6912B040>}
ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\cli\base_command.py", line 173, in _main
status = self.run(options, args)
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\cli\req_command.py", line 203, in wrapper
return func(self, options, args)
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\commands\install.py", line 315, in run
requirement_set = resolver.resolve(
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\resolver.py", line 94, in resolve
result = self._result = resolver.resolve(
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 472, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 341, in resolve
self._add_to_criteria(self.state.criteria, r, parent=None)
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 172, in _add_to_criteria
if not criterion.candidates:
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\resolvelib\structs.py", line 151, in bool
return bool(self._sequence)
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", line 140, in bool
return any(self)
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", line 128, in
return (c for c in iterator if id(c) not in self._incompatible_ids)
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", line 29, in _iter_built
for version, func in infos:
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\resolution\resolvelib\factory.py", line 272, in iter_index_candidate_infos
result = self._finder.find_best_candidate(
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\index\package_finder.py", line 851, in find_best_candidate
candidates = self.find_all_candidates(project_name)
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\index\package_finder.py", line 798, in find_all_candidates
page_candidates = list(page_candidates_it)
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\index\sources.py", line 134, in page_candidates
yield from self._candidates_from_page(self._link)
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\index\package_finder.py", line 758, in process_project_url
html_page = self._link_collector.fetch_page(project_url)
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\index\collector.py", line 490, in fetch_page
return _get_html_page(location, session=self.session)
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\index\collector.py", line 400, in _get_html_page
resp = _get_html_response(url, session=session)
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\index\collector.py", line 115, in _get_html_response
resp = session.get(
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\requests\sessions.py", line 555, in get
return self.request('GET', url, **kwargs)
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_internal\network\session.py", line 454, in request
return super().request(method, url, *args, **kwargs)
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\requests\sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\cachecontrol\adapter.py", line 53, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\urllib3\connectionpool.py", line 696, in urlopen
self._prepare_proxy(conn)
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\urllib3\connectionpool.py", line 964, in _prepare_proxy
conn.connect()
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\urllib3\connection.py", line 359, in connect
conn = self._connect_tls_proxy(hostname, conn)
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\urllib3\connection.py", line 500, in connect_tls_proxy
return ssl_wrap_socket(
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\urllib3\util\ssl
.py", line 453, in ssl_wrap_socket
ssl_sock = ssl_wrap_socket_impl(sock, context, tls_in_tls)
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\urllib3\util\ssl
.py", line 495, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock)
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 512, in wrap_socket
return self.sslsocket_class._create(
File "C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 1027, in _create
raise ValueError("check_hostname requires server_hostname")
ValueError: check_hostname requires server_hostname
WARNING: You are using pip version 21.2.3; however, version 21.2.4 is available.
You should consider upgrading via the 'C:\Users\menghui1126\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip' command.

Create X-Ray error on ARM Mac

Describe the bug

The following error occurs when attempting to create x-ray.

System Information

OS: MacOS 13.0 Beta
calibre version: 6.1.0
Python version: 3.9.13
Plugin version: 3.23.1

Error message

calibre, version 6.1.0 (darwin, embedded-python: True)
Tonnerre de Brest!: An error occurred, please copy error message then report bug at GitHub.

Starting job: Generating X-Ray for Ethics: a very short introduction 
Job: "Generating X-Ray for Ethics: a very short introduction" failed with error: 
Traceback (most recent call last):
  File "calibre/gui2/threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 147, in do_job
    run_subprocess(args, input_str)
  File "calibre_plugins.worddumb.utils", line 48, in run_subprocess
    return subprocess.run(
  File "subprocess.py", line 524, in run
subprocess.CalledProcessError: Command '['/opt/homebrew/bin/python3', '/Users/******/Library/Preferences/calibre/plugins/WordDumb.zip', 'BBIKAV6TKI', '/Users/******/Calibre 书库/Simon Blackburn/Ethics_ a very short introduction (29)/Ethics_ a very short introduction - Simon Blackburn.mobi', 'Ethics__a_very_short_introducti', '93c51c9f', 'en_core_web_lg', 'en', 'utf-8', '3.23.1', 'cn', '', 'MOBI', '1', '/Users/******/Library/Preferences/calibre/plugins/WordDumb.zip', '', '-x', '-s']' returned non-zero exit status 1.
 
Called with args: ((29, 'MOBI', '/Users/******/Calibre Library/Simon Blackburn/Ethics_ a very short introduction (29)/Ethics_ a very short introduction - Simon Blackburn.mobi', <calibre.ebooks.metadata.book.base.Metadata object at 0x1134d6c50>, {'spacy': 'en_core_web_', 'wiki': 'en', 'kaikki': 'English'}), False, True) {'notifications': <queue.Queue object at 0x1134d6dd0>, 'abort': <threading.Event object at 0x1134d6b00>, 'log': <calibre.utils.logging.GUILog object at 0x1134d6e60>} 
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/homebrew/Cellar/[email protected]/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/******/Library/Preferences/calibre/plugins/WordDumb.zip/__main__.py", line 55, in <module>
  File "/Users/******/Library/Preferences/calibre/plugins/WordDumb.zip/parse_job.py", line 246, in create_files
  File "/Users/******/Library/Preferences/calibre/plugins/WordDumb.zip/parse_job.py", line 570, in load_spacy
  File "/Users/******/Library/Preferences/calibre/plugins/worddumb-libs-py3.9/spacy/__init__.py", line 6, in <module>
    from .errors import setup_default_warnings
  File "/Users/******/Library/Preferences/calibre/plugins/worddumb-libs-py3.9/spacy/errors.py", line 2, in <module>
    from .compat import Literal
  File "/Users/******/Library/Preferences/calibre/plugins/worddumb-libs-py3.9/spacy/compat.py", line 38, in <module>
    from thinc.api import Optimizer  # noqa: F401
  File "/Users/******/Library/Preferences/calibre/plugins/worddumb-libs-py3.9/thinc/api.py", line 2, in <module>
    from .initializers import normal_init, uniform_init, glorot_uniform_init, zero_init
  File "/Users/******/Library/Preferences/calibre/plugins/worddumb-libs-py3.9/thinc/initializers.py", line 4, in <module>
    from .backends import Ops
  File "/Users/******/Library/Preferences/calibre/plugins/worddumb-libs-py3.9/thinc/backends/__init__.py", line 7, in <module>
    from .ops import Ops
  File "/Users/******/Library/Preferences/calibre/plugins/worddumb-libs-py3.9/thinc/backends/ops.py", line 15, in <module>
    from .cblas import CBlas
  File "thinc/backends/cblas.pyx", line 1, in init thinc.backends.cblas
  File "/Users/******/Library/Preferences/calibre/plugins/worddumb-libs-py3.9/blis/__init__.py", line 3, in <module>
    from .cy import init
ImportError: dlopen(/Users/******/Library/Preferences/calibre/plugins/worddumb-libs-py3.9/blis/cy.cpython-39-darwin.so, 0x0002): tried: '/Users/******/Library/Preferences/calibre/plugins/worddumb-libs-py3.9/blis/cy.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/System/Volumes/Preboot/Cryptexes/OS/Users/******/Library/Preferences/calibre/plugins/worddumb-libs-py3.9/blis/cy.cpython-39-darwin.so' (no such file), '/Users/******/Library/Preferences/calibre/plugins/worddumb-libs-py3.9/blis/cy.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))

Reproduce steps

  1. Select a book
  2. Click Word Dump -> Create X-Ray
  3. Error message

Screenshots or videos

No response

Cannot use Fandom to create X-Ray

Describe the bug

I was able to generate X-Ray and word wise using wikipedia, but when I typed in the Fandom URL in the preference setting and try to run it, the error message occured, and I checked the directory under \AppData\Roaming\calibre\plugins, no folder named "worddumb-fandom" existed.

What's even weirer is that after I delected the Fandom URL in the setting, though there was a cursor inside but I can no longer type in/input any word in that text box, neither can I paste any..
2022-06-07 214528
.

System Information

OS: Windows 11
Calibre: 5.43.0 64bit
Python: 3.10.5 64bit
Plugin: 3.21.1

Error message

Starting job: Generating Word Wise and X-Ray for Gardens of the Moon: Book One of The Malazan Book of the Fallen 
Job: "Generating Word Wise and X-Ray for Gardens of the Moon: Book One of The Malazan Book of the Fallen" failed with error: 
Traceback (most recent call last):
  File "calibre\gui2\threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 108, in do_job
  File "calibre_plugins.worddumb.parse_job", line 180, in create_files
  File "calibre_plugins.worddumb.mediawiki", line 92, in __init__
  File "calibre_plugins.worddumb.mediawiki", line 45, in __init__
  File "pathlib.py", line 1284, in mkdir
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\justi\\AppData\\Roaming\\calibre\\plugins\\worddumb-fandom\\malazan.fandom.com'
 
Called with args: ((26, 'MOBI', 'C:\\Users\\justi\\Calibre Library\\Steven Erikson\\Gardens of the Moon_ Book One of The (26)\\Gardens of the Moon_ Book One o - Steven Erikson.mobi', <calibre.ebooks.metadata.book.base.Metadata object at 0x000002441C105AF0>, {'spacy': 'en_core_web_', 'wiki': 'en'}), True, True) {'notifications': <queue.Queue object at 0x000002441C1057C0>, 'abort': <threading.Event object at 0x000002441C105850>, 'log': <calibre.utils.logging.GUILog object at 0x000002441C105A30>}

Reproduce steps

  1. Go to Calibre
  2. Click on WordDumb
  3. Error message occured

Screenshots or videos

No response

X-Ray not showing characters description but only a quote.

Hi,

as mentioned on the forums i have an issue with the WordDumb plugin.

It generates the word wise and x-ray but the x-ray is not working properly. I tried with 2 books and i have the same outcome on both.

I will attach one of the books. Had to zip it to be able to upload.

What happens is that when i select a character x-ray only displays a quote for it from the book and not the description for the character.

Will also attach a screenshot from my Kindle Paperwhite.
img1

Thanks in advance!

Subprocess fails if python on windows is not using py launcher

Describe the bug
I recently installed the plugin but couldn't get it to work, it failed in the pip_install stage. I looked around following the traceback and the culprit is the py variable used to launch pip, which on a windows machine is assumed "py" for the py launcher command. In my case, i have bare python (the command is "python"), without the launcher, causing it to fail.

System Information

  • OS: Windows 10, 64bit
  • calibre version: 5.26.0, 64bit
  • Python version: 3.9.7, 64bit
  • Plugin version 3.13.1

Error message
Starting job: Generating X-Ray for Threadbare
Job: "Generating X-Ray for Threadbare" failed with error:
Traceback (most recent call last):
File "calibre\gui2\threaded_jobs.py", line 83, in start_work
File "calibre_plugins.worddumb.parse_job", line 24, in do_job
File "calibre_plugins.worddumb.unzip", line 63, in install_libs
File "calibre_plugins.worddumb.unzip", line 86, in pip_install
File "subprocess.py", line 489, in run
File "subprocess.py", line 854, in init
File "subprocess.py", line 1307, in _execute_child
FileNotFoundError: [WinError 2] The system cannot find the file specified

To Reproduce
Try to use the generate Xray function on a windows machine without pylauncher

Proposed solution
Would it be posible to check for "py" and in the case it fails use "python" as fallback?

Screenshots or videos
imatge

ERROR: Can not combine '--user' and '--target'

Describe the bug

Maybe related to this:
https://stackoverflow.com/questions/63783587/pip-install-cannot-combine-user-and-target

System Information

Windows 10
Calibre 6.0.0 x64
Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)] on win32

Error message

calibre, version 6.0.0 (win32, embedded-python: True)
Tonnerre de Brest!: An error occurred, please copy error message then report bug at GitHub.

Starting job: Generating Word Wise and X-Ray for bookname
Job: "Generating Word Wise and X-Ray for bookname" failed with error: 
Traceback (most recent call last):
  File "calibre\gui2\threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 105, in do_job
  File "calibre_plugins.worddumb.deps", line 33, in install_deps
  File "calibre_plugins.worddumb.deps", line 67, in install_x_ray_deps
  File "calibre_plugins.worddumb.deps", line 106, in pip_install_pkgs
  File "calibre_plugins.worddumb.deps", line 101, in pip_install
  File "calibre_plugins.worddumb.utils", line 39, in run_subprocess
  File "subprocess.py", line 524, in run
subprocess.CalledProcessError: Command '['python', '-m', 'pip', 'install', '-U', '-t', WindowsPath('C:/Users/gregp/AppData/Roaming/calibre/plugins/worddumb-libs-py3.10'), '--no-deps', '--no-cache-dir', '--disable-pip-version-check', 'Jinja2==3.1.2']' returned non-zero exit status 1.
 
Called with args: ((8253, 'KFX', '\\\\nas5\\GregsDocs\\Calibre Library\\Author Name\\bookname (12345)\\bookname.kfx', <calibre.ebooks.metadata.book.base.Metadata object at 0x000001D691175E10>, {'spacy': 'en_core_web_', 'wiki': 'en', 'kaikki': 'English'}), True, True) {'notifications': <queue.Queue object at 0x000001D6911740D0>, 'abort': <threading.Event object at 0x000001D691174F40>, 'log': <calibre.utils.logging.GUILog object at 0x000001D691174160>} 
ERROR: Can not combine '--user' and '--target'

Reproduce steps

Click the WordDumb plugin button. Error.

Screenshots or videos

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.