README.md
October 7, 2024 ยท View on GitHub
__ ____
____ ____ __/ /_ ___ _ __ / __/_____
/ __ \ / __ \\ __// _ \ | |/_// /_ / ___/
/ / / // /_/ // /_ / __/_> < / __// /
/_/ /_/ \____/ \__/ \___//_/|_|/_/ /_/
notexfr is a tool to convert and adapt data for transfer between note-taking services.
What are the features?
- Convert Evernote data into StandardNotes format.
- Fetch Note, Notebook, Tag data from your Evernote account (using the EDAM API) and write to local JSON files.
- Backfill existing StandardNotes notes with Evernote Notebook metadata.
- Inspect ENEX file (Evernote's export format).
Why would you use it?
Use the convert tool to transform Evernote data into new StandardNotes data.
If you've already moved your data from Evernote into StandardNotes, you can use
backfill to update StandardNotes data. You've probably used the interface
at https://dashboard.standardnotes.org/tools to take an ENEX (Evernote export)
file to convert it to StandardNotes format. Unfortunately, the ENEX format does
not contain any Notebook info, so it can't be preserved with the existing
conversion tool. You'd use this if you want to preserve your Evernote Notebooks
and their Note associations.
Getting Started
Many common tasks in this repo use just.
$ just build
$ mv -iv bin/notexfr $GOPATH/bin
TLDR:
- Set up Evernote credentials
- Fetch Evernote data, write to local files
- Convert or backfill StandardNotes data. Do either of the following:
- Convert data to StandardNotes format (create new data)
- Backfill data for StandardNotes (update copies of existing data)
Set up Evernote credentials
You would need a developer token with full access to your account. Visit the Evernote developer documentation site.
Request a developer token for access to your Evernote account. Typically, you start with access to a sandbox account, which is for testing things out, and then request access to your production account. At the time of this writing, it's a manual process but they are usually pretty quick.
Once you have that info, store them in an environment variable file. Create a template file and fill it in.
You must specify a path to an environment variable file. The information in there will be equivalent to your username and password.
$ notexfr edam make-env --envfile path/to/envfile
$ chmod 600 path/to/envfile
Fetch Evernote data, write to local files
By default, everything is fetched using your sandbox account. Use the
--production flag to fetch data from your production Evernote account.
Remember to specify the path to the environment variable file.
$ notexfr edam notebooks \
--production \
--output path/to/en_notebooks.json \
--envfile path/to/envfile
$ notexfr edam tags \
--production \
--output path/to/en_tags.json \
--envfile path/to/envfile
To get notes, you might consider a longer timeout value than the default.
Anecdotally, it took about 90 seconds to download about 1550 notes. Your results
will vary. To be safe, set it on the higher end. Add the flag --log-level=INFO
for updates.
$ notexfr edam notes \
--production \
--output path/to/en_notes.json \
--envfile path/to/envfile \
--timeout 120s \
--log-level=INFO
Convert or backfill StandardNotes data
After downloading your Evernote data to local JSON files, you're ready to transform it.
Convert data to StandardNotes format
Do this if you want to do a full conversion of Evernote data and create new StandardNotes data.
$ notexfr convert edam-to-sn \
--input-en-notebooks path/to/en_notebooks.json \
--input-en-notes path/to/en_notes.json \
--input-en-tags path/to/en_tags.json \
--output path/to/sn.json
Backfill data for StandardNotes
Do this if you want to do update existing StandardNotes data.
The --input-sn value would a representation of your data in StandardNotes. For
example, it could be the output of https://dashboard.standardnotes.org/tools.
$ notexfr backfill en-to-sn \
--input-en-notebooks path/to/en_notebooks.json \
--input-en-notes path/to/en_notes.json \
--input-en-tags path/to/en_tags.json \
--input-sn path/to/evernote-to-sn.txt \
--output-notebooks path/to/sn_notebooks.json \
--output-notes path/to/sn_notes.json \
--output-tags path/to/sn_tags.json
Development
Use just to perform common tasks.
Output a binary
$ just build
Run tests
$ just test
# run tests with some flags
$ just test -v -count=1 -failfast
# run tests on select package paths, override the Justfile variable PKG_PATH
$ just PKG_PATH=./foo/bar/... test
# select package path, specify some test flags
$ just PKG_PATH=./foo/bar/... test -v -race
Do static checks
$ just vet
By default, the first go in your PATH is used. You could specify another
golang version by setting the GO variable just. Example:
$ just GO=/path/to/go1.x.y/bin/go build