Giter Site home page Giter Site logo

enex2notion's People

Contributors

akmal2409 avatar vzhd1701 avatar zzamboni 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  avatar  avatar

enex2notion's Issues

[Bug]: TypeError: __init__() got an unexpected keyword argument 'allowed_methods'

enex2notion version

enex2notion 0.2.19

What OS are you using?

MacOS

OS Version / Linux distribution

12.5

Bug description

When I use python -m enex2notion --token 6d5e5b2e50122axxxxxxxx output_dir/

I got:

Traceback (most recent call last):
  File "/Users/mcj/anaconda3/envs/py3/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/Users/mcj/anaconda3/envs/py3/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/mcj/.local/lib/python3.7/site-packages/enex2notion/__main__.py", line 4, in <module>
    main()
  File "/Users/mcj/.local/lib/python3.7/site-packages/enex2notion/cli.py", line 47, in main
    cli(sys.argv[1:])
  File "/Users/mcj/.local/lib/python3.7/site-packages/enex2notion/cli.py", line 26, in cli
    root = get_root(args.token, args.root_page)
  File "/Users/mcj/.local/lib/python3.7/site-packages/enex2notion/cli_notion.py", line 21, in get_root
    client = get_notion_client(token)
  File "/Users/mcj/.local/lib/python3.7/site-packages/enex2notion/cli_notion.py", line 31, in get_notion_client
    return NotionClient(token_v2=token)
  File "/Users/mcj/.local/lib/python3.7/site-packages/notion/client.py", line 88, in __init__
    self.session = create_session(client_specified_retry)
  File "/Users/mcj/.local/lib/python3.7/site-packages/notion/client.py", line 53, in create_session
    "POST",
TypeError: __init__() got an unexpected keyword argument 'allowed_methods'

Log excerpt

No response

[Bug]: Could not import notes >1800

enex2notion version

enex2notion 0.2.24

What OS are you using?

MacOS

OS Version / Linux distribution

macOS 13.01

Bug description

Could you help me to understand what's wrong with import please?
I can import a short Notebook (~39 notes) but cannot to do the same for 1864 notes.
Tested with brew and pip as well.

Log excerpt

INFO: Creating 'Evernote ENEX Import' page...
INFO: Processing notebook 'Evernote'...
Traceback (most recent call last):
  File "/usr/local/bin/enex2notion", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/enex2notion/cli.py", line 47, in main
    cli(sys.argv[1:])
  File "/usr/local/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/enex2notion/cli.py", line 32, in cli
    _process_input(enex_uploader, args.enex_input)
  File "/usr/local/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/enex2notion/cli.py", line 42, in _process_input
    enex_uploader.upload_notebook(path)
  File "/usr/local/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/enex2notion/cli_upload.py", line 53, in upload_notebook
    self.notebook_notes_count = count_notes(enex_file)
                                ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/enex2notion/enex_parser.py", line 23, in count_notes
    return sum(iter_process_xml_elements(enex_file, "note", lambda e: 1))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/enex2notion/enex_parser_xml.py", line 23, in iter_process_xml_elements
    for event, elem in context:
  File "/usr/local/Cellar/[email protected]/3.11.0/Frameworks/Python.framework/Versions/3.11/lib/python3.11/xml/etree/ElementTree.py", line 1249, in iterator
    yield from pullparser.read_events()
  File "/usr/local/Cellar/[email protected]/3.11.0/Frameworks/Python.framework/Versions/3.11/lib/python3.11/xml/etree/ElementTree.py", line 1320, in read_events
    raise event
  File "/usr/local/Cellar/[email protected]/3.11.0/Frameworks/Python.framework/Versions/3.11/lib/python3.11/xml/etree/ElementTree.py", line 1292, in feed
    self._parser.feed(data)
xml.etree.ElementTree.ParseError: mismatched tag: line 812329, column 2

[Bug]: ERROR: Could not find a version that satisfies the requirement enex2notion (from versions: none)

enex2notion version

none

What OS are you using?

Windows

OS Version / Linux distribution

Win10

Bug description

  1. install python virutal env
  2. install this package via
pip install enex2notion -i https://pypi.org/simple
  1. It throws an error as follow:
ERROR: Could not find a version that satisfies the requirement enex2notion (from versions: none)
ERROR: No matching distribution found for enex2notion

Is python 3.6 supported?

Env:
OS: win10
Python: 3.6.0
Pip: 21.3.1

Log excerpt

No response

Suggestion: Simple example command in instructions.

I am somewhat comfortable using terminal commands, but creating the right command from the full specification requires some extra thought and time.

I love how you provided a simple example in the Reddit post about enex2notion:
https://www.reddit.com/r/Notion/comments/r5nnry/alternative_way_of_importing_notebooks_from/

Your example command:

$ enex2notion --token <YOUR_TOKEN_HERE> "my_notebooks/Test Notebook.enex"

Suggestion:
It would be super helpful to have this example command in the instructions here on GitHub as well.

[Bug]: .jar file cause all process failed

enex2notion version

enex2notion 0.2.18

What OS are you using?

MacOS

OS Version / Linux distribution

MacOS 13 beta

Bug description

Original note has jar file, but seems the notion don't allow upload, Can we ignore this mistake and continue the converting process?

Log excerpt

WARNING: Failed to upload note 'xxxxxxxxxx' to Notion! Retrying...
 11%|████▌                                    | 2/18 [00:19<02:41, 10.12s/block]ERROR: Got 400 error attempting to POST to getUploadFileUrl, with data: {
  "bucket": "secure",
  "name": "commons-jexl-2.1.1.jar",
  "contentType": "application/octet-stream",
  "record": {
    "table": "block",
    "id": "be3268c5-993a-46a1-9b07-d2534910c41d",
    "spaceId": "90498861-ad69-4209-93af-29c4b6309733"
  }
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/enex2notion/0.2.18/libexec/lib/python3.10/site-packages/enex2notion/enex_uploader.py", line 28, in upload_note
    upload_block(new_page, block)
  File "/opt/homebrew/Cellar/enex2notion/0.2.18/libexec/lib/python3.10/site-packages/enex2notion/enex_uploader_block.py", line 16, in upload_block
    _upload_file(new_block, block.resource)
  File "/opt/homebrew/Cellar/enex2notion/0.2.18/libexec/lib/python3.10/site-packages/enex2notion/enex_uploader_block.py", line 41, in _upload_file
    upload_data = new_block._client.post(  # noqa: WPS437
  File "/opt/homebrew/Cellar/enex2notion/0.2.18/libexec/lib/python3.10/site-packages/ratelimit/decorators.py", line 113, in wrapper
    return func(*args, **kargs)
  File "/opt/homebrew/Cellar/enex2notion/0.2.18/libexec/lib/python3.10/site-packages/ratelimit/decorators.py", line 80, in wrapper
    return func(*args, **kargs)
  File "/opt/homebrew/Cellar/enex2notion/0.2.18/libexec/lib/python3.10/site-packages/notion/client.py", line 275, in post
    return self._post(endpoint, data)
  File "/opt/homebrew/Cellar/enex2notion/0.2.18/libexec/lib/python3.10/site-packages/notion/client.py", line 290, in _post
    raise HTTPError(
requests.exceptions.HTTPError: Uploading .jar files is not allowed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/bin/enex2notion", line 8, in <module>
    sys.exit(main())
  File "/opt/homebrew/Cellar/enex2notion/0.2.18/libexec/lib/python3.10/site-packages/enex2notion/cli.py", line 47, in main
    cli(sys.argv[1:])
  File "/opt/homebrew/Cellar/enex2notion/0.2.18/libexec/lib/python3.10/site-packages/enex2notion/cli.py", line 32, in cli
    _process_input(enex_uploader, args.enex_input)
  File "/opt/homebrew/Cellar/enex2notion/0.2.18/libexec/lib/python3.10/site-packages/enex2notion/cli.py", line 42, in _process_input
    enex_uploader.upload_notebook(path)
  File "/opt/homebrew/Cellar/enex2notion/0.2.18/libexec/lib/python3.10/site-packages/enex2notion/cli_upload.py", line 56, in upload_notebook
    self.upload_note(note, note_idx)
  File "/opt/homebrew/Cellar/enex2notion/0.2.18/libexec/lib/python3.10/site-packages/enex2notion/cli_upload.py", line 79, in upload_note
    _upload_note(self.notebook_root, note, note_blocks)
  File "/opt/homebrew/Cellar/enex2notion/0.2.18/libexec/lib/python3.10/site-packages/enex2notion/cli_upload.py", line 103, in _upload_note
    upload_note(notebook_root, note, note_blocks)
  File "/opt/homebrew/Cellar/enex2notion/0.2.18/libexec/lib/python3.10/site-packages/enex2notion/enex_uploader.py", line 35, in upload_note
    raise NoteUploadFailException
enex2notion.utils_exceptions.NoteUploadFailException

[Bug]: 403 Forbidden

enex2notion version

0.2.25

What OS are you using?

MacOS

OS Version / Linux distribution

Bug description

I followed the guidance of how to get token & restore enex into notion in readme.md. The first some notes' recovery are success but after a while it failed with exception of 403. i tried to log out & login notion and take a new token, but the issue happens again.

Any suggestions on this situation?

Log excerpt

enex2notion --token $token  --done-file notes.txt $path_to_notes
Traceback (most recent call last):
  File "/usr/local/bin/enex2notion", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/enex2notion/cli.py", line 47, in main
    cli(sys.argv[1:])
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/enex2notion/cli.py", line 26, in cli
    root = get_root(args.token, args.root_page)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/enex2notion/cli_notion.py", line 21, in get_root
    client = get_notion_client(token)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/enex2notion/cli_notion.py", line 31, in get_notion_client
    return NotionClient(token_v2=token)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/notion/client.py", line 113, in __init__
    self._update_user_info()
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/notion/client.py", line 144, in _update_user_info
    records = self.post("loadUserContent", {}).json()["recordMap"]
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/ratelimit/decorators.py", line 113, in wrapper
    return func(*args, **kargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/ratelimit/decorators.py", line 80, in wrapper
    return func(*args, **kargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/notion/client.py", line 275, in post
    return self._post(endpoint, data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/notion/client.py", line 298, in _post
    response.raise_for_status()
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://www.notion.so/api/v3/loadUserContent

[Bug]: KeyError: 'block'

enex2notion version

0.2.5

What OS are you using?

Windows

OS Version / Linux distribution

Ubuntu 20.04.4

Bug description

I cannot import any .enex files with enex2notion, although the files can be parsed in dry run.

Seems that the script is able to connect/authenticate with notion with the provided tokens. When providing an invalid token I get an authentication error ( 401 Client Error: Unauthorized for url: https://www.notion.so/api/v3/loadUserContent).

Also tried in Windows and even did export with evernote-backup, always the same result.

File with one note (test.enex) is attached.
test.zip

Log excerpt

enex2notion --verbose "test.enex"
WARNING: No token provided, dry run mode. Nothing will be uploaded to Notion!
INFO: Processing notebook 'test'...

--------
enex2notion --verbose --token eaaeb5...96ba11d8c904d "test.enex"
Traceback (most recent call last):
  File "/home/tom/.local/bin/enex2notion", line 8, in <module>
    sys.exit(main())
  File "/home/tom/.local/lib/python3.8/site-packages/enex2notion/cli.py", line 152, in main
    cli(sys.argv[1:])
  File "/home/tom/.local/lib/python3.8/site-packages/enex2notion/cli.py", line 123, in cli
    root = get_import_root(
  File "/home/tom/.local/lib/python3.8/site-packages/enex2notion/enex_uploader.py", line 19, in get_import_root
    for page in client.get_top_level_pages():
  File "/home/tom/.local/lib/python3.8/site-packages/notion/client.py", line 159, in get_top_level_pages
    return [self.get_block(bid) for bid in records["block"].keys()]
KeyError: 'block'

[Feature request]: Create a fast mode

Suggestion

enex2notion currently adds block by block of content, making it quite slow.
While reading the Notion API docs I found that Pages/Database entries can be created with all blocks defined in the children property all at once.
I imagine there must be a limitation for this method, since it was not used by the library.
So, what about creating a --fast mode that predefines all blocks in only one Page/DB creation request? If there are limtation we can just list them in the documentation.

[Feature request]: Upload statititics

Suggestion

I'd love to be able to see during an upload how many notes have been already placed in Notion and how many are awaiting upload, something like Uploading note 331 out of 1201 '[TITLE]' ….

[Feature request]: Skip parsing errors in messy HTMLs

Suggestion

I am trying to import my notes which include quite some web clips.
A lot of the the HTMLs are quite messy, and the import would fail.

Can we have a option that skip notes that could not be parsed?

btw, my import dies on this line:

 File "D:\dev_utils\Miniconda3\envs\notion_import\lib\site-packages\enex2notion\note_parser\elements\media.py", line 68, in _parse_img_resource
     img_data = parse_data_uri(bin_src)
  File "D:\dev_utils\Miniconda3\envs\notion_import\lib\site-packages\w3lib\url.py", line 381, in parse_data_uri
    raise ValueError("invalid data URI")

[Bug]Can not import with error: EOF occurred in violation of protocol (_ssl.c:997)

Hi @vzhd1701 ,

Really appreciate the work you have done. I have hundreds of notebooks in Evernote but can't import them into Notion.

I used enex2notion to successfully import many notebooks. But for some certain notebooks I tried many times but end in following errors, so I created this issue to see if you could help me, thank you!

I run enex2notion in Apple M1 Mac mini with MacOS Ventura Beta.

enex2notion version

0.2.17_1

What OS are you using?

MacOS

OS Version / Linux distribution

MacOS Ventura 13.0 beta

Bug description

When importing one note, get following error: EOF occurred in violation of protocol (_ssl.c:997)

Log excerpt

% enex2notion --token <token> Downloads/Evernote_backup/00\ Inbox.enex
INFO: 'Evernote ENEX Import' page found
INFO: Processing notebook '00 Inbox'...
INFO: Uploading note 1 out of 372 'mynote'
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/enex2notion/0.2.17_1/libexec/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "/opt/homebrew/Cellar/enex2notion/0.2.17_1/libexec/lib/python3.10/site-packages/urllib3/connectionpool.py", line 386, in _make_request
    self._validate_conn(conn)
  File "/opt/homebrew/Cellar/enex2notion/0.2.17_1/libexec/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1042, in _validate_conn
    conn.connect()
  File "/opt/homebrew/Cellar/enex2notion/0.2.17_1/libexec/lib/python3.10/site-packages/urllib3/connection.py", line 414, in connect
    self.sock = ssl_wrap_socket(
  File "/opt/homebrew/Cellar/enex2notion/0.2.17_1/libexec/lib/python3.10/site-packages/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(
  File "/opt/homebrew/Cellar/enex2notion/0.2.17_1/libexec/lib/python3.10/site-packages/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
  File "/opt/homebrew/Cellar/[email protected]/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
  File "/opt/homebrew/Cellar/[email protected]/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1071, in _create
    self.do_handshake()
  File "/opt/homebrew/Cellar/[email protected]/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1342, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:997)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/enex2notion/0.2.17_1/libexec/lib/python3.10/site-packages/requests/adapters.py", line 489, in send
    resp = conn.urlopen(
  File "/opt/homebrew/Cellar/enex2notion/0.2.17_1/libexec/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen
    retries = retries.increment(
  File "/opt/homebrew/Cellar/enex2notion/0.2.17_1/libexec/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='s3.us-west-2.amazonaws.com', port=443): Max retries exceeded with url: /secure.notion-static.com/11f838a8-81c2-4d29-a39e-0472f19a2a93/36fe2803108438006777b3f3c0a13ac4_s.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAT73L2G45EIPT3X45%2F20220807%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20220807T043313Z&X-Amz-Expires=86400&X-Amz-Signature=fdb32f7c8b3b03ad5aed6d90e1ec16aa349de946e2d60e9bf091ff04dfccc386&X-Amz-SignedHeaders=host&x-id=PutObject (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/bin/enex2notion", line 8, in <module>
    sys.exit(main())
  File "/opt/homebrew/Cellar/enex2notion/0.2.17_1/libexec/lib/python3.10/site-packages/enex2notion/cli.py", line 47, in main
    cli(sys.argv[1:])
  File "/opt/homebrew/Cellar/enex2notion/0.2.17_1/libexec/lib/python3.10/site-packages/enex2notion/cli.py", line 32, in cli
    _process_input(enex_uploader, args.enex_input)
  File "/opt/homebrew/Cellar/enex2notion/0.2.17_1/libexec/lib/python3.10/site-packages/enex2notion/cli.py", line 42, in _process_input
    enex_uploader.upload_notebook(path)
  File "/opt/homebrew/Cellar/enex2notion/0.2.17_1/libexec/lib/python3.10/site-packages/enex2notion/cli_upload.py", line 56, in upload_notebook
    self.upload_note(note, note_idx)
  File "/opt/homebrew/Cellar/enex2notion/0.2.17_1/libexec/lib/python3.10/site-packages/enex2notion/cli_upload.py", line 79, in upload_note
    _upload_note(self.notebook_root, note, note_blocks)
  File "/opt/homebrew/Cellar/enex2notion/0.2.17_1/libexec/lib/python3.10/site-packages/enex2notion/cli_upload.py", line 103, in _upload_note
    upload_note(notebook_root, note, note_blocks)
  File "/opt/homebrew/Cellar/enex2notion/0.2.17_1/libexec/lib/python3.10/site-packages/enex2notion/enex_uploader.py", line 28, in upload_note
    upload_block(new_page, block)
  File "/opt/homebrew/Cellar/enex2notion/0.2.17_1/libexec/lib/python3.10/site-packages/enex2notion/enex_uploader_block.py", line 16, in upload_block
    _upload_file(new_block, block.resource)
  File "/opt/homebrew/Cellar/enex2notion/0.2.17_1/libexec/lib/python3.10/site-packages/enex2notion/enex_uploader_block.py", line 45, in _upload_file
    response = requests.put(
  File "/opt/homebrew/Cellar/enex2notion/0.2.17_1/libexec/lib/python3.10/site-packages/requests/api.py", line 130, in put
    return request("put", url, data=data, **kwargs)
  File "/opt/homebrew/Cellar/enex2notion/0.2.17_1/libexec/lib/python3.10/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "/opt/homebrew/Cellar/enex2notion/0.2.17_1/libexec/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
  File "/opt/homebrew/Cellar/enex2notion/0.2.17_1/libexec/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
  File "/opt/homebrew/Cellar/enex2notion/0.2.17_1/libexec/lib/python3.10/site-packages/requests/adapters.py", line 563, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='s3.us-west-2.amazonaws.com', port=443): Max retries exceeded with url: /secure.notion-static.com/11f838a8-81c2-4d29-a39e-0472f19a2a93/36fe2803108438006777b3f3c0a13ac4_s.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAT73L2G45EIPT3X45%2F20220807%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20220807T043313Z&X-Amz-Expires=86400&X-Amz-Signature=fdb32f7c8b3b03ad5aed6d90e1ec16aa349de946e2d60e9bf091ff04dfccc386&X-Amz-SignedHeaders=host&x-id=PutObject (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)')))

[Bug]: enex_parser_xml exception

enex2notion version

0.2.13

What OS are you using?

Windows

OS Version / Linux distribution

Windows 10 21H2 Home 19044.1706

Bug description

While uploading a file (.enex) I get an error:

Traceback (most recent call last):
File "enex2notion_main_.py", line 4, in
File "enex2notion\cli.py", line 47, in main
File "enex2notion\cli.py", line 32, in cli
File "enex2notion\cli.py", line 42, in _process_input
File "enex2notion\cli_upload.py", line 53, in upload_notebook
File "enex2notion\enex_parser.py", line 23, in count_notes
File "enex2notion\enex_parser_xml.py", line 23, in iter_process_xml_elements
File "xml\etree\ElementTree.py", line 1227, in iterator
File "xml\etree\ElementTree.py", line 1302, in read_events
File "xml\etree\ElementTree.py", line 1274, in feed
xml.etree.ElementTree.ParseError: undefined entity  : line 7144081, column 174
[16176] Failed to execute script 'main' due to unhandled exception!

Log excerpt

No response

[Feature request]: Add custom page tag

Suggestion

It would be awesome to have the option to pass an option to set a custom tag for each page created in Notion by this tool. So that I could do something like this:

enex2notion . --tag imported-from-evernote

Thanks for the AWESOME tool! I've been waiting forever for Notion to fix their import from Evernote. I'm very hopeful that this tool will finally allow me to make the switch.

[Bug]: requests.exceptions.HTTPError: Uploading .apk files is not allowed

enex2notion version

enex2notion 0.2.19

What OS are you using?

Linux

OS Version / Linux distribution

16.04

Bug description

Because apk file, I got this :

WARNING: Failed to upload note '安卓版QQ微信百变语音变声器,修复卡密激' to Notion! Retrying...
 89%|███████████████████████████████████▊    | 34/38 [00:14<00:02,  2.00block/s]ERROR: Got 400 error attempting to POST to getUploadFileUrl, with data: {
  "bucket": "secure",
  "name": "\u8587\u8fb0\u8bed\u97f3\u52a9\u624bV1.5.apk",
  "contentType": "application/octet-stream",
  "record": {
    "table": "block",
    "id": "04dc5344-876c-4d28-b318-ddae9ad196a0",
    "spaceId": "47712955-f40b-4bdf-82df-50bdd22aee8c"
  }
}
Traceback (most recent call last):
  File "/root/.local/lib/python3.8/site-packages/enex2notion/enex_uploader.py", line 28, in upload_note
    upload_block(new_page, block)
  File "/root/.local/lib/python3.8/site-packages/enex2notion/enex_uploader_block.py", line 16, in upload_block
    _upload_file(new_block, block.resource)
  File "/root/.local/lib/python3.8/site-packages/enex2notion/enex_uploader_block.py", line 41, in _upload_file
    upload_data = new_block._client.post(  # noqa: WPS437
  File "/root/.local/lib/python3.8/site-packages/ratelimit/decorators.py", line 113, in wrapper
    return func(*args, **kargs)
  File "/root/.local/lib/python3.8/site-packages/ratelimit/decorators.py", line 80, in wrapper
    return func(*args, **kargs)
  File "/root/.local/lib/python3.8/site-packages/notion/client.py", line 275, in post
    return self._post(endpoint, data)
  File "/root/.local/lib/python3.8/site-packages/notion/client.py", line 290, in _post
    raise HTTPError(
requests.exceptions.HTTPError: Uploading .apk files is not allowed

Log excerpt

No response

[Bug]: Error when connection timeout/failure occurs

enex2notion version

v0.2.26

What OS are you using?

Windows

OS Version / Linux distribution

Windows 11 22621.1778

Bug description

This is more of an FYI and question about handling of connection issues/timeouts. I'm assuming based on these errors that Notion's API has stopped responding. This happens mostly on large batches with 100+ notes. Let me know if you would like me to run with verbose set. Thank you so much for the work you've put in on this utility. It is a lifesaver. 🖖

INFO: Uploading note 32 out of 461 'Android Forums at AndroidCentral.com'
Traceback (most recent call last):
File "urllib3\connectionpool.py", line 703, in urlopen
File "urllib3\connectionpool.py", line 386, in make_request
File "urllib3\connectionpool.py", line 1042, in validate_conn
File "urllib3\connection.py", line 419, in connect
File "urllib3\util\ssl
.py", line 449, in ssl_wrap_socket
File "urllib3\util\ssl
.py", line 493, in _ssl_wrap_socket_impl
File "ssl.py", line 500, in wrap_socket
File "ssl.py", line 1040, in _create
File "ssl.py", line 1309, in do_handshake
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "requests\adapters.py", line 489, in send
File "urllib3\connectionpool.py", line 787, in urlopen
File "urllib3\util\retry.py", line 550, in increment
File "urllib3\packages\six.py", line 769, in reraise
File "urllib3\connectionpool.py", line 703, in urlopen
File "urllib3\connectionpool.py", line 386, in make_request
File "urllib3\connectionpool.py", line 1042, in validate_conn
File "urllib3\connection.py", line 419, in connect
File "urllib3\util\ssl
.py", line 449, in ssl_wrap_socket
File "urllib3\util\ssl
.py", line 493, in _ssl_wrap_socket_impl
File "ssl.py", line 500, in wrap_socket
File "ssl.py", line 1040, in _create
File "ssl.py", line 1309, in do_handshake
urllib3.exceptions.ProtocolError: ('Connection aborted.', TimeoutError(10060, 'A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond', None, 10060, None))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "enex2notion_main_.py", line 4, in
File "enex2notion\cli.py", line 47, in main
File "enex2notion\cli.py", line 32, in cli
File "enex2notion\cli.py", line 42, in _process_input
File "enex2notion\cli_upload.py", line 56, in upload_notebook
File "enex2notion\cli_upload.py", line 79, in upload_note
File "enex2notion\cli_upload.py", line 103, in _upload_note
File "enex2notion\enex_uploader.py", line 28, in upload_note
File "enex2notion\enex_uploader_block.py", line 16, in upload_block
File "enex2notion\enex_uploader_block.py", line 45, in _upload_file
File "requests\api.py", line 130, in put
File "requests\api.py", line 59, in request
File "requests\sessions.py", line 587, in request
File "requests\sessions.py", line 701, in send
File "requests\adapters.py", line 547, in send
requests.exceptions.ConnectionError: ('Connection aborted.', TimeoutError(10060, 'A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond', None, 10060, None))
[43816] Failed to execute script 'main' due to unhandled exception!

Log excerpt

No response

[Bug]: upload breaks on certain HTML content notes

enex2notion version

0.2.5

What OS are you using?

Linux

OS Version / Linux distribution

Ubuntu 20.04.3 LTS

Bug description

Here is a note with HTML content that breaks the enex2notion upload:

https://www.evernote.com/shard/s5/sh/116c967e-abf5-4776-ab89-b267f14b1596/2ef25a4d2a6cc1f48c099e651a9a56b1

Log excerpt

ERROR: Unhandled exception while parsing note 'FKD - Deco Bottle Rigging'!
Traceback (most recent call last):
  File "/home/henkisdabro/.local/bin/enex2notion", line 8, in <module>
    sys.exit(main())
  File "/home/henkisdabro/.local/lib/python3.8/site-packages/enex2notion/cli.py", line 152, in main
    cli(sys.argv[1:])
  File "/home/henkisdabro/.local/lib/python3.8/site-packages/enex2notion/cli.py", line 145, in cli
    enex_uploader.upload(enex_file)
  File "/home/henkisdabro/.local/lib/python3.8/site-packages/enex2notion/cli.py", line 84, in upload
    note_blocks = self._parse_note(note)
  File "/home/henkisdabro/.local/lib/python3.8/site-packages/enex2notion/cli.py", line 94, in _parse_note
    return parse_note(
  File "/home/henkisdabro/.local/lib/python3.8/site-packages/enex2notion/note_parser.py", line 27, in parse_note
    note_blocks = parse_webclip(note_dom)
  File "/home/henkisdabro/.local/lib/python3.8/site-packages/enex2notion/note_parser_webclip.py", line 77, in parse_webclip
    processor(note_dom)
  File "/home/henkisdabro/.local/lib/python3.8/site-packages/enex2notion/note_parser_webclip.py", line 175, in _flatten_root
    _split_by_blocks(element)
  File "/home/henkisdabro/.local/lib/python3.8/site-packages/enex2notion/note_parser_webclip.py", line 209, in _split_by_blocks
    _split_by_blocks(next_chunk)
  File "/home/henkisdabro/.local/lib/python3.8/site-packages/enex2notion/note_parser_webclip.py", line 209, in _split_by_blocks
    _split_by_blocks(next_chunk)
  File "/home/henkisdabro/.local/lib/python3.8/site-packages/enex2notion/note_parser_webclip.py", line 209, in _split_by_blocks
    _split_by_blocks(next_chunk)
  [Previous line repeated 973 more times]
  File "/home/henkisdabro/.local/lib/python3.8/site-packages/enex2notion/note_parser_webclip.py", line 202, in _split_by_blocks
    next_chunk = copy.copy(element)
  File "/usr/lib/python3.8/copy.py", line 84, in copy
    return copier(x)
  File "/home/henkisdabro/.local/lib/python3.8/site-packages/bs4/element.py", line 1281, in __copy__
    clone.append(child.__copy__())
  File "/home/henkisdabro/.local/lib/python3.8/site-packages/bs4/element.py", line 1271, in __copy__
    None, self.builder, self.name, self.namespace,
  File "/home/henkisdabro/.local/lib/python3.8/site-packages/bs4/element.py", line 1532, in __getattr__
    return self.find(tag)
  File "/home/henkisdabro/.local/lib/python3.8/site-packages/bs4/element.py", line 1841, in find
    l = self.find_all(name, attrs, recursive, text, 1, **kwargs)
  File "/home/henkisdabro/.local/lib/python3.8/site-packages/bs4/element.py", line 1868, in find_all
    return self._find_all(name, attrs, text, limit, generator, **kwargs)
  File "/home/henkisdabro/.local/lib/python3.8/site-packages/bs4/element.py", line 790, in _find_all
    strainer = SoupStrainer(name, attrs, text, **kwargs)
  File "/home/henkisdabro/.local/lib/python3.8/site-packages/bs4/element.py", line 2021, in __init__
    self.text = self._normalize_search_value(text)
  File "/home/henkisdabro/.local/lib/python3.8/site-packages/bs4/element.py", line 2026, in _normalize_search_value
    if (isinstance(value, str) or isinstance(value, Callable) or hasattr(value, 'match')
  File "/usr/lib/python3.8/abc.py", line 98, in __instancecheck__
    return _abc_instancecheck(cls, instance)
RecursionError: maximum recursion depth exceeded in comparison

[Bug]:

enex2notion version

enex2notion 0.2.24

What OS are you using?

MacOS

OS Version / Linux distribution

Ventura 13.0.1

Bug description

Hello,

This seems to be related to #67 - meaning, it starts with the same 400 error, but with a different error thrown at the end:

requests.exceptions.HTTPError: Unsaved transactions: SpaceShardRecordPointer have no space id

Things I have tried:

  • reinstalled brew, enex (to check if any updated python packages)
  • converted all complex html --> to simple formatting
  • checked all 17 notes in this test notebook has no tables

Very grateful for any suggestions you might have. Thank you for creating enex2notion!

Log excerpt

INFO: 'Evernote ENEX Import' page found
INFO: Processing notebook 'startups'...
INFO: Uploading note 1 out of 17 '#AAA What Every Startup Needs to Know'
ERROR: Got 400 error attempting to POST to submitTransaction, with data: {
  "operations": [
    {
      "id": "573315a1-e65b-47d0-bb43-00a16388b356",
      "path": [],
      "args": {
        "id": "573315a1-e65b-47d0-bb43-00a16388b356",
        "version": 1,
        "alive": true,
        "created_by_id": "fe3731c3-b03e-4da0-8e0e-79b2ad01ec4c",
        "created_by_table": "notion_user",
        "created_time": 1670302128753,
        "parent_id": "4b5b3562-c2fe-4316-95f3-0a0e784e5860",
        "parent_table": "collection",
        "type": "page"
      },
      "command": "set",
      "table": "block"
    },
    {
      "args": {
        "last_edited_by_id": "fe3731c3-b03e-4da0-8e0e-79b2ad01ec4c",
        "last_edited_by_table": "notion_user",
        "last_edited_time": 1670302128753
      },
      "command": "update",
      "id": "573315a1-e65b-47d0-bb43-00a16388b356",
      "path": [],
      "table": "block"
    },
    {
      "args": {
        "last_edited_by_id": "fe3731c3-b03e-4da0-8e0e-79b2ad01ec4c",
        "last_edited_by_table": "notion_user",
        "last_edited_time": 1670302128753
      },
      "command": "update",
      "id": "573315a1-e65b-47d0-bb43-00a16388b356",
      "path": [],
      "table": "block"
    }
  ]
}
Traceback (most recent call last):
  File "/opt/homebrew/bin/enex2notion", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/homebrew/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/enex2notion/cli.py", line 47, in main
    cli(sys.argv[1:])
  File "/opt/homebrew/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/enex2notion/cli.py", line 32, in cli
    _process_input(enex_uploader, args.enex_input)
  File "/opt/homebrew/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/enex2notion/cli.py", line 42, in _process_input
    enex_uploader.upload_notebook(path)
  File "/opt/homebrew/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/enex2notion/cli_upload.py", line 56, in upload_notebook
    self.upload_note(note, note_idx)
  File "/opt/homebrew/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/enex2notion/cli_upload.py", line 79, in upload_note
    _upload_note(self.notebook_root, note, note_blocks)
  File "/opt/homebrew/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/enex2notion/cli_upload.py", line 103, in _upload_note
    upload_note(notebook_root, note, note_blocks)
  File "/opt/homebrew/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/enex2notion/enex_uploader.py", line 20, in upload_note
    new_page = _make_page(note, root)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/enex2notion/enex_uploader.py", line 59, in _make_page
    root.collection.add_row(
  File "/opt/homebrew/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/notion/collection.py", line 202, in add_row
    return self.add_row_block(columns=columns)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/notion/collection.py", line 213, in add_row_block
    row_id = self._client.create_record("block", self, type="page")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/notion/client.py", line 416, in create_record
    with self.as_atomic_transaction():
  File "/opt/homebrew/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/notion/client.py", line 468, in __exit__
    self.client.submit_transaction(operations)
  File "/opt/homebrew/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/notion/client.py", line 323, in submit_transaction
    self.post("submitTransaction", data)
  File "/opt/homebrew/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/ratelimit/decorators.py", line 113, in wrapper
    return func(*args, **kargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/ratelimit/decorators.py", line 80, in wrapper
    return func(*args, **kargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/notion/client.py", line 275, in post
    return self._post(endpoint, data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/enex2notion/0.2.24/libexec/lib/python3.11/site-packages/notion/client.py", line 290, in _post
    raise HTTPError(
requests.exceptions.HTTPError: Unsaved transactions: SpaceShardRecordPointer have no space id

[Bug]: yinxiang markdown block

enex2notion version

latest

What OS are you using?

Windows

OS Version / Linux distribution

Windows 10

Bug description

The end of notion notes is always garbled。
image
image

Log excerpt

No response

Paused upload

I lost connection and my upload was paused at Uploading '[NOTE]' |#### | 7/53. Is there a way to resume it? If I restart from the beginning, will I get duplicated results?

Installation fails at `poetry install --no-dev`

I had problems installing Poetry (it didn't appear with poetry --version after installation; I tried different methods). Finally it worked, but now I cannot move step forward and use poetry install --no-dev in enex2notion's folder.

Here is my configuration:

  • Poetry version 1.1.13
  • Python 2.7.18
  • Python 3.9.13
  • pip 22.1 from /opt/homebrew/lib/python3.9/site-packages/pip (python 3.9)
  • pipx 1.0.0
Terminal says this (click)
Installing dependencies from lock file

Package operations: 1 install, 0 updates, 0 removals

  • Installing pymupdf (1.19.6): Failed

  EnvCommandError

  Command ['/Users/jakub/Library/Caches/pypoetry/virtualenvs/enex2notion-cSoCjhGn-py3.10/bin/pip', 'install', '--no-deps', 'file:///Users/jakub/Library/Caches/pypoetry/artifacts/6b/7c/af/7535c83df8c3f1fcf8950fc7539c8c3be8162811582af606547c33dd64/PyMuPDF-1.19.6.tar.gz'] errored with the following return code 1, and output: 
  Processing /Users/jakub/Library/Caches/pypoetry/artifacts/6b/7c/af/7535c83df8c3f1fcf8950fc7539c8c3be8162811582af606547c33dd64/PyMuPDF-1.19.6.tar.gz
    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'done'
  Building wheels for collected packages: PyMuPDF
    Building wheel for PyMuPDF (setup.py): started
    Building wheel for PyMuPDF (setup.py): finished with status 'error'
    error: subprocess-exited-with-error
    
    × python setup.py bdist_wheel did not run successfully.
    │ exit code: 1
    ╰─> [20 lines of output]
        running bdist_wheel
        running build
        running build_py
        creating build
        creating build/lib.macosx-12-arm64-cpython-310
        creating build/lib.macosx-12-arm64-cpython-310/fitz
        copying fitz/__init__.py -> build/lib.macosx-12-arm64-cpython-310/fitz
        copying fitz/fitz.py -> build/lib.macosx-12-arm64-cpython-310/fitz
        copying fitz/utils.py -> build/lib.macosx-12-arm64-cpython-310/fitz
        copying fitz/__main__.py -> build/lib.macosx-12-arm64-cpython-310/fitz
        running build_ext
        building 'fitz._fitz' extension
        creating build/temp.macosx-12-arm64-cpython-310
        creating build/temp.macosx-12-arm64-cpython-310/fitz
        clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/include/mupdf -I/usr/local/include -Imupdf/thirdparty/freetype/include -I/usr/local/include/freetype2 -I/usr/X11R6/include/freetype2 -I/opt/homebrew/include -I/opt/homebrew/include/mupdf -I/opt/homebrew/include/freetype2 -I/Users/jakub/Library/Caches/pypoetry/virtualenvs/enex2notion-cSoCjhGn-py3.10/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c fitz/fitz_wrap.c -o build/temp.macosx-12-arm64-cpython-310/fitz/fitz_wrap.o
        fitz/fitz_wrap.c:2755:10: fatal error: 'fitz.h' file not found
        #include <fitz.h>
                 ^~~~~~~~
        1 error generated.
        error: command '/usr/bin/clang' failed with exit code 1
        [end of output]
    
    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for PyMuPDF
    Running setup.py clean for PyMuPDF
  Failed to build PyMuPDF
  Installing collected packages: PyMuPDF
    Running setup.py install for PyMuPDF: started
    Running setup.py install for PyMuPDF: finished with status 'error'
    error: subprocess-exited-with-error
    
    × Running setup.py install for PyMuPDF did not run successfully.
    │ exit code: 1
    ╰─> [22 lines of output]
        running install
        /Users/jakub/Library/Caches/pypoetry/virtualenvs/enex2notion-cSoCjhGn-py3.10/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
          warnings.warn(
        running build
        running build_py
        creating build
        creating build/lib.macosx-12-arm64-cpython-310
        creating build/lib.macosx-12-arm64-cpython-310/fitz
        copying fitz/__init__.py -> build/lib.macosx-12-arm64-cpython-310/fitz
        copying fitz/fitz.py -> build/lib.macosx-12-arm64-cpython-310/fitz
        copying fitz/utils.py -> build/lib.macosx-12-arm64-cpython-310/fitz
        copying fitz/__main__.py -> build/lib.macosx-12-arm64-cpython-310/fitz
        running build_ext
        building 'fitz._fitz' extension
        creating build/temp.macosx-12-arm64-cpython-310
        creating build/temp.macosx-12-arm64-cpython-310/fitz
        clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/include/mupdf -I/usr/local/include -Imupdf/thirdparty/freetype/include -I/usr/local/include/freetype2 -I/usr/X11R6/include/freetype2 -I/opt/homebrew/include -I/opt/homebrew/include/mupdf -I/opt/homebrew/include/freetype2 -I/Users/jakub/Library/Caches/pypoetry/virtualenvs/enex2notion-cSoCjhGn-py3.10/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c fitz/fitz_wrap.c -o build/temp.macosx-12-arm64-cpython-310/fitz/fitz_wrap.o
        fitz/fitz_wrap.c:2755:10: fatal error: 'fitz.h' file not found
        #include <fitz.h>
                 ^~~~~~~~
        1 error generated.
        error: command '/usr/bin/clang' failed with exit code 1
        [end of output]
    
    note: This error originates from a subprocess, and is likely not a problem with pip.
  error: legacy-install-failure
  
  × Encountered error while trying to install package.
  ╰─> PyMuPDF
  
  note: This is an issue with the package mentioned above, not pip.
  hint: See above for output from the failure.
  WARNING: You are using pip version 22.0.4; however, version 22.1.1 is available.
  You should consider upgrading via the '/Users/jakub/Library/Caches/pypoetry/virtualenvs/enex2notion-cSoCjhGn-py3.10/bin/python -m pip install --upgrade pip' command.
  

  at ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry/utils/env.py:1195 in _run
      1191│                 output = subprocess.check_output(
      1192│                     cmd, stderr=subprocess.STDOUT, **kwargs
      1193│                 )
      1194│         except CalledProcessError as e:
    → 1195│             raise EnvCommandError(e, input=input_)
      1196│ 
      1197│         return decode(output)
      1198│ 
      1199│     def execute(self, bin, *args, **kwargs):

jakub@MacBook-Pro enex2notion % poetry run enex2notion
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/homebrew/Cellar/[email protected]/3.10.4/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/Users/jakub/enex2notion/enex2notion/cli.py", line 18, in <module>
    from enex2notion.note_parser import parse_note
  File "/Users/jakub/enex2notion/enex2notion/note_parser.py", line 9, in <module>
    from enex2notion.note_parser_webclip_pdf import parse_webclip_to_pdf
  File "/Users/jakub/enex2notion/enex2notion/note_parser_webclip_pdf.py", line 6, in <module>
    import fitz
ModuleNotFoundError: No module named 'fitz'

I don't have much experience with terminal, I just follow the instructions.

[Bug]: AttributeError: 'NoneType' object has no attribute 'group'

enex2notion version

0.1.1

What OS are you using?

MacOS

OS Version / Linux distribution

12.0.1

Bug description

Importing an ENEX file with 800+ notes.

Worked fine for the first 40 notes or so. Then gave this error.

What happened? How can I help debug this?

Log excerpt

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/bin/enex2notion", line 8, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/cli.py", line 100, in main
    cli(sys.argv[1:])
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/cli.py", line 95, in cli
    enex_uploader.upload(enex_input)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/cli.py", line 54, in upload
    note_blocks = parse_note(note, self.add_meta)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/note_parser.py", line 19, in parse_note
    note_blocks = parse_note_dom(note_dom)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/note_parser_dom.py", line 38, in parse_note_dom
    block = _parse_block(child)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/note_parser_dom.py", line 77, in _parse_block
    return tag_parser(element)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/note_parser_e_div.py", line 34, in parse_div
    return parse_text(element)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/note_parser_e_div.py", line 42, in parse_text
    return NotionTextBlock(text_prop=extract_string(element))
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/string_extractor.py", line 18, in extract_string
    string_blocks = _extract_blocks(div_lines)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/string_extractor.py", line 39, in _extract_blocks
    string_properties = resolve_string_properties(parent_stack)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/string_extractor_properties.py", line 23, in resolve_string_properties
    tag_property = tag_map[tag.name](tag)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/string_extractor_properties.py", line 41, in _resolve_span
    color = extract_color(style)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/colors.py", line 89, in extract_color
    color = color_extract_func(match.group(1))
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/colors.py", line 118, in _extract_foreground_rgb
    rbg_fg = _parse_rgb(rgb_str)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/colors.py", line 133, in _parse_rgb
    color_str = re.match(r"^rgb\((.*?)\)$", color).group(1)
AttributeError: 'NoneType' object has no attribute 'group'

In the middle of a note import i get NoneType object has no attribute 'get' and everything crashes

Hi.

After two notebooks imported successfully and some notes of the current one i get one crashing which stops everything:

DEBUG: Creating new page for note '¿Están exentos los rendimientos del trabajo obtenidos en el extranjero? - Billage CRM'
Traceback (most recent call last):
File "C:\Python\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Python\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Python\Scripts\enex2notion.exe_main
.py", line 7, in
File "C:\Python\lib\site-packages\enex2notion\cli.py", line 47, in main
cli(sys.argv[1:])
File "C:\Python\lib\site-packages\enex2notion\cli.py", line 32, in cli
_process_input(enex_uploader, args.enex_input)
File "C:\Python\lib\site-packages\enex2notion\cli.py", line 40, in _process_input
enex_uploader.upload_notebook(enex_file)
File "C:\Python\lib\site-packages\enex2notion\cli_upload.py", line 55, in upload_notebook
for note_idx, note in enumerate(iter_notes(enex_file), 1):
File "C:\Python\lib\site-packages\enex2notion\enex_parser.py", line 27, in iter_notes
yield from (_process_note(e) for e in iter_xml_elements_as_dict(enex_file, "note"))
File "C:\Python\lib\site-packages\enex2notion\enex_parser.py", line 27, in
yield from (_process_note(e) for e in iter_xml_elements_as_dict(enex_file, "note"))
File "C:\Python\lib\site-packages\enex2notion\enex_parser.py", line 53, in _process_note
resources=_parse_resources(note_raw),
File "C:\Python\lib\site-packages\enex2notion\enex_parser.py", line 63, in _parse_resources
return [_convert_resource(r) for r in note_resources]
File "C:\Python\lib\site-packages\enex2notion\enex_parser.py", line 63, in
return [_convert_resource(r) for r in note_resources]
File "C:\Python\lib\site-packages\enex2notion\enex_parser.py", line 105, in _convert_resource
if resource_raw.get("data", {}).get("#text"):
AttributeError: 'NoneType' object has no attribute 'get'

Regards,
Albert

[Feature request]: Import Tags in the body

Suggestion

Since Tags are not searchable with the main Search tool of Notion, it would be useful to add an option where we can duplicate the tags in the body of the page / db entry.

[Bug]: If the last edit time is null, the date is still the uploading date of Notion

enex2notion version

0.2.10

What OS are you using?

Windows

OS Version / Linux distribution

Windows 11

Bug description

Thanks for the work on #29.
There are some notes in Evernote. When a new note is created and the content is quickly copied into, the last edit time will be null.
When the last edit time is null in metadate, the notion will still use the uploading date as the updated date.
My understanding is that if the last edit time is null, we could use created date as updated date.

Log excerpt

No response

[Bug]: Importing web-clipped note

enex2notion version

0.1.0

What OS are you using?

MacOS

OS Version / Linux distribution

Monterey - 12.0.1

Bug description

I am getting attached error when trying to import a note (web clipped by Evernote -- this is the note link https://www.evernote.com/shard/s49/sh/af12db2f-4832-49c9-b02f-07fd7f9c9bff/835547ad37efc6b14325ac0eaace5876
)

In general it would be very nice if the tool could proceed to the next note if it encounters an error while parsing a note (as opposed to stopping the importing process entirely:) ) if at all possible.

Log excerpt

DEBUG: Parsing note '(21) Torque and angular momentum | AP®︎ Physics 1 | Science | Khan Academy'...
DEBUG: Skipping webclip block
Traceback (most recent call last):
  File "/Users/olkido/Library/Python/3.8/bin/enex2notion", line 8, in <module>
    sys.exit(main())
  File "/Users/olkido/Library/Python/3.8/lib/python/site-packages/enex2notion/cli.py", line 100, in main
    cli(sys.argv[1:])
  File "/Users/olkido/Library/Python/3.8/lib/python/site-packages/enex2notion/cli.py", line 95, in cli
    enex_uploader.upload(enex_input)
  File "/Users/olkido/Library/Python/3.8/lib/python/site-packages/enex2notion/cli.py", line 54, in upload
    note_blocks = parse_note(note, self.add_meta)
  File "/Users/olkido/Library/Python/3.8/lib/python/site-packages/enex2notion/note_parser.py", line 19, in parse_note
    note_blocks = parse_note_dom(note_dom)
  File "/Users/olkido/Library/Python/3.8/lib/python/site-packages/enex2notion/note_parser_dom.py", line 38, in parse_note_dom
    block = _parse_block(child)
  File "/Users/olkido/Library/Python/3.8/lib/python/site-packages/enex2notion/note_parser_dom.py", line 77, in _parse_block
    return tag_parser(element)
  File "/Users/olkido/Library/Python/3.8/lib/python/site-packages/enex2notion/note_parser_e_media.py", line 53, in parse_img
    img_resource = _parse_img_resource(src)
  File "/Users/olkido/Library/Python/3.8/lib/python/site-packages/enex2notion/note_parser_e_media.py", line 64, in _parse_img_resource
    imd_bin = base64.b64decode(bin_src.split("base64,")[1])
IndexError: list index out of range

[Bug]: 403 Client Error

enex2notion version

enex2notion 0.2.12

What OS are you using?

MacOS

OS Version / Linux distribution

Monterey 12.3.1

Bug description

While uploading a file (.enex) I get an error 403

Log excerpt

Traceback (most recent call last):
  File "enex2notion/__main__.py", line 4, in <module>
  File "enex2notion/cli.py", line 175, in main
  File "enex2notion/cli.py", line 134, in cli
  File "enex2notion/cli.py", line 165, in get_root
  File "enex2notion/enex_uploader.py", line 26, in get_notion_client
  File "notion/client.py", line 96, in __init__
  File "notion/client.py", line 127, in _update_user_info
  File "notion/client.py", line 270, in post
  File "requests/models.py", line 960, in raise_for_status
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://www.notion.so/api/v3/loadUserContent
[3314] Failed to execute script '__main__' due to unhandled exception!

[Bug]: ERROR: Invalid token provided!

enex2notion version

0.2.25

What OS are you using?

Windows

OS Version / Linux distribution

Windows 10

Bug description

I run the following command
.\enex2notion.exe --done-file D:\done.txt --token [MY_TOKEN] D:\evernote\*.enex
and only get a error message
ERROR: Invalid token provided!
image

Log excerpt

No response

[Feature request]: Deprecated functions

Suggestion

Just trying the tool and it seems to work, but it's throwing some comments about functions being deprecated soon. Might be worth to look at that :)

Deprecation: 'loadPage' removed from class 'Document' after v1.19 - use 'load_page'.
Deprecation: 'getPixmap' removed from class 'Page' after v1.19 - use 'get_pixmap'.
Deprecation: 'getImageData' removed from class 'Pixmap' after v1.19 - use 'tobytes'.

"data" attribute not exist in resource_raw

Hi,

I am reporting an edge case with the script, which I encountered when uploading my enex file. Below are the details:
In this line https://github.com/vzhd1701/enex2notion/blob/master/enex2notion/enex_parser.py#L95 , the resource_raw sometimes doesn't have the "data" attribute, thus before getting the "data", it's better to check if that key exist, I did that local change and it works very well so far.

Besides that, I really want to express my appreciation for the work you've done. This is an amazing tool! I've been using Evernote for 11 years, and have been paying them for 8+ years. Evernote used to be a simple, useful tool. But now it's basically a piece of sh*t, I can't even open their app successfully, you saved my day!

Quinn

[Bug]: Importing note with colored text

enex2notion version

0.1.0

What OS are you using?

MacOS

OS Version / Linux distribution

Monterey - 12.0.1

Bug description

I am getting attached error when trying to import a note (text only, but with an enumerated list and colored text in it).
PS: many thanks for this tool! :)

Log excerpt

Traceback (most recent call last):
  File "/Users/olkido/Library/Python/3.8/bin/enex2notion", line 8, in <module>
    sys.exit(main())
  File "/Users/olkido/Library/Python/3.8/lib/python/site-packages/enex2notion/cli.py", line 100, in main
    cli(sys.argv[1:])
  File "/Users/olkido/Library/Python/3.8/lib/python/site-packages/enex2notion/cli.py", line 95, in cli
    enex_uploader.upload(enex_input)
  File "/Users/olkido/Library/Python/3.8/lib/python/site-packages/enex2notion/cli.py", line 54, in upload
    note_blocks = parse_note(note, self.add_meta)
  File "/Users/olkido/Library/Python/3.8/lib/python/site-packages/enex2notion/note_parser.py", line 19, in parse_note
    note_blocks = parse_note_dom(note_dom)
  File "/Users/olkido/Library/Python/3.8/lib/python/site-packages/enex2notion/note_parser_dom.py", line 38, in parse_note_dom
    block = _parse_block(child)
  File "/Users/olkido/Library/Python/3.8/lib/python/site-packages/enex2notion/note_parser_dom.py", line 77, in _parse_block
    return tag_parser(element)
  File "/Users/olkido/Library/Python/3.8/lib/python/site-packages/enex2notion/note_parser_elements.py", line 36, in parse_list
    nodes[-1].children.extend(parse_list(subelement))
  File "/Users/olkido/Library/Python/3.8/lib/python/site-packages/enex2notion/note_parser_elements.py", line 31, in parse_list
    li_item = _parse_list_item(subelement, is_ul)
  File "/Users/olkido/Library/Python/3.8/lib/python/site-packages/enex2notion/note_parser_elements.py", line 45, in _parse_list_item
    li_text = extract_string(list_item)
  File "/Users/olkido/Library/Python/3.8/lib/python/site-packages/enex2notion/string_extractor.py", line 18, in extract_string
    string_blocks = _extract_blocks(div_lines)
  File "/Users/olkido/Library/Python/3.8/lib/python/site-packages/enex2notion/string_extractor.py", line 39, in _extract_blocks
    string_properties = resolve_string_properties(parent_stack)
  File "/Users/olkido/Library/Python/3.8/lib/python/site-packages/enex2notion/string_extractor_properties.py", line 23, in resolve_string_properties
    tag_property = tag_map[tag.name](tag)
  File "/Users/olkido/Library/Python/3.8/lib/python/site-packages/enex2notion/string_extractor_properties.py", line 41, in _resolve_span
    color = extract_color(style)
  File "/Users/olkido/Library/Python/3.8/lib/python/site-packages/enex2notion/colors.py", line 87, in extract_color
    color = color_extract_func(match.group(1))
  File "/Users/olkido/Library/Python/3.8/lib/python/site-packages/enex2notion/colors.py", line 116, in _extract_foreground_rgb
    rbg_fg = _parse_rgb(rgb_str)
  File "/Users/olkido/Library/Python/3.8/lib/python/site-packages/enex2notion/colors.py", line 134, in _parse_rgb
    color_str = re.match("^#(.*?)$", color).group(1)
AttributeError: 'NoneType' object has no attribute 'group'

[Bug]: Import issue

enex2notion version

0.2.24

What OS are you using?

MacOS

OS Version / Linux distribution

12.5.1

Bug description

Hi thank you for this amazing tool.

I have had trouble running it on several enex.files even though the verbose mode did run through any issues.

Here is the error message obtained :

Echography eyamga$ enex2notion --token xxxx Dermatology_2.enex
Traceback (most recent call last):
File "/usr/local/bin/enex2notion", line 8, in
sys.exit(main())
File "/usr/local/Cellar/enex2notion/0.2.24/libexec/lib/python3.10/site-packages/enex2notion/cli.py", line 47, in main
cli(sys.argv[1:])
File "/usr/local/Cellar/enex2notion/0.2.24/libexec/lib/python3.10/site-packages/enex2notion/cli.py", line 26, in cli
root = get_root(args.token, args.root_page)
File "/usr/local/Cellar/enex2notion/0.2.24/libexec/lib/python3.10/site-packages/enex2notion/cli_notion.py", line 21, in get_root
client = get_notion_client(token)
File "/usr/local/Cellar/enex2notion/0.2.24/libexec/lib/python3.10/site-packages/enex2notion/cli_notion.py", line 31, in get_notion_client
return NotionClient(token_v2=token)
File "/usr/local/Cellar/enex2notion/0.2.24/libexec/lib/python3.10/site-packages/notion/client.py", line 113, in init
self._update_user_info()
File "/usr/local/Cellar/enex2notion/0.2.24/libexec/lib/python3.10/site-packages/notion/client.py", line 145, in _update_user_info
if not records["space"]:
KeyError: 'space'

Log excerpt

eric:Derm eyamga$ enex2notion --verbose Dermatology_2.enex
WARNING: No token provided, dry run mode. Nothing will be uploaded to Notion!
INFO: Processing notebook 'Dermatology_2'...
DEBUG: Parsing note '* DDx Ulcères/Érosions'
DEBUG: Parsing note '* Maladies bulleuses auto-immunes (généralités)'
DEBUG: Parsing note '* Maladies bulleuses auto-immunes (résumé : pemphigoid vs pemphigus)'
DEBUG: Parsing note '**other'
DEBUG: Parsing note '*Investigations et interventions dermatologiques'
DEBUG: Parsing note '*Lésions cutanées malignes'
DEBUG: Parsing note '*Lupus cutané'
DEBUG: Parsing note '*Management de conditions cutanées classiques'
DEBUG: Parsing note 'Acné (en bref)'
DEBUG: Parsing note 'Allergie et dermato'
DEBUG: Parsing note 'Alopécie'
DEBUG: Parsing note 'Anti-TNF et Effets Cutanés'
DEBUG: Parsing note 'Biopsie cutanée (techniques)'
DEBUG: Parsing note 'Cortico Topique - Explication (MDQc)'
DEBUG: Parsing note 'Cortico Topique - Tableau'
DEBUG: Parsing note 'Cortico Topique (Go To)'
DEBUG: Parsing note 'DDx - Lésions orales'
DEBUG: Parsing note 'DDx - Pathologies dermatologiques (sélectionnées)'
DEBUG: Parsing note 'DDx - Pathologies dermatologiques (selon présentation)'
DEBUG: Parsing note 'DDx - Pathologies dermatologiques-like (selon présentation)'
DEBUG: Parsing note 'Dermato Key Images = Facial Rash'
DEBUG: Parsing note 'Lésions atypiques - Dermatologie'
DEBUG: Parsing note 'Lésions cutanées - Classification dermatologique'
DEBUG: Parsing note 'Lésions cutanées bénignes'
DEBUG: Parsing note 'Management conditions classiques (guide dermato - Shebrooke)'
DEBUG: Parsing note 'Management des conditions classiques (algorithmes)'
DEBUG: Parsing note 'Nomenclature dermatologique'
DEBUG: Parsing note 'Nomenclature dermatologique - examen physique'
DEBUG: Parsing note 'Prurit'
DEBUG: Parsing note 'SCAR & Rash Médicamenteux'

[Bug]: Can not use enex2notion command.

enex2notion version

0.2.15

What OS are you using?

MacOS

OS Version / Linux distribution

macOS 10.15.7,

Bug description

Homebrew installed it. just run command as below, the output shows some logs as below Log excerpt part.

# error output
enex2notion --version

Installation verbose as following:

$ brew install vzhd1701/tap/enex2notion

==> Tapping vzhd1701/tap
Cloning into '/usr/local/Homebrew/Library/Taps/vzhd1701/homebrew-tap'...
remote: Enumerating objects: 104, done.
remote: Counting objects: 100% (104/104), done.
remote: Compressing objects: 100% (83/83), done.
remote: Total 104 (delta 23), reused 90 (delta 15), pack-reused 0
Receiving objects: 100% (104/104), 26.90 KiB | 612.00 KiB/s, done.
Resolving deltas: 100% (23/23), done.
Tapped 3 formulae (17 files, 58.7KB).
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/pkg-config-0.29.2_3.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/libpthread-stubs-0.4.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/xorgproto-2022.1.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/libxau-1.0.9.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/libxdmcp-1.1.3.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/libxcb-1.15.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/libx11-1.8.1.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/libxext-1.3.4.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/libxfixes-6.0.0.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/libxi-1.8.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/libxrender-0.9.10.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/libxrandr-1.5.2.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/libxxf86vm-1.1.4.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/expat-2.4.8.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/libxdamage-1.1.5.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/mesa-22.0.5.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/freeglut-3.2.2.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/mupdf-1.20.0.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://github.com/vzhd1701/homebrew-tap/releases/download/enex2notion-0.2.15/enex2notion-0.2.15.
######################################################################## 100.0%
==> Installing enex2notion from vzhd1701/tap
==> Installing dependencies for vzhd1701/tap/enex2notion: pkg-config, libpthread-stubs, xorgproto, libxau, libxdmcp, libxcb, libx11, libxext, libxfixes, libxi, libxrender, libxrandr, libxxf86vm, expat, libxdamage, mesa, freeglut and mupdf
==> Installing vzhd1701/tap/enex2notion dependency: pkg-config
==> Pouring pkg-config-0.29.2_3.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/pkg-config/0.29.2_3: 11 files, 624.0KB
==> Installing vzhd1701/tap/enex2notion dependency: libpthread-stubs
==> Pouring libpthread-stubs-0.4.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/libpthread-stubs/0.4: 5 files, 6.9KB
==> Installing vzhd1701/tap/enex2notion dependency: xorgproto
==> Pouring xorgproto-2022.1.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/xorgproto/2022.1: 264 files, 3.9MB
==> Installing vzhd1701/tap/enex2notion dependency: libxau
==> Pouring libxau-1.0.9.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/libxau/1.0.9: 20 files, 117.8KB
==> Installing vzhd1701/tap/enex2notion dependency: libxdmcp
==> Pouring libxdmcp-1.1.3.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/libxdmcp/1.1.3: 11 files, 125.4KB
==> Installing vzhd1701/tap/enex2notion dependency: libxcb
==> Pouring libxcb-1.15.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/libxcb/1.15: 2,459 files, 6.9MB
==> Installing vzhd1701/tap/enex2notion dependency: libx11
==> Pouring libx11-1.8.1.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/libx11/1.8.1: 1,055 files, 7MB
==> Installing vzhd1701/tap/enex2notion dependency: libxext
==> Pouring libxext-1.3.4.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/libxext/1.3.4: 87 files, 421KB
==> Installing vzhd1701/tap/enex2notion dependency: libxfixes
==> Pouring libxfixes-6.0.0.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/libxfixes/6.0.0: 12 files, 115.8KB
==> Installing vzhd1701/tap/enex2notion dependency: libxi
==> Pouring libxi-1.8.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/libxi/1.8: 85 files, 671KB
==> Installing vzhd1701/tap/enex2notion dependency: libxrender
==> Pouring libxrender-0.9.10.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/libxrender/0.9.10: 12 files, 170KB
==> Installing vzhd1701/tap/enex2notion dependency: libxrandr
==> Pouring libxrandr-1.5.2.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/libxrandr/1.5.2: 26 files, 205.2KB
==> Installing vzhd1701/tap/enex2notion dependency: libxxf86vm
==> Pouring libxxf86vm-1.1.4.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/libxxf86vm/1.1.4: 33 files, 119.8KB
==> Installing vzhd1701/tap/enex2notion dependency: expat
==> Pouring expat-2.4.8.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/expat/2.4.8: 21 files, 593.9KB
==> Installing vzhd1701/tap/enex2notion dependency: libxdamage
==> Pouring libxdamage-1.1.5.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/libxdamage/1.1.5: 12 files, 81.4KB
==> Installing vzhd1701/tap/enex2notion dependency: mesa
==> Pouring mesa-22.0.5.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/mesa/22.0.5: 36 files, 11.7MB
==> Installing vzhd1701/tap/enex2notion dependency: freeglut
==> Pouring freeglut-3.2.2.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/freeglut/3.2.2: 20 files, 988.2KB
==> Installing vzhd1701/tap/enex2notion dependency: mupdf
==> Pouring mupdf-1.20.0.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/mupdf/1.20.0: 129 files, 48.8MB
==> Installing vzhd1701/tap/enex2notion
==> Pouring enex2notion-0.2.15.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/enex2notion/0.2.15: 1,883 files, 15.4MB
==> Running `brew cleanup enex2notion`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

Log excerpt

cannot create context: incompatible header (1.19.0) and library (1.20.0) versions
Traceback (most recent call last):
  File "/usr/local/bin/enex2notion", line 5, in <module>
    from enex2notion.cli import main
  File "/usr/local/Cellar/enex2notion/0.2.15/libexec/lib/python3.10/site-packages/enex2notion/cli.py", line 9, in <module>
    from enex2notion.cli_upload import EnexUploader
  File "/usr/local/Cellar/enex2notion/0.2.15/libexec/lib/python3.10/site-packages/enex2notion/cli_upload.py", line 9, in <module>
    from enex2notion.note_parser.note import parse_note
  File "/usr/local/Cellar/enex2notion/0.2.15/libexec/lib/python3.10/site-packages/enex2notion/note_parser/note.py", line 12, in <module>
    from enex2notion.note_parser.note_type_based import parse_note_blocks_based_on_type
  File "/usr/local/Cellar/enex2notion/0.2.15/libexec/lib/python3.10/site-packages/enex2notion/note_parser/note_type_based.py", line 8, in <module>
    from enex2notion.note_parser.webclip_pdf import parse_webclip_to_pdf
  File "/usr/local/Cellar/enex2notion/0.2.15/libexec/lib/python3.10/site-packages/enex2notion/note_parser/webclip_pdf.py", line 6, in <module>
    import fitz
  File "/usr/local/Cellar/enex2notion/0.2.15/libexec/lib/python3.10/site-packages/fitz/__init__.py", line 10, in <module>
    from fitz.fitz import *
  File "/usr/local/Cellar/enex2notion/0.2.15/libexec/lib/python3.10/site-packages/fitz/fitz.py", line 15, in <module>
    from . import _fitz
RuntimeError: Fatal error: cannot create global context.

[Bug]: TypeError: %o format: an integer is required, not Bar

enex2notion version

0.1.2

What OS are you using?

MacOS

OS Version / Linux distribution

12.0.1

Bug description

Got this error when importing a note.

Example ENEX file to debug:
Debug.enex.zip

Log excerpt

INFO: 'Evernote ENEX Import' page found
INFO: Processing notebook 'Debug'...
DEBUG: Parsing note 'xxxxxxxxxxxxxxxxxxxx'...
WARNING: Non-empty string element in root
INFO: Creating new page for note 'xxxxxxxxxxxxxxxxxxxx'
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/bin/enex2notion", line 8, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/cli.py", line 100, in main
    cli(sys.argv[1:])
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/cli.py", line 95, in cli
    enex_uploader.upload(enex_input)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/cli.py", line 59, in upload
    upload_note(notebook_root, note, note_blocks)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/enex_uploader.py", line 23, in upload_note
    for block in Bar(f"Uploading '{note.title}'").iter(note_blocks):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/progress/__init__.py", line 184, in iter
    with self:
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/progress/__init__.py", line 136, in __enter__
    self.start()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/progress/__init__.py", line 171, in start
    self.update()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/progress/bar.py", line 38, in update
    message = self.message % self
TypeError: %o format: an integer is required, not Bar

[Bug]: ERROR: Got 400 error attempting to POST to submitTransaction, with data

enex2notion version

0.2.24

What OS are you using?

MacOS

OS Version / Linux distribution

MacOS 12.4

Bug description

when I import enex 2 notion, meet "ERROR: Got 400 error attempting to POST to submitTransaction, with data"
using evernote-backup to export yinxiang.
have try:
evernote-backup export output_dir2
evernote-backup export --single-notes output_dir2

meet the same problem.

Log excerpt

INFO: 'Evernote ENEX Import' page found
INFO: Processing directory 'output_dir2'...
INFO: Processing notebook '001 ulimit.html'...
DEBUG: Parsing note '001 ulimit.html'
DEBUG: Unknown block: a, parsing as text
INFO: Uploading note 1 out of 1 '001 ulimit.html'
DEBUG: Creating new page for note '001 ulimit.html'
ERROR: Got 400 error attempting to POST to submitTransaction, with data: {
  "operations": [
    {
      "id": "294e6fc0-37b7-4ab3-8611-9a0effb70b44",
      "path": [],
      "args": {
        "id": "294e6fc0-37b7-4ab3-8611-9a0effb70b44",
        "version": 1,
        "alive": true,
        "created_by_id": "d6bc1550-f147-4138-88ad-f98a07421c7a",
        "created_by_table": "notion_user",
        "created_time": 1670300792858,
        "parent_id": "e5f23e47-e701-4468-a4bd-5917201dd8c6",
        "parent_table": "collection",
        "type": "page"
      },
      "command": "set",
      "table": "block"
    },
    {
      "args": {
        "last_edited_by_id": "d6bc1550-f147-4138-88ad-f98a07421c7a",
        "last_edited_by_table": "notion_user",
        "last_edited_time": 1670300792858
      },
      "command": "update",
      "id": "294e6fc0-37b7-4ab3-8611-9a0effb70b44",
      "path": [],
      "table": "block"
    },
    {
      "args": {
        "last_edited_by_id": "d6bc1550-f147-4138-88ad-f98a07421c7a",
        "last_edited_by_table": "notion_user",
        "last_edited_time": 1670300792858
      },
      "command": "update",
      "id": "294e6fc0-37b7-4ab3-8611-9a0effb70b44",
      "path": [],
      "table": "block"
    }
  ]
}
Traceback (most recent call last):
  File "/Users/houjunwei/.local/bin/enex2notion", line 8, in <module>
    sys.exit(main())
  File "/Users/houjunwei/.local/lib/python3.8/site-packages/enex2notion/cli.py", line 47, in main
    cli(sys.argv[1:])
  File "/Users/houjunwei/.local/lib/python3.8/site-packages/enex2notion/cli.py", line 32, in cli
    _process_input(enex_uploader, args.enex_input)
  File "/Users/houjunwei/.local/lib/python3.8/site-packages/enex2notion/cli.py", line 40, in _process_input
    enex_uploader.upload_notebook(enex_file)
  File "/Users/houjunwei/.local/lib/python3.8/site-packages/enex2notion/cli_upload.py", line 56, in upload_notebook
    self.upload_note(note, note_idx)
  File "/Users/houjunwei/.local/lib/python3.8/site-packages/enex2notion/cli_upload.py", line 79, in upload_note
    _upload_note(self.notebook_root, note, note_blocks)
  File "/Users/houjunwei/.local/lib/python3.8/site-packages/enex2notion/cli_upload.py", line 103, in _upload_note
    upload_note(notebook_root, note, note_blocks)
  File "/Users/houjunwei/.local/lib/python3.8/site-packages/enex2notion/enex_uploader.py", line 20, in upload_note
    new_page = _make_page(note, root)
  File "/Users/houjunwei/.local/lib/python3.8/site-packages/enex2notion/enex_uploader.py", line 59, in _make_page
    root.collection.add_row(
  File "/Users/houjunwei/.local/lib/python3.8/site-packages/notion/collection.py", line 202, in add_row
    return self.add_row_block(columns=columns)
  File "/Users/houjunwei/.local/lib/python3.8/site-packages/notion/collection.py", line 213, in add_row_block
    row_id = self._client.create_record("block", self, type="page")
  File "/Users/houjunwei/.local/lib/python3.8/site-packages/notion/client.py", line 427, in create_record
    self.submit_transaction(
  File "/Users/houjunwei/.local/lib/python3.8/site-packages/notion/client.py", line 468, in __exit__
    self.client.submit_transaction(operations)
  File "/Users/houjunwei/.local/lib/python3.8/site-packages/notion/client.py", line 323, in submit_transaction
    self.post("submitTransaction", data)
  File "/Users/houjunwei/.local/lib/python3.8/site-packages/ratelimit/decorators.py", line 113, in wrapper
    return func(*args, **kargs)
  File "/Users/houjunwei/.local/lib/python3.8/site-packages/ratelimit/decorators.py", line 80, in wrapper
    return func(*args, **kargs)
  File "/Users/houjunwei/.local/lib/python3.8/site-packages/notion/client.py", line 275, in post
    return self._post(endpoint, data)
  File "/Users/houjunwei/.local/lib/python3.8/site-packages/notion/client.py", line 290, in _post
    raise HTTPError(
requests.exceptions.HTTPError: Unsaved transactions: SpaceShardRecordPointer have no space id

[Bug]: KeyError: '#text'

enex2notion version

0.1.3

What OS are you using?

MacOS

OS Version / Linux distribution

12.0.1

Bug description

Did a very large import.

Tried debugging the last note after which it failed. Could not reproduce.

What went wrong? And how can I resume from where it crashed without adding duplicates?

Log excerpt

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/bin/enex2notion", line 8, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/cli.py", line 100, in main
    cli(sys.argv[1:])
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/cli.py", line 93, in cli
    enex_uploader.upload(enex_file)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/cli.py", line 49, in upload
    for note in iter_notes(enex_file):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/enex_parser.py", line 71, in iter_notes
    yield _process_note(_etree_to_dict(elem)["note"])
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/enex_parser.py", line 115, in _process_note
    resources = [_convert_resource(r) for r in note_resources]
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/enex_parser.py", line 115, in <listcomp>
    resources = [_convert_resource(r) for r in note_resources]
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/enex2notion/enex_parser.py", line 140, in _convert_resource
    data_bin = base64.b64decode(resource_raw["data"]["#text"])
KeyError: '#text'

[Feature request]: can not import chinese “印象笔记” 's notes(*.notes)

Suggestion

Hello,

I am using chinese evernote(a.k.a "印象笔记"), and now it's exported notes(*.notes) is different from evernote's enex.

Is there any way to migrate *.notes to notion?

PS: when i rename the ".notes" to ".enex" and use the migrate tool, it has encountered an error:

Mac M1 Chipset, MACOS 12.4
Python 3.9.13
enex2notion: 0.2.16

INFO: 'Evernote ENEX Import' page found
INFO: Processing notebook 'note'...
Traceback (most recent call last):
File "/opt/homebrew/bin/enex2notion", line 8, in
sys.exit(main())
File "/opt/homebrew/Cellar/enex2notion/0.2.16/libexec/lib/python3.10/site-packages/enex2notion/cli.py", line 47, in main
cli(sys.argv[1:])
File "/opt/homebrew/Cellar/enex2notion/0.2.16/libexec/lib/python3.10/site-packages/enex2notion/cli.py", line 32, in cli
_process_input(enex_uploader, args.enex_input)
File "/opt/homebrew/Cellar/enex2notion/0.2.16/libexec/lib/python3.10/site-packages/enex2notion/cli.py", line 42, in _process_input
enex_uploader.upload_notebook(path)
File "/opt/homebrew/Cellar/enex2notion/0.2.16/libexec/lib/python3.10/site-packages/enex2notion/cli_upload.py", line 55, in upload_notebook
for note_idx, note in enumerate(iter_notes(enex_file), 1):
File "/opt/homebrew/Cellar/enex2notion/0.2.16/libexec/lib/python3.10/site-packages/enex2notion/enex_parser.py", line 27, in iter_notes
yield from (_process_note(e) for e in iter_xml_elements_as_dict(enex_file, "note"))
File "/opt/homebrew/Cellar/enex2notion/0.2.16/libexec/lib/python3.10/site-packages/enex2notion/enex_parser.py", line 27, in
yield from (_process_note(e) for e in iter_xml_elements_as_dict(enex_file, "note"))
File "/opt/homebrew/Cellar/enex2notion/0.2.16/libexec/lib/python3.10/site-packages/enex2notion/enex_parser.py", line 52, in _process_note
is_webclip=_is_webclip(note_raw),
File "/opt/homebrew/Cellar/enex2notion/0.2.16/libexec/lib/python3.10/site-packages/enex2notion/enex_parser.py", line 75, in _is_webclip
re.search(
File "/opt/homebrew/Cellar/[email protected]/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/re.py", line 200, in search
return _compile(pattern, flags).search(string)
TypeError: expected string or bytes-like object

Thanks,
Howie

[Bug]: ImportError when running

enex2notion version

0.2.17

What OS are you using?

MacOS

OS Version / Linux distribution

macOS BigSur(11.6.7), Intel

Bug description

Hi @vzhd1701 !
Thanks for developing the amazing tool.

I have installed enex2notion with Homebrew, but when I run it, I get the following error.

I think this is not an issue with enex2notion, but I want some help, so I opened this issue.
If you can think of a solution, please tell me.

Log excerpt

% enex2notion --verbose
Traceback (most recent call last):
  File "/usr/local/bin/enex2notion", line 5, in <module>
    from enex2notion.cli import main
  File "/usr/local/Cellar/enex2notion/0.2.17/libexec/lib/python3.10/site-packages/enex2notion/cli.py", line 9, in <module>
    from enex2notion.cli_upload import EnexUploader
  File "/usr/local/Cellar/enex2notion/0.2.17/libexec/lib/python3.10/site-packages/enex2notion/cli_upload.py", line 9, in <module>
    from enex2notion.note_parser.note import parse_note
  File "/usr/local/Cellar/enex2notion/0.2.17/libexec/lib/python3.10/site-packages/enex2notion/note_parser/note.py", line 12, in <module>
    from enex2notion.note_parser.note_type_based import parse_note_blocks_based_on_type
  File "/usr/local/Cellar/enex2notion/0.2.17/libexec/lib/python3.10/site-packages/enex2notion/note_parser/note_type_based.py", line 8, in <module>
    from enex2notion.note_parser.webclip_pdf import parse_webclip_to_pdf
  File "/usr/local/Cellar/enex2notion/0.2.17/libexec/lib/python3.10/site-packages/enex2notion/note_parser/webclip_pdf.py", line 6, in <module>
    import fitz
  File "/usr/local/Cellar/enex2notion/0.2.17/libexec/lib/python3.10/site-packages/fitz/__init__.py", line 10, in <module>
    from fitz.fitz import *
  File "/usr/local/Cellar/enex2notion/0.2.17/libexec/lib/python3.10/site-packages/fitz/fitz.py", line 17, in <module>
    from . import _fitz
ImportError: dlopen(/usr/local/Cellar/enex2notion/0.2.17/libexec/lib/python3.10/site-packages/fitz/_fitz.cpython-310-darwin.so, 2): Symbol not found: _FT_Get_First_Char
  Referenced from: /usr/local/Cellar/enex2notion/0.2.17/libexec/lib/python3.10/site-packages/fitz/_fitz.cpython-310-darwin.so
  Expected in: /usr/local/opt/mupdf/lib/libmupdf.dylib
 in /usr/local/Cellar/enex2notion/0.2.17/libexec/lib/python3.10/site-packages/fitz/_fitz.cpython-310-darwin.so

[Bug]: Failed to upload note (webclip)

enex2notion version

0.2.25

What OS are you using?

MacOS

OS Version / Linux distribution

10

Bug description

I am uploading 1,000+ webclips and all is going well until I reach 752, when I get this message in the log below.

Any ideas as to what went wrong? It seems the clip may have been too large, but not sure how. How should I continue the process and skip this file, without restarting again?

Many thanks in advance!

Log excerpt

INFO: Uploading note 750 out of 1086 'Element 2'                                
INFO: Uploading note 751 out of 1086 'alectro.io | Elegant and verifiable emissions insight for positive businesses.'
INFO: Uploading note 752 out of 1086 'Watr - The Smart Water Monitor'           
WARNING: Failed to upload note 'Watr - The Smart Water Monitor' to Notion! Retrying...
WARNING: Failed to upload note 'Watr - The Smart Water Monitor' to Notion! Retrying...
WARNING: Failed to upload note 'Watr - The Smart Water Monitor' to Notion! Retrying...
WARNING: Failed to upload note 'Watr - The Smart Water Monitor' to Notion! Retrying...
Traceback (most recent call last):                                              
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/enex2notion/enex_uploader.py", line 28, in upload_note
    upload_block(new_page, block)
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/enex2notion/enex_uploader_block.py", line 10, in upload_block
    new_block = root.children.add_new(block.type, **block.attrs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/notion/block.py", line 136, in add_new
    with self._client.as_atomic_transaction():
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/notion/client.py", line 469, in __exit__
    self.client.submit_transaction(operations)
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/notion/client.py", line 323, in submit_transaction
    self.post("submitTransaction", data)
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/ratelimit/decorators.py", line 113, in wrapper
    return func(*args, **kargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/ratelimit/decorators.py", line 80, in wrapper
    return func(*args, **kargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/notion/client.py", line 275, in post
    return self._post(endpoint, data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/notion/client.py", line 298, in _post
    response.raise_for_status()
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 413 Client Error: Payload Too Large for url: https://www.notion.so/api/v3/submitTransaction

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/enex2notion", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/enex2notion/cli.py", line 47, in main
    cli(sys.argv[1:])
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/enex2notion/cli.py", line 32, in cli
    _process_input(enex_uploader, args.enex_input)
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/enex2notion/cli.py", line 42, in _process_input
    enex_uploader.upload_notebook(path)
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/enex2notion/cli_upload.py", line 56, in upload_notebook
    self.upload_note(note, note_idx)
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/enex2notion/cli_upload.py", line 79, in upload_note
    _upload_note(self.notebook_root, note, note_blocks)
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/enex2notion/cli_upload.py", line 103, in _upload_note
    upload_note(notebook_root, note, note_blocks)
  File "/usr/local/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/enex2notion/enex_uploader.py", line 35, in upload_note
    raise NoteUploadFailException
enex2notion.utils_exceptions.NoteUploadFailException

[Bug]: Failed to resolve resource

enex2notion version

0.2.21

What OS are you using?

Windows

OS Version / Linux distribution

Windows 11

Bug description

First, thanks so much for this utility!

I ran the Notion import against a test Notebook of 50 notes which have a combination of webclips and pdf attachments. Of the 50, only 14 uploaded. Running in verbose mode, I find that all of the rest have the message "Failed to Resolve Resource in 'notename' "

These notes are quite old, from 2014, and I notice that all the failed ones have attached files with Untitled Attachment as the title in the EN titlebar. Is this possibly what's causing the errors? If so, do you know any way to resolve this?

Thanks!

Log excerpt

Parsing note 'Pedals for Progress Contrib'
DEBUG: Failed to resolve resource in 'Pedals for Progress Contrib'
DEBUG: Skipping note 'Pedals for Progress Contrib' (no blocks)
DEBUG: Parsing note 'AWJS Contribution'
DEBUG: Failed to resolve resource in 'AWJS Contribution'
DEBUG: Skipping note 'AWJS Contribution' (no blocks)
DEBUG: Parsing note 'Bend The Arc Contribution'
DEBUG: Failed to resolve resource in 'Bend The Arc Contribution'
DEBUG: Skipping note 'Bend The Arc Contribution' (no blocks)
DEBUG: Parsing note 'Receipt Just Vision Inc - [email protected] - Gmail'
DEBUG: Parsing note 'Verizon 1099 DIV'
DEBUG: Failed to resolve resource in 'Verizon 1099 DIV'
DEBUG: Skipping note 'Verizon 1099 DIV' (no blocks)
DEBUG: Parsing note 'Computer Receipt - Cyber Knight Computers'
DEBUG: Failed to resolve resource in 'Computer Receipt - Cyber Knight Computers'
DEBUG: Skipping note 'Computer Receipt - Cyber Knight Computers' (no blocks)
DEBUG: Parsing note 'Donation Confirmation - Heifer International - [email protected] - Gmail'
DEBUG: Parsing note 'Shame by JDB'
DEBUG: Failed to resolve resource in 'Shame by JDB'

[Bug]: Crash on application/x-msdownload (.exe) and application/octet-stream (.js) attachments, because .exe and .js upload not allowed

enex2notion version

0.2.5

What OS are you using?

MacOS

OS Version / Linux distribution

MacOS 12.2

Bug description

It seems application/x-msdownload attachments, in this case an .exe file lead to a crash. First, the script tries to reupload the page four times, then the log in the excerpt happens.

As can be seen with
"requests.exceptions.HTTPError: Uploading .exe files is not allowed"
.exe files cannot be uploaded.

In my case I deleted the .exe attachment, exported the notebook again and then continued (thanks for the "done" file) with the same note but without .exe file. Then it went through.

EDIT: the same goes for application/octet-stream and .js . JavaScript Files as attachments in Evernote notes cannot be uploaded.

It would be cool maybe for enex2notion to cope with this without crashing? Maybe jump over the .exe file without upload? Evven if not, I just wanted to leave this here as a hint for others who have the same problem.

And I wanted to thank the creator of this tool for doing what Notion was not able to: create an amazing import tool from Evernote to Notion WHICH WORKS!

Log excerpt

WARNING: Failed to upload note 'MYNOTENAME' to Notion! Retrying...
INFO: Creating new page for note 'MYNOTENAME'
Uploading 'MYNOTENAME' |############################    | 7/8ERROR: Got 400 error attempting to POST to getUploadFileUrl, with data: {
  "bucket": "secure",
  "name": "MYFILECHANGED.exe",
  "contentType": "application/x-msdownload"
}

Traceback (most recent call last):
  File "enex2notion/enex_uploader.py", line 37, in upload_note
  File "enex2notion/note_uploader.py", line 16, in upload_block
  File "enex2notion/note_uploader.py", line 30, in _upload_file
  File "notion/client.py", line 260, in post
requests.exceptions.HTTPError: Uploading .exe files is not allowed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "enex2notion/__main__.py", line 4, in <module>
  File "enex2notion/cli.py", line 152, in main
  File "enex2notion/cli.py", line 147, in cli
  File "enex2notion/cli.py", line 89, in upload
  File "enex2notion/cli.py", line 46, in _upload_note
  File "enex2notion/enex_uploader.py", line 43, in upload_note
enex2notion.enex_uploader.NoteUploadFailException
[70053] Failed to execute script '__main__' due to unhandled exception!

[Bug]: Failed to upload note

enex2notion version

0.2.13

What OS are you using?

Windows

OS Version / Linux distribution

Windows 11

Bug description

The tool suddenly stopped working. Yesterday I successfully uploaded a few notebooks. Today I wanted to continue but it isn't able to upload the data. The "Evernote ENEX Import" page and the page for the notebook is created, but then the programm fails with the attatched logs.

Thanks for developing this amazing tool :smil

Log excerpt

INFO: Creating 'Evernote ENEX Import' page...
INFO: Processing directory 'evernote'...
INFO: Processing notebook 'Notebook'...
INFO: Uploading note 1 out of 10 'Note'
DEBUG: Creating new page for note 'Note'
WARNING: Failed to upload note 'Note' to Notion! Retrying...
DEBUG: Creating new page for note 'Note'
WARNING: Failed to upload note 'Note' to Notion! Retrying...
DEBUG: Creating new page for note 'Note'
WARNING: Failed to upload note 'Note' to Notion! Retrying...
DEBUG: Creating new page for note 'Note'

[Feature request]: Migrate To-do lists

Suggestion

Evernote supports the use of checkboxes to make lists of todos.
Notion also supports this as To-do list blocks

These are migrated as text blocks right now, and lose the [] checkbox in front of them.

Would it be possible to recreate todo checkboxes from Evernote as To-do list blocks in Notion?

[Bug]: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

enex2notion version

0.2.25

What OS are you using?

MacOS

OS Version / Linux distribution

13.2.1 (22D68) Ventura

Bug description

I used evernote-backup to export my notes(Chinese Evernote 印象笔记) with *.enex files, but I
failed to run command enex2notion --done-file ./done.txt --token xxx-xxx ./ 2>&1 |tee log.txt,
got jsonParseException,

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/bin/enex2notion", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/homebrew/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/enex2notion/cli.py", line 47, in main
    cli(sys.argv[1:])
  File "/opt/homebrew/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/enex2notion/cli.py", line 26, in cli
    root = get_root(args.token, args.root_page)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/enex2notion/cli_notion.py", line 21, in get_root
    client = get_notion_client(token)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/enex2notion/cli_notion.py", line 31, in get_notion_client
    return NotionClient(token_v2=token)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/notion/client.py", line 113, in __init__
    self._update_user_info()
  File "/opt/homebrew/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/notion/client.py", line 144, in _update_user_info
    records = self.post("loadUserContent", {}).json()["recordMap"]
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Log excerpt

DEBUG: Parsing note 'open-03(for youdao 12)'
DEBUG: Parsing note 'open-03(for youdao 13)'
DEBUG: Parsing note 'open-03(for youdao 14)'
DEBUG: Parsing note 'open-03(for youdao 15)'
DEBUG: Parsing note 'open-03(for youdao 16)'
DEBUG: Parsing note '01'
DEBUG: Parsing note 'liulishuo1'
DEBUG: Parsing note 'liulishuo1'
DEBUG: Parsing note 'liulishuo2'
INFO: Processing notebook 'learning'...
DEBUG: Parsing note 'Untitled'
ERROR: Failed to parse note 'Untitled'
DEBUG: list index out of range
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/enex2notion/cli_upload.py", line 84, in _parse_note
    return parse_note(note, self.rules)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/enex2notion/note_parser/note.py", line 18, in parse_note
    note_dom = _parse_note_dom(note)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/enex2notion/note_parser/note.py", line 47, in _parse_note_dom
    return _filter_yinxiang_markdown(note_dom)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/enex2notion/0.2.25/libexec/lib/python3.11/site-packages/enex2notion/note_parser/note.py", line 51, in _filter_yinxiang_markdown
    last_block = note_dom.contents[-1]
                 ~~~~~~~~~~~~~~~~~^^^^
IndexError: list index out of range
DEBUG: Skipping note 'Untitled' (no blocks)
DEBUG: Parsing note 'Conda'
DEBUG: Parsing note 'Mlflow'
DEBUG: Parsing note '由于'
DEBUG: Parsing note 'Untitled'
DEBUG: Parsing note 'Wiki Page & tickets'

some of them have Chinese folder names, and --verbose will get
IndexError: list index out of range

could you please help to check it? thanks

[Bug]: .HTTPError: 403

enex2notion version

0.2.25

What OS are you using?

Windows

OS Version / Linux distribution

Windows 10

Bug description

requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://www.notion.so/api/v3/loadUserContent
[3564] Failed to execute script 'main' due to unhandled exception!

Log excerpt

No response

最新迁移工具, 功能强大,免费使用

Suggestion

一个更简单的迁移工具:

https://github.com/selfboot/html2notion

现在印象笔记也不再支持导出 *.enex 格式的文件了,这个脚本暂时用不了。
不过好在印象笔记支持导出 html 格式笔记,所以重新开发了一个工具 htmlnotion,可以方便,快速,近乎完美的迁移笔记道notion。

目前对于印象笔记普通笔记和超级笔记里的绝大部份格式,比如表格,复选框,代码,引用,颜色,链接等内容,都支持无损迁到notion 笔记本。

中间某篇导入失败也不会影响其他笔记;错误会有详细的提示,可以在 https://github.com/selfboot/html2notion 提issue ;

image

[Bug]: No imported pages in Notion

enex2notion version

0.2.26

What OS are you using?

MacOS

OS Version / Linux distribution

Mac OS 13.2.1

Bug description

I successful run the import command,

image

but, I don't find the import page (Evernote ENEX Import) in the notion and don't find the imported data.
image

Log excerpt

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.