Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evernote import additional metadata #998

Closed
kiuuik opened this issue Aug 22, 2018 · 27 comments
Closed

evernote import additional metadata #998

kiuuik opened this issue Aug 22, 2018 · 27 comments
Labels
Type: Feature adds functionality
Milestone

Comments

@kiuuik
Copy link

kiuuik commented Aug 22, 2018

Expected behaviour

I have used the evernote webclipper to save some articles. This saves the article (in the normal content windows) and the url in an extra field source-url. In an enex file the url is in <source-url> ... </source-url> which is in a tag <note-attributes>... <note-attributes> at the bottom of a note. Ideally the url would be somewhere in the file.

This feature would be very useful because it would allow to fully ditch evernote. Also: I have tested several enex to text file converters and I think yours is probably the best ("Stärken stärken...")

Maybe there could be an option "write these metadata to head of each imported file: {QLineEdit}". If it's empty nothing happens, if the user fills in words that are in the enex file definition, they get written at the top of each file (one per line). So if I wrote: created, updated, source-url there could be something like this on top of each file:

created: 20140317T182234Z
updated: 20170713T231712Z
source-url: https://en.wikipedia.org/wiki/QOwnNotes

This should also prevent any future feature requests concerning the import.

Thanks for your patience with this brazen feature request. I can understand if you close/remove it immediately without comment. Unfortunately I can't help because I'm still working through my very first book about programing.

Actual behaviour

The url is discarded.

version,os

Debian 9 "Stretch". Today I installed QOwnNotes via git clone & git submodule update --init & qmake & make (commit fb0dbde). All dependencies are from the debian stretch repo.

@kiuuik
Copy link
Author

kiuuik commented Aug 22, 2018

I forgot this in the original posts: Thanks for this great software which I enjoy a lot. I only ask because I like it so much.

@pbek
Copy link
Owner

pbek commented Aug 23, 2018

Thank you for your kind words. Can you please provide an enex file with entries containing such meta data.

@pbek pbek added the Type: Feature adds functionality label Aug 23, 2018
@pbek
Copy link
Owner

pbek commented Aug 23, 2018

I found a suitable example at https://gist.github.com/evernotegists/6116886.

@kiuuik
Copy link
Author

kiuuik commented Aug 23, 2018

I posted another example from the webclipper here. My text edtior is VSCode and I used an extension called xml tools to prettify the output so that it looks like your example. I imported this prettified file back into evernote and it works.

To be on the safe side: here is the raw version.

@pbek
Copy link
Owner

pbek commented Aug 23, 2018

18.08.6

  • when importing from Evernote you can now also import metadata from
    your Evernote notes
    • you can select what metadata to import in the import dialog from a
      tree widget
    • the dialog will remember which items you want to import
    • the selected metadata will be imported as markdown table if available
      in the Evernote note
  • the Evernote import dialog will now also remember if you want to import
    images or attachments

@pbek pbek added this to the 18.08.6 milestone Aug 23, 2018
pbek added a commit that referenced this issue Aug 23, 2018
@pbek
Copy link
Owner

pbek commented Aug 23, 2018

There now is a new release, could you please test it and report if it works for you?

If you like it you are invited to translate the new texts for it at https://crowdin.com/translate/qownnotes/1/en-de ;)

@kiuuik
Copy link
Author

kiuuik commented Aug 23, 2018

Herzlichen Dank für die schnelle Hilfe. Ihr Einsatz übertrifft alle Erwartungen und Ihre Umsetzung ist wesentlich komfortabler als meine erste Idee.


I did a quick test and everything seems to work. That's a great help for me.


The import starts before you click on the OK button. That's great because it's fast. But I see these drawbacks:

  • It's somewhat unexpected: In other software usually I can change my mind after using a file choser. But I guess you mostly have linux users who should know how to remove an unwanted import.
  • When I import and I work from top to bottom I chose the file first and then decide which attributes to add to the imported files. But after changing the file the import already starts. Then I think for a while which attributes I want. Then I change them. This only affects files that aren't processed yet. So I have to redo the import.

I think I would prefer if the import only started after clicking "Ok" in the "Evernote Import" dialog even if it takes longer.


This one is really unimportant: There is only one button "Ok" at the bottom of the import dialog. When I tried out I finally reversed my workflow: Select attributes first, then select the file. But I'm forgetful. After setting the attributes I clicked on "ok" and (as no file is chosen) nothing happens. It took me a while to figure out that I simply forgot to chose a file.


P.S.:

  • Ich habe mich auf crowdin versucht. Das war meine erste Übersetzung. Ich weiß nicht, wie wichtig es ist, genau die gleiche Zeichenlänge hinzukriegen. Deshalb könnte manch string etwas lang sein. Die Metadaten (subject date, date created) würde ich ggf gar nicht übersetzen, denn für manche ("subject date") finde ich keinen offiziellen deutschen Begriff und nur eins unübersetzt zu lassen - finde ich - sieht doof aus. Außerdem ist die enex-Dokumentation nur auf Englisch, so dass eine Übersetzung mehr verwirren könnte? Übrigens würde ich persönlich Erstellungsdatum mit "date created" (wie es auch im Windows Explorer heißt) übersetzen, nicht wie Sie mit "Created date". Aber sicher bin ich mir da nicht ...

  • An meiner Antwort zu dem anderen Issue schreibe ich noch. Die schaffe ich aber vielleicht erst morgen.

@pbek
Copy link
Owner

pbek commented Aug 24, 2018

The ok button is a relic from the default behavior of dialogs. I couldn't move the File select line to the bottom because of the content of the text that described it... (I didn't wan't to change it, because that would invalidate a lot of translations) but since I also replaced ... with ellipsis yesterday that text was changed in the end. I guess I will move the file block to the bottom and remove the OK-button that is closing the dialog... Or I replace it with an other button.

Thank you for the translation. No need to bother with text size too much, German text is generally larger ;)

created date is ok too, it's used very often. If you can't find an "official translation" just translate it in a way a "normal user" would grasp it. :)

@pbek
Copy link
Owner

pbek commented Aug 24, 2018

18.08.7

  • improved the user interface of the Evernote import

@pbek pbek modified the milestones: 18.08.6, 18.08.7 Aug 24, 2018
@pbek
Copy link
Owner

pbek commented Aug 24, 2018

By the way there are also Debian 9.0 builds for QOwnNotes, in case you don't want to build it yourself every time...

@pbek
Copy link
Owner

pbek commented Aug 24, 2018

There now is a new release, could you please test it and report if it works for you?

@kiuuik
Copy link
Author

kiuuik commented Aug 25, 2018

thanks for this rapid and great improvement. It works perfectly for me.


I noticed that maybe one additional thing could be added to perfect the importer: reminders. Maybe some other people might profit from this because reminders are much more approachable in a markdown table than in the xml-enex-file.

I had another look at the enex-definition file. In line 92 there are additional note attributes that are not yet in your importer.

reminder-order?
reminder-time?
reminder-done-time?
place-name?
content-class?

I didn't manage to produce an enex file that contains place-name and content-class.

About the remindes: If you want to spend more time on the Evernote importer would you need an additional enex file or would this suffice?

...
    <updated>20180824T230028Z</updated>
    <note-attributes>
        <source>mobile.android</source>
        <reminder-order>20180825T224054Z</reminder-order>
        <reminder-done-time>00001231T000000Z</reminder-done-time>
    </note-attributes>
</note>
...

when I haven't set done (reminder-done-time) the reminder might still be running. Then in note attributes it looks like this:

    <note-attributes>
        <reminder-time>20180826T060000Z</reminder-time>
    </note-attributes>

In the joplin forum I found a link to a 300note/100mb enex file. Maybe this is useful in the future?

laurent22/joplin#55 (comment)

and even more smaller enex files are at https://github.com/exomut/evernote-dump/tree/master/source/evernote_dump/test

@kiuuik
Copy link
Author

kiuuik commented Aug 25, 2018

this is somewhat related to medata: in case you get a feature request about converting/adjusting internal links (links to different notes) during the import: That cant' work: These links don't contain the title but a userid and noteguid. This is not included in the enex file. So there is no way to import these from an enex file.

@pbek
Copy link
Owner

pbek commented Aug 25, 2018

Thank you for your feedback. I didn't find anything about reminders in http://xml.evernote.com/pub/evernote-export.dtd.

@kiuuik
Copy link
Author

kiuuik commented Aug 25, 2018

Here is an enex file that contains reminders that I just exported from the latest Evernote for Windows Desktop app.

Apparently there are multiple revisions of the file format.

In the thread opening I posted a link to the first version which is dated (sorry about that). In the enex files there is a link to a second revision <!DOCTYPE en-export SYSTEM "http://xml.evernote.com/pub/evernote-export2.dtd">. But this is not helpful. This definition does not contain the word "reminder" whereas the exported text from the official evernote app does.

The latest definition I find is the third revision (from 2013) which is available at http://xml.evernote.com/pub/evernote-export3.dtd. This one contains all the additional words/note-attributes like reminder I was referring to.

P.S.: While writing this post I discovered even more evernote to markdown converters on github. But they all lack your metadata import. I'm even more convinced that this is a standout feature of QON for regular users.

@pbek
Copy link
Owner

pbek commented Aug 25, 2018

18.08.8

  • more Evernote import improvements (for #998)
    • fixed importing of notes if user enabled that the filename can be
      different from the note name in the settings
    • added importing of the note attribute metadata of version 3 of the Evernote export file

pbek added a commit that referenced this issue Aug 25, 2018
@pbek
Copy link
Owner

pbek commented Aug 25, 2018

There now is a new release, could you please test it and report if it works for you?

@kiuuik
Copy link
Author

kiuuik commented Aug 25, 2018

The evernote features you added today seem to work as expected. Thank you very much once more!!

I noticed a different bug (though bug might be too strong a word): After the import I have to manually update the note list panel (like one search or just press Enter). The fact that after an import the note list panel is not changed might confuse some people.

This behavior wasn't introduced with this release but I think has been there a long time.

@pbek
Copy link
Owner

pbek commented Aug 26, 2018

Thank you for your attentiveness. I'll take a look.

@pbek
Copy link
Owner

pbek commented Aug 26, 2018

Hm, I don't have that issue. Notes show up fine after I close the dialog...

@pbek
Copy link
Owner

pbek commented Aug 26, 2018

I even currently reload the note folder after importing...

    if (dialog->getImportCount() > 0) {
        // reload the note folder after importing new notes
        buildNotesIndexAndLoadNoteDirectoryList(true);
    }

@pbek
Copy link
Owner

pbek commented Aug 26, 2018

On which platform were you testing?

Maybe you want to try out the new issue assistant to post an issue. ;)

18.08.9

  • there now is a new Issue assistant to post questions, feature requests or problems
    • you will find it in the Help menu
    • it will guide you to the steps to enter information and gathers all
      needed data to post an issue on the Issue page

@pbek pbek closed this as completed Aug 26, 2018
@kiuuik
Copy link
Author

kiuuik commented Aug 26, 2018

the latest flatpak on debian and windows. I might make a mistake. Here's a gif. If you think that a) this is a problem and b) it is worth your time I can post more info.

qownnotes

@pbek
Copy link
Owner

pbek commented Aug 26, 2018

Hard to tell if that's a problem with the flatpack confinement... Can you test with a non-confined version of QOwnNotes?

@kiuuik
Copy link
Author

kiuuik commented Aug 26, 2018

here's a clip from an unconfined, self-built version (git clone/pull & qmake & make). I have the same behavior on Windows (though no clip for this).

@pbek
Copy link
Owner

pbek commented Aug 26, 2018

Could you please post a new issue, I will need a little more information to debug this

@kiuuik
Copy link
Author

kiuuik commented Sep 3, 2018

This is just a correction: Last week I posted my findings that enex doesn't contain noteguids which ḿeans that it shouldn't be possible to import internal links.

There might be a workaround with the third party client nixnote2 for linux. I trust it because it's bundled with many popular linux distros. nixnote2 has its own export format named nnex which is very similar to evernotes enex but also includes useful entries like <Guid> and <NotebookGuid>. This might help.

This might be also interesting for people who have their notes spread among many different notebooks and want to keep this order. When you export all notes from evernote their respective notebooks aren't saved. The only alternative is to export (and import) each notebook individually which might take a lot of time.

In case that's ever of interest to someone: Here's the structure of a nnex file. I just removed some personal information.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE NixNote-Export>
<nixnote-export version="2" exportType="export" application="NixNote" applicationVersion="2.x">
    <Note>
        <Guid>1a59f8b5-a06f-49a8-8437-7493cfd612e9</Guid>
        <Title>title</Title>
        <Content><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">
<en-note><div>some content</div></en-note>]]></Content>
        <ContentHash>voc4wrnu904cw09ucw8828292929292d</ContentHash>
        <ContentLength>674</ContentLength>
        <Created>1536004382121</Created>
        <Updated>1536004392432</Updated>
        <Active>true</Active>
        <UpdateSequenceNumber>9240</UpdateSequenceNumber>
        <NotebookGuid>672ab04c-9e67-47d4-adaf-707e2ee028fb</NotebookGuid>
        <Attributes>
            <Author>[email protected]</Author>
            <Source>desktop.win</Source>
            <SourceApplication>evernote.win32</SourceApplication>
        </Attributes>
        <Dirty>true</Dirty>
    </Note>
</nixnote-export>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature adds functionality
Projects
None yet
Development

No branches or pull requests

2 participants