paperboi / kindle2notion

Export all clippings from your Kindle device to a database in Notion.
https://pypi.org/project/kindle2notion/
MIT License
904 stars 120 forks source link

show error message in case the author_name is not present #26

Closed rahulakrishna closed 3 years ago

rahulakrishna commented 3 years ago

Resolves: #25

Mohan-cloud commented 3 years ago

Apologies if this is not the right place to comment this. Running this latest commit produces the following error for me.

No author was found in clippings file. You can manually edit your clippings file to add Author in the format: <Title: (Lastname, Firstname)>. For now continuing with empty author name Traceback (most recent call last): File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/abc/Documents/projects/kindle2notion/kindle2notion/main.py", line 31, in main() File "/home/abc/.local/share/virtualenvs/kindle2notion-bDmVw8vi/lib/python3.9/site-packages/click/core.py", line 1134, in call return self.main(args, kwargs) File "/home/abc/.local/share/virtualenvs/kindle2notion-bDmVw8vi/lib/python3.9/site-packages/click/core.py", line 1059, in main rv = self.invoke(ctx) File "/home/abc/.local/share/virtualenvs/kindle2notion-bDmVw8vi/lib/python3.9/site-packages/click/core.py", line 1401, in invoke return ctx.invoke(self.callback, ctx.params) File "/home/abc/.local/share/virtualenvs/kindle2notion-bDmVw8vi/lib/python3.9/site-packages/click/core.py", line 767, in invoke return __callback(args, **kwargs) File "/home/abc/Documents/projects/kindle2notion/kindle2notion/main.py", line 25, in main books = parse_raw_clippings_text(all_clippings) File "/home/abc/Documents/projects/kindle2notion/kindle2notion/parsing.py", line 18, in parse_raw_clippings_text author, title = _parse_author_and_title(raw_clipping_list) File "/home/abc/Documents/projects/kindle2notion/kindle2notion/parsing.py", line 36, in _parse_author_and_title author, title = _deal_with_exceptions_in_author_name(author, title) File "/home/abc/Documents/projects/kindle2notion/kindle2notion/parsing.py", line 84, in _deal_with_exceptions_in_author_name last_name, first_name = author.split(', ') ValueError: too many values to unpack (expected 2)