Skip to main content

Sync notes to/from simplenote.com

Project description

simplenote-local

A command-line tool to fetch, edit, and synchronise local notes files with Simplenote.

Synchronising notes

Set the username and password for your Simplenote account in the environment.

export SIMPLENOTE_LOCAL_USER=user@example.com
export SIMPLENOTE_LOCAL_PASSWORD=sekr1tp@ss

Then fetch the latest notes state from Simplenote.

simplenote --fetch

Notes are kept in $HOME/Notes by default, but this can be overridden.

export SIMPLENOTE_LOCAL_DIR=$HOME/simplenotes
simplenote --fetch

Send any local changes to Simplenote. Although notes are automatically sent to Simplenote when changed using simplenote --edit, this will send any changes made by other commands.

simplenote --send

Loop forever sending any local updates to Simplenote, and regularly checking Simplenote for updates to fetch.

simplenote --watch

By default this will check Simplenote for new changes every 10 minutes, and wait one minute after detecting local changes before sending (in case the same file is changed again in quick succession). These timings can be overridden.

simplenote --fetch-interval 60 --send-wait 0 --watch

Finding notes

To list all notes:

simplenote --list

The notes are sorted with the most recently edited files first.

To list only those notes that contain one or more words either in the filename, or in the file contents:

simplenote --list recipe rice

Words are searched as fragments, not whole words. For example, simplenote --list recipe rice would also find recipe notes that included the word "ricer" or "liquorice".

To list notes that have a specific tag applied, you can use either #tag or %tag notation. Hashes are more commonly used in social media, but in the shell it starts a comment, so would need to be quoted.

simplenote --list \#recipe
simplenote --list %recipe pie

To list all available tags:

simplenote --list-tags

Editing notes

To edit all notes:

simplenote --edit

Note: unless your editor is fast at loading multiple files, or loads them one at a time (like vi), this could be painfully slow once you have a lot of notes.

To override the editor your default VISUAL and/or EDITOR environment variables would specify:

export SIMPLENOTE_LOCAL_EDITOR=sublime
simplenote --edit

To edit only those notes that would match using the same rules as --list:

simplenote --edit key lime pie
simplenote --edit "key lime pie"
simplenote --edit %recipe pie

Editing is the default, so the flag can be omitted.

simplenote key lime pie

To edit an individual file, the filename must contain at least one space and the space(s) must be quoted in the command. The ".txt" extension does not need to be included.

simplenote "key lime pie"
simplenote key\ lime\ pie

To pipe the output of a command into a note, creating it if it doesn't already exist:

pbpaste | simplenote "cake recipe"

Notes:

  • If the argument(s) match more than one existing note, only the first match will be updated.
  • If no match is given, the note will be named after the first line of the output.

If the input looks like HTML, it will be passed through markdownify first. You can disable this step with with the --raw option:

curl https://.../cake-recipe.html | simplenote "cake recipe"
curl https://.../cake-recipe.html | simplenote --raw "html cake recipe"

Tagging notes

To add a tag to matching notes:

simplenote --add-tag recipe key lime pie

To remove a tag from matching notes:

simplenote --remove-tag recipe key lime pie

To remove a tag from all notes:

simplenote --remove-tag recipe

Removing notes

To move all matching notes to the Trash:

simplenote --trash recipe

To restore a note from the Trash:

simplenote --restore key lime pie

To permanently delete notes from the Trash:

simplenote --purge key lime pie

Pinning notes

Note: pinned notes appear at the top of the notes list in the Simplenote interface. In the local copy, it will sort those notes to the top when using simplenote --list, nothing else.

To pin all matching notes:

simplenote --pin key lime pie

To unpin all matching notes:

simplenote --unpin key lime pie

Publishing notes

To tell Simplenote to publish notes to a web page:

simplenote --publish key lime pie

To tell Simplenote to remove published notes:

simplenote --unpublish key lime pie

Collaborating on notes

To collaborate with others on notes, you can add a tag which is the email address of another user:

simplenote --add-tag norm@example.com key lime pie

To stop sharing notes with them, remove the tag again:

simplenote --remove-tag norm@example.com key lime pie

Note: There are two wrinkles with this implementation of sharing:

  1. If that email is not already registered with Simplenote there appears to be no notification to them that they could sign up to collaborate with you -- that is, you either have to be sure they already use Simplenote, or inform them yourself to sign up in order to be able to work together on a note.

  2. When you later unshare a note, the other account keeps a copy of the original note as it was immediately before unsharing, which may be unexpected behaviour and not what you want.

Show a summary of the metadata stored about matching notes

simplenote --info key lime pie

Historical versions of notes

Simplenote keeps multiple versions of notes as they are updated, but not all. The Simperium documentation states:

Simperium stores up to 50 of your most recent versions, and then every 10th version beyond that.

Simperium is the name for the service backing the Simplenote app.

Personal note: I have some regularly edited notes with 1,500+ versions where versions more than 1,000 back are not available; so there are more possible expiry thresholds for historical versions than stated.

To get a list of the recent historical versions of matching notes:

simplenote --history key lime pie

To get a list of all available historical versions of matching notes:

simplenote --history --full key lime pie

To show the metadata and content of an older version of a single note:

simplenote --show-version "key lime pie" 22

To restore the content and tags of an older version of a single note:

simplenote --restore-version "key lime pie" 22

Note: In this instance, the name of the note needs to be quoted to make it the first argument to the command, as the second argument is the version.

Local changes

To list known local changes to notes:

simplenote --list-changes

Note: this does not automatically fetch the current state of notes, so it is not 100% authoritative.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simplenote_local-1.0.4.tar.gz (21.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simplenote_local-1.0.4-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file simplenote_local-1.0.4.tar.gz.

File metadata

  • Download URL: simplenote_local-1.0.4.tar.gz
  • Upload date:
  • Size: 21.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.10

File hashes

Hashes for simplenote_local-1.0.4.tar.gz
Algorithm Hash digest
SHA256 375db98c63855421909142fca85e730664b4044e4f6ab7eded6e95ed72afed02
MD5 617d5dec404eb9dc1217aae0108552ab
BLAKE2b-256 34fbc7b9efac95c2bd33b54f2cbd61c8d0b12501d4f5212f26d316c4ba91c1b8

See more details on using hashes here.

File details

Details for the file simplenote_local-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for simplenote_local-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 20e63d25536f2ac9b2323b56ae9aff5de99dca288117260228dfbb00783ea261
MD5 31e426df3799b19c00319c4022eb2171
BLAKE2b-256 b0a9e8daa0fdbc1af1bd8a46dd9ad5633b7000a03235ddec9aa159d5d0864ad1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page