Open techyogi opened 2 years ago
Indeed, the code was designed to work with some specific page with all nested content inside the page. Need to add the option for exporting the whole workspace.
Hello ! Kind of a similar problem here : I tryied to pull a regular page (no subpage, no database) But I'm also getting a "KeyError'
2022-06-21 19:13:06,788 INFO: š¤ Started structuring notion data
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/opt/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/runner/work/notionexport/notionexport/notion4ever/main.py", line 109, in
I Guess the culprit is quite obvious here : THE EMOJI ! I had a custom emoji on the page (Added by using the Upload/Link function from notion emoji), and now it run fine ! ;)
Dear MerkuloDanii, First of all, thank for this nice project! I also have a KeyError. Have you allready found a way to export the whole workspace, without heving to specify a Page_id? Thanks!
The same issue found here:
2022-12-21 07:[11](https://github.com/KiraCore/docs.kira.network/actions/runs/3747180944/jobs/6363161943#step:9:12):17,725 INFO: š¤ Notion authentification completed successfully.
2022-[12](https://github.com/KiraCore/docs.kira.network/actions/runs/3747180944/jobs/6363161943#step:9:13)-21 07:11:17,725 INFO: š¤ Started raw notion content parsing.
2022-12-21 07:11:18,468 INFO: š¤ Downloaded raw notion content. Saved at ./notion_content.json
2022-12-21 07:11:18,468 INFO: š¤ Started structuring notion data
Traceback (most recent call last):
File "/__t/Python/3.10.0/x64/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/__t/Python/3.10.0/x64/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/__w/docs.kira.network/docs.kira.network/notion4ever/__main__.py", line 109, in <module>
main()
File "/__w/docs.kira.network/docs.kira.network/notion4ever/__main__.py", line 81, in main
structured_notion = structuring.structurize_notion_content(raw_notion,
File "/__w/docs.kira.network/docs.kira.network/notion4ever/structuring.py", line 489, in structurize_notion_content
structured_notion["pages"] = parse_headers(raw_notion)
File "/__w/docs.kira.network/docs.kira.network/notion4ever/structuring.py", line [16](https://github.com/KiraCore/docs.kira.network/actions/runs/3747180944/jobs/6363161943#step:9:17)3, in parse_headers
notion_pages[parent_id]["children"].append(page_id)
KeyError: 'b6[17](https://github.com/KiraCore/docs.kira.network/actions/runs/3747180944/jobs/6363161943#step:9:18)XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXSANITIZEDXXXXXXXXXXXXX'
trying to pull an entire workspace, so using the pageid of the workspace page. Always getting "KeyError" as follows:
2022-02-04 09:29:32,033 INFO: š¤ Notion authentification completed successfully. 2022-02-04 09:29:32,034 INFO: š¤ Started raw notion content parsing. 2022-02-04 09:29:38,845 INFO: š¤ Downloaded raw notion content. Saved at ./notion_content.json 2022-02-04 09:29:38,845 INFO: š¤ Started structuring notion data Traceback (most recent call last): File "/opt/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/opt/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/techyogi/Desktop/notion4ever/notion4ever/main.py", line 102, in
main()
File "/Users/techyogi/Desktop/notion4ever/notion4ever/main.py", line 74, in main
structured_notion = structuring.structurize_notion_content(raw_notion,
File "/Users/techyogi/Desktop/notion4ever/notion4ever/structuring.py", line 495, in structurize_notion_content
markdown_parser.parse_markdown(raw_notion, structured_notion)
File "/Users/techyogi/Desktop/notion4ever/notion4ever/markdown_parser.py", line 372, in parse_markdown
page_md = blocks_convertor(raw_notion[page_id]["blocks"], structured_notion, page_id)
File "/Users/techyogi/Desktop/notion4ever/notion4ever/markdown_parser.py", line 139, in blocks_convertor
block_md = block_convertor(block,0, structured_notion, page_id)
File "/Users/techyogi/Desktop/notion4ever/notion4ever/markdown_parser.py", line 238, in block_convertor
block_md = block_convertor(block, depth, structured_notion, page_id)
File "/Users/techyogi/Desktop/notion4ever/notion4ever/markdown_parser.py", line 238, in block_convertor
block_md = block_convertor(block, depth, structured_notion, page_id)
File "/Users/techyogi/Desktop/notion4ever/notion4ever/markdown_parser.py", line 188, in block_convertor
title = structured_notion['pages'][block['id']]['title']
KeyError: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'