Package: enex2notion
enex2notionEasy way to importEvernote's*.enexfiles toNotion.soNotion's native Evernote importer doesn't do it for me, so I decided to write my own. Thanks toCobertosandmd2notionfor inspiration andJamie Alexandrefornotion-py.You can either use Evernote native export or try out my other tool,evernote-backup, to export*.enexfiles from Evernote.What is preservedEmbedded files and images are uploaded to Notionnested images will appear after paragraphText formatting (bold,italic, etc) and colorsTables are converted to the new format (no colspans though)Web Clipsas plain text or PDFs, seebelowEverything else basicallyWhat is lostParagraph alignmentSubscript and superscript formattingCustom fonts and font sizesTasksEncrypted blocksjust decrypt them before exportInstallationIf you are not familiar with command line programs, take a look at these step-by-step guides:Step-by-step guide for WindowsStep-by-step guide for macOSUsing portable binaryDownload the latest binary releasefor your OS.WithHomebrew(Recommended for macOS)$brewinstallenex2notionWithPIPX(Recommended for Linux & Windows)$pipxinstallenex2notionWithDockerThis command maps current directory$PWDto the/inputdirectory in the container. You can replace$PWDwith a directory that contains your*.enexfiles. When running commands likeenex2notion /inputrefer to your local mapped directory as/input.$dockerrun--rm-t-v"$PWD":/inputvzhd1701/enex2notion:latestWith PIP$pipinstall--userenex2notionPython 3.8 or later required.From sourceThis project usespoetryfor dependency management and packaging. You will have to install it first. Seepoetry official documentationfor instructions.$gitclonehttps://github.com/vzhd1701/enex2notion.git
$cdenex2notion/
$poetryinstall
$poetryrunenex2notionUsage$enex2notion--help
usage:enex2notion[-h][--tokenTOKEN][OPTION...]FILE/DIR[FILE/DIR...]UploadsENEXfilestoNotion

positionalarguments:FILE/DIRENEXfilesordirectoriestoupload

optionalarguments:-h,--helpshowthishelpmessageandexit--tokenTOKENNotiontoken,storedintoken_v2cookiefornotion.so[NEEDEDFORUPLOAD]--root-pageNAMErootpagenamefortheimportednotebooks,itwillbecreatedifitdoesnotexist(default:"Evernote ENEX Import")--mode{DB,PAGE}uploadeachENEXasdatabase(DB)orpagewithchildren(PAGE)(default:DB)--mode-webclips{TXT,PDF}convertwebclipstotext(TXT)orpdf(PDF)beforeupload(default:TXT)--retryNretryNtimesonnoteuploaderrorbeforegivingup,0forinfiniteretries(default:5)--skip-failedskipnotesthatfailedtoupload(afterexhausting--retryattempts),bydefaulttheprogramwillcrashonuploaderror--keep-failedkeeppartialpagesatNotionwith'[UNFINISHED UPLOAD]'intitleiftheyfailtouploadcompletely,bydefaulttheprogramwilltrytodeletethemonuploadfail--add-pdf-previewincludepreviewimagewithPDFwebclipsforgalleryviewthumbnail(worksonlywith--mode-webclips=PDF)--add-metaincludemetadata(created,tags,etc)innotes,makessenseonlywithPAGEmode--tagTAGaddcustomtagtouploadednotes--condense-linescondensetextlinestogetherintoparagraphstoavoidmakingblockperline--condense-lines-sparselike--condense-linesbutleavesgapsbetweenparagraphs--done-fileFILEfileforuploadednoteshashestoresumeinterruptedupload--logFILEfiletostoreprogramlog--verboseoutputdebuginformation--versionshowprogram'sversionnumberandexitInputYou can pass single*.enexfiles or directories. The program will recursively scan directories for*.enexfiles.Token & dry run modeThe upload requires you to have atoken_v2cookie for the Notion website. For information on how to get it, seethis article.The program can run without--tokenprovided though. It will not make any network requests without it. Executing a dry run with--verboseis an excellent way to check if your*.enexfiles are parsed correctly before uploading.Upload continuationThe upload will take some time since each note is uploaded block-by-block, so you'll probably need some way of resuming it.--done-fileis precisely for that. All uploaded note hashes will be stored there, so the next time you start, the upload will continue from where you left off.All uploaded notebooks will appear under the automatically createdEvernote ENEX Importpage. You can change that name with the--root-pageoption. The program will mark unfinished notes with[UNFINISHED UPLOAD]text in the title. After successful upload, the mark will be removed.Upload modesThe--modeoption allows you to choose how to upload your notebooks: as databases or pages.DBmode is the default since Notion itself uses this mode when importing from Evernote.PAGEmode makes the tree feel like the original Evernote notebooks hierarchy.SincePAGEmode does not benefit from having separate space for metadata, you can still preserve the note's original meta with the--add-metaoption. It will attach a callout block with all meta info as a first block in each notelike this.Web ClipsDue to Notion's limitations Evernote web clips cannot be uploaded as-is.enex2notionprovides two modes with the--mode-webclipsoption:TXT, converting them to text, stripping all HTML formatting [Default]similar to Evernote's "Simplify & Make Editable"PDF, converting them to PDF, keeping HTML formatting as close as possibleweb clips are converted usingwkhtmltopdf, seethis pageon how to install itSince Notion's gallery view does not provide thumbnails for embedded PDFs, you have the--add-pdf-previewoption to extract the first page of generated PDF as a preview for the web clip page.Banned file extensionsNotion prohibits uploading files with certain extensions. The list consists of extensions for executable binaries, supposedly to prevent spreading malware.enex2notionwill automatically add abinextension to those files to circumvent this limitation. List of banned extensions:apk,app,com,ear,elf,exe,ipa,jar,js,xap,xbe,xex,xpi.MiscThe--condense-linesoption is helpful if you want to save up some space and make notes look more compact.Example.The--condense-lines-sparsedoes the same thing as--condense-lines, but leaves gaps between paragraphs.Example.The--tagoption allows you to add a custom tag to all uploaded notes. It will add this tag to existing tags if the note already has any.ExamplesChecking notes before upload$enex2notion--verbosemy_notebooks/Uploading notes from a single notebook$enex2notion--token<YOUR_TOKEN_HERE>"notebook.enex"Uploading with the option to continue later$enex2notion--token<YOUR_TOKEN_HERE>--done-filedone.txt"notebook.enex"Getting helpIf you found a bug or have a feature request, pleaseopen a new issue.If you have a question about the program or have difficulty using it, you are welcome tothe discussions page. You can also mail me directly, I'm always happy to help.