项目
在 GitHub 查看
dogsheep/apple-notes-to-sqlite
关于
Export Apple Notes to SQLite
效率与自动化实测星标增长
- 24小时
- +1
- 7天
- +1
- 15天
- +1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文apple-notes-to-sqlite
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
探索相关项目
加载中…