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

Error on converting #6

Open
kidata opened this issue Jun 29, 2016 · 15 comments
Open

Error on converting #6

kidata opened this issue Jun 29, 2016 · 15 comments

Comments

@kidata
Copy link

kidata commented Jun 29, 2016

When i try this with Python 2.7.2 on Windows 7 64bit with a fresh exported .enex file:

ever2simple Evernote.enex -o simplenote -f dir

i get this error:

Traceback (most recent call last):
File "D:\tools\Python27\Scripts\ever2simple-script.py", line 9, in
load_entry_point('ever2simple==2.0', 'console_scripts', 'ever2simple')()
File "d:\tools\python27\lib\site-packages\ever2simple\core.py", line 21, in main
converter.convert()
File "d:\tools\python27\lib\site-packages\ever2simple\converter.py", line 80, in convert
notes = self.prepare_notes(xml_tree)
File "d:\tools\python27\lib\site-packages\ever2simple\converter.py", line 52, in prepare_notes
note_dict['createdate'] = created_string.strftime(self.date_fmt)
ValueError: Invalid format string

the format of the created-nodes is 20160324T131701Z in my enex file

@planetahuevo
Copy link

Same error when trying to convert a recent exported file.

@HoaXHoang
Copy link

exact same for me, on python 2.7.6, win 7 64bit. I guess everyone is moving to simplenote after the announcement lol

@HoaXHoang
Copy link

HoaXHoang commented Jun 30, 2016

hi, if you want to fix the date string error, just change line 16 in converter.py from
date_fmt = '%h %d %Y %H:%M:%S'
to
date_fmt = '%Y %m %d %H:%M:%S'

sorry still new to git and what the procedure is for submitting fixes

My date is also in this format: 20160629T084212Z. Maybe Evernote exports the date in different formats. Also not sure if this date is even kept anywhere in the text file, so I guess it really doesn't matter what the date is?

@AmedeeBulle
Copy link

AmedeeBulle commented Jul 1, 2016

The problem is that %h is not a valid python strftime(); %bshould be used instead.
It works on unix boxes (Linux, Mac,...) because python passes the string to strftime() from the C library which supports %h as synonym for %b

Date actually matters if you want to keep your dates in Simplenote...

(Submitted Pull Request #10 with this small change)

@planetahuevo
Copy link

@AmedeeBulle But the other fix suggested changes the order of the year and month. Does your solution fix this too?

Thanks

@AmedeeBulle
Copy link

Yes it doesn't matter, it only affects how dates are printed, not read.

(Furthermore it is only used if you select JSON output format, and it that case a UNIX timestamp might be better, see my pull requests #11 and #12 )

@planetahuevo
Copy link

Fantastic. Thank you!

@DaKine26-2
Copy link

DaKine26-2 commented Jul 8, 2016

My first usage yesterday was a complete success, thanks in particular to @hxnhng for the comment about the date_fmt.

Now......since I just converted a few hundred notes, if only there were a way to automate the tagging. I guess there's nothing in simplenote that allows this in the note or filename, etc., right? The reason I ask is that I was planning to export by tag in evernote, so at import time I would know the tag to use for each note.

@AmedeeBulle
Copy link

Tags should not be an issue if you go through the JSON path...

What I was missing was the Notebooks as this does no exist in Simplenote. So I exported by notebook and uploaded in Simplenote adding a tag for each notebook.

@DaKine26-2
Copy link

Thanks, will try JSON for the next batch.

@planetahuevo
Copy link

Hi,
@AmedeeBulle how do you import the json into the simplenote?

Thanks

@AmedeeBulle
Copy link

Just using the Simplenote API -- wrote a small script which reads back the JSON file and uploads to Simplenote.

I did that because:

  • It works out of the box (no need to setup Dropbox synch or whatever)
  • it preserves tags
  • It preserves create/update dates

I can share the code if anybody is interested...

@DaKine26-2
Copy link

DaKine26-2 commented Jul 11, 2016

I can share the code if anybody is interested...

+1, thanks, your script (and ever2simple fork) worked perfectly for me.

@planetahuevo
Copy link

I am too. Thanks!

@AmedeeBulle
Copy link

Here it is...
https://gist.github.com/AmedeeBulle/fdc19b9705a5a9e2f9fc41792dee6901

QAston pushed a commit to QAston/ever2simple that referenced this issue Feb 29, 2020
Replace `open` with `io.open` to be compatible with Python 2 and 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants