Skip to content

lib-x/enex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-enex

Evernote .enex parser for Go.

Parse a File

doc, err := enex.Parse(file, enex.WithNotebookName("Imported"))
if err != nil {
	return err
}
for _, note := range doc.Notes {
	fmt.Println(note.Title, note.NotebookName, note.Tags)
}

Note.Content keeps the original ENML content. Use enex.PlainText(note.Content) when you need a plain-text representation.

Stream Notes

decoder, err := enex.NewDecoder(file)
if err != nil {
	return err
}
for {
	note, err := decoder.Next()
	if errors.Is(err, io.EOF) {
		break
	}
	if err != nil {
		return err
	}
	fmt.Println(note.Title)
}

Resources

Resource data is exposed as base64 text through Resource.Data. Call Resource.Data.Decode() to decode it. The parser also fills Resource.BodyHash with the MD5 hash of valid decoded resource bodies.

Refer

About

evernote .enex file parser

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages