Skip to content
Projets

dogsheep/apple-notes-to-sqlite

Voir sur GitHub

À propos

Export Apple Notes to SQLite

Productivité et automatisation

Comment ces chiffres sont mesurés

Progression mesurée des étoiles

in 24h
+1
in 7 days
+1
in 15 days
+1
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

apple-notes-to-sqlite

PyPI Changelog Tests License

Export Apple Notes to SQLite

Installation

Install this tool using pip:

pip install apple-notes-to-sqlite

Usage

For help, run:

apple-notes-to-sqlite --help

You can also use:

python -m apple_notes_to_sqlite --help

To save your notes to a SQLite database called notes.db run:

apple-notes-to-sqlite notes.db

A progress bar will be shown.

You can stop it after a specified number of notes using --stop-after:

apple-notes-to-sqlite notes.db --stop-after 10

To dump the notes to standard output out as newline-delimited JSON, rather than saving them to a database, use the --dump option:

apple-notes-to-sqlite --dump

Schema

The database schema generated by this tool looks like this:

CREATE TABLE [folders] (
   [id] INTEGER PRIMARY KEY,
   [long_id] TEXT,
   [name] TEXT,
   [parent] INTEGER,
   FOREIGN KEY([parent]) REFERENCES [folders]([id])
);
CREATE TABLE [notes] (
   [id] TEXT PRIMARY KEY,
   [created] TEXT,
   [updated] TEXT,
   [folder] INTEGER,
   [title] TEXT,
   [body] TEXT,
   FOREIGN KEY([folder]) REFERENCES [folders]([id])
);
CREATE UNIQUE INDEX [idx_folders_long_id]
    ON [folders] ([long_id]);

apple-notes-to-sqlite --help

Usage: apple-notes-to-sqlite [OPTIONS] [DB_PATH]

  Export Apple Notes to SQLite

  Example usage:

      apple-notes-to-sqlite notes.db

  This will populate notes.db with 'notes' and 'folders' tables containing all
  of your notes.

Options:
  --version             Show the version and exit.
  --stop-after INTEGER  Stop after this many notes
  --dump                Output notes to standard output
  --schema              Create database schema and exit
  --help                Show this message and exit.

Development

To contribute to this tool, first checkout the code. Then create a new virtual environment:

cd apple-notes-to-sqlite
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

Explorer des projets similaires

Chargement…