{"id":13585072,"url":"https://github.com/dogsheep/apple-notes-to-sqlite","last_synced_at":"2025-04-09T09:11:27.055Z","repository":{"id":130856512,"uuid":"611552758","full_name":"dogsheep/apple-notes-to-sqlite","owner":"dogsheep","description":"Export Apple Notes to SQLite","archived":false,"fork":false,"pushed_at":"2023-09-04T23:48:28.000Z","size":21,"stargazers_count":203,"open_issues_count":9,"forks_count":11,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-02T07:08:46.935Z","etag":null,"topics":["apple-notes","datasette","datasette-tool","dogsheep","sqlite"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dogsheep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-09T03:44:10.000Z","updated_at":"2025-03-24T12:27:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"a64d2ab3-1b55-40b6-9f21-76cc1ae507bd","html_url":"https://github.com/dogsheep/apple-notes-to-sqlite","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"e55a802d37a896475b6cf475c1ba947af63cca73"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogsheep%2Fapple-notes-to-sqlite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogsheep%2Fapple-notes-to-sqlite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogsheep%2Fapple-notes-to-sqlite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogsheep%2Fapple-notes-to-sqlite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dogsheep","download_url":"https://codeload.github.com/dogsheep/apple-notes-to-sqlite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248008630,"owners_count":21032556,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apple-notes","datasette","datasette-tool","dogsheep","sqlite"],"created_at":"2024-08-01T15:04:43.608Z","updated_at":"2025-04-09T09:11:27.037Z","avatar_url":"https://github.com/dogsheep.png","language":"Python","readme":"# apple-notes-to-sqlite\n\n[![PyPI](https://img.shields.io/pypi/v/apple-notes-to-sqlite.svg)](https://pypi.org/project/apple-notes-to-sqlite/)\n[![Changelog](https://img.shields.io/github/v/release/dogsheep/apple-notes-to-sqlite?include_prereleases\u0026label=changelog)](https://github.com/dogsheep/apple-notes-to-sqlite/releases)\n[![Tests](https://github.com/dogsheep/apple-notes-to-sqlite/workflows/Test/badge.svg)](https://github.com/dogsheep/apple-notes-to-sqlite/actions?query=workflow%3ATest)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/dogsheep/apple-notes-to-sqlite/blob/master/LICENSE)\n\nExport Apple Notes to SQLite\n\n## Installation\n\nInstall this tool using `pip`:\n\n    pip install apple-notes-to-sqlite\n\n## Usage\n\nFor help, run:\n\n    apple-notes-to-sqlite --help\n\nYou can also use:\n\n    python -m apple_notes_to_sqlite --help\n\nTo save your notes to a SQLite database called `notes.db` run:\n\n    apple-notes-to-sqlite notes.db\n\nA progress bar will be shown.\n\nYou can stop it after a specified number of notes using `--stop-after`:\n\n    apple-notes-to-sqlite notes.db --stop-after 10\n\nTo dump the notes to standard output out as newline-delimited JSON, rather than saving them to a database, use the `--dump` option:\n\n    apple-notes-to-sqlite --dump\n\n## Schema\n\nThe database schema generated by this tool looks like this:\n\n\u003c!-- [[[cog\nimport cog, json\nfrom apple_notes_to_sqlite import cli\nfrom click.testing import CliRunner\nimport sqlite_utils\nimport tempfile, pathlib\ntmpdir = pathlib.Path(tempfile.mkdtemp())\ndb_path = str(tmpdir / \"temp.db\")\nrunner = CliRunner()\nresult = runner.invoke(cli.cli, [db_path, \"--schema\"])\ncog.out(\"```sql\\n\")\ncog.out(sqlite_utils.Database(db_path).schema)\ncog.out(\"\\n```\")\n]]] --\u003e\n```sql\nCREATE TABLE [folders] (\n   [id] INTEGER PRIMARY KEY,\n   [long_id] TEXT,\n   [name] TEXT,\n   [parent] INTEGER,\n   FOREIGN KEY([parent]) REFERENCES [folders]([id])\n);\nCREATE TABLE [notes] (\n   [id] TEXT PRIMARY KEY,\n   [created] TEXT,\n   [updated] TEXT,\n   [folder] INTEGER,\n   [title] TEXT,\n   [body] TEXT,\n   FOREIGN KEY([folder]) REFERENCES [folders]([id])\n);\nCREATE UNIQUE INDEX [idx_folders_long_id]\n    ON [folders] ([long_id]);\n```\n\u003c!-- [[[end]]] --\u003e\n\n### apple-notes-to-sqlite --help\n\n\u003c!-- [[[cog\nimport cog\nfrom apple_notes_to_sqlite import cli\nfrom click.testing import CliRunner\nrunner = CliRunner()\nresult = runner.invoke(cli.cli, [\"--help\"])\nhelp = result.output.replace(\"Usage: cli\", \"Usage: apple-notes-to-sqlite\")\ncog.out(\n    \"```\\n{}\\n```\".format(help)\n)\n]]] --\u003e\n```\nUsage: apple-notes-to-sqlite [OPTIONS] [DB_PATH]\n\n  Export Apple Notes to SQLite\n\n  Example usage:\n\n      apple-notes-to-sqlite notes.db\n\n  This will populate notes.db with 'notes' and 'folders' tables containing all\n  of your notes.\n\nOptions:\n  --version             Show the version and exit.\n  --stop-after INTEGER  Stop after this many notes\n  --dump                Output notes to standard output\n  --schema              Create database schema and exit\n  --help                Show this message and exit.\n\n```\n\u003c!-- [[[end]]] --\u003e\n\n\n## Development\n\nTo contribute to this tool, first checkout the code. Then create a new virtual environment:\n\n    cd apple-notes-to-sqlite\n    python -m venv venv\n    source venv/bin/activate\n\nNow install the dependencies and test dependencies:\n\n    pip install -e '.[test]'\n\nTo run the tests:\n\n    pytest\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdogsheep%2Fapple-notes-to-sqlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdogsheep%2Fapple-notes-to-sqlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdogsheep%2Fapple-notes-to-sqlite/lists"}