Skip to main content

Simple Evernote client powered by a browser-captured web session

Project description

sloppynotes

A small Python library and CLI that reuses an authenticated Evernote web session without API keys.

Install the PyPI distribution as sloppynotes.

What this package does

This project reuses an already authenticated Evernote web session and then talks to Evernote's legacy NoteStore APIs.

How login works, and how this package avoids a separate API login

This package does not ask for Evernote API keys and does not implement a separate username/password login flow. Instead, it reuses the login state that already exists in a Chromium-based browser.

High-level flow:

  1. Launch or reuse a CDP-enabled Chromium/Chrome browser profile.
  2. Check whether Evernote is already logged in in that browser.
  3. Read the Evernote auth cookie from the logged-in browser session.
  4. Extract the legacy monolith auth token and shard from that cookie.
  5. Save them to a local evernote-auth.json file.

Reverse-engineered details:

  1. The Evernote web client exchanges auth at:
    • https://accounts.evernote.com/auth/token
  2. That response contains tokens such as:
    • access_token
    • refresh_token
    • id_token
  3. The access_token payload contains mono_authn_token, which is the legacy auth token used by older Evernote services.
  4. The same monolith token is also available in the auth cookie for *.evernote.com.
  5. This package reads that browser cookie and saves the minimal auth data needed for later API calls.

How this package reads notebooks and notes

After saving the auth token and shard, the package talks to Evernote's legacy NoteStore service. The shard tells us which Evernote service URL to call, and the saved monolith token is used to authenticate those requests.

That is how the library and CLI can call methods such as:

  • listNotebooks
  • findNotesMetadata
  • getNote

Playwright is only needed for the browser side of the flow. It connects to a Chromium-based browser over CDP so this package can detect the logged-in Evernote session and read the auth cookie. Once evernote-auth.json has been saved, the later NoteStore API calls do not depend on Playwright; they use the saved auth together with the Thrift client code.

A short introduction to Thrift

Thrift is a remote procedure call and serialization system. In practice, that means a client can call named backend methods such as listNotebooks and send structured request data in a format the server understands.

Evernote's older APIs use Thrift for services such as NoteStore and UserStore. This project uses Python Thrift support to serialize those requests and parse the responses.

Legacy Evernote NoteStore/UserStore model:

Usage

Install

uv run --with sloppynotes -- evernote login

Login flow

For Faltoobot, reuse the shared browser so Evernote cookies come from the same browser session:

faltoobot browser https://www.evernote.com/client/web
uv run --with sloppynotes -- evernote login --use-existing-browser

You can also let evernote login launch its own browser profile when you are not using Faltoobot:

evernote login  # saves login credentials to ~/.sloppynotes/evernote-auth.json

Usage from Python

from evernote.client import get_note, get_notes, get_notebooks, search_notes

notebooks = get_notebooks()
matching_notes = search_notes('intitle:"Project"')
notes = get_notes(notebooks[0])
note = get_note(notes[0])

These helpers return plain Python dictionaries. Typical shapes look like this:

notebooks = get_notebooks()
notebook = notebooks[0]
print(notebook)
# {
#   "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
#   "guid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
#   "name": "Work",
#   "defaultNotebook": False,
#   "serviceCreated": 1710000000000,
#   "serviceUpdated": 1710000000000,
#   "updateSequenceNum": 12345,
# }

notes = get_notes(notebook)
note_summary = notes[0]
print(note_summary)
# {
#   "id": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy",
#   "guid": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy",
#   "title": "Project plan",
#   "contentLength": 2048,
#   "created": 1710000000000,
#   "updated": 1710003600000,
#   "notebookGuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
#   "tagGuids": ["zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz"],
#   "updateSequenceNum": 23456,
# }

note = get_note(note_summary)
print(note)
# {
#   "id": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy",
#   "guid": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy",
#   "title": "Project plan",
#   "content": "<?xml version=...>",
#   "content_text": "Project plan\n- task 1\n- task 2",
#   "contentLength": 2048,
#   "created": 1710000000000,
#   "updated": 1710003600000,
#   "notebookGuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
#   "tagGuids": ["zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz"],
#   "updateSequenceNum": 23456,
# }

Some optional keys may be missing when Evernote does not return them.

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

sloppynotes-2.0.1.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

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

sloppynotes-2.0.1-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file sloppynotes-2.0.1.tar.gz.

File metadata

  • Download URL: sloppynotes-2.0.1.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sloppynotes-2.0.1.tar.gz
Algorithm Hash digest
SHA256 8ef06d66da1b63dd714b55aedb159037cd014ea0fb8efbd33cc4ade54d1ea24f
MD5 161bd8018f9a8ab71670c8f66413bc16
BLAKE2b-256 1192d72f13741912451ca2e172cbbff8af147270b1531c3cf6fc3c9d90832465

See more details on using hashes here.

File details

Details for the file sloppynotes-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: sloppynotes-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sloppynotes-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1d8b10c9bd76a2ff32bd4c298e82fe81d7b4edaadcd04d9af889ba4919722af3
MD5 637de776d8b28adac7abeb3fa7282f8e
BLAKE2b-256 8bdae8965dfe85ab950c87a86335302b8534a1c6b39be9579dee1db14a894c7a

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