{"html_url": "https://github.com/dogsheep/healthkit-to-sqlite/issues/12#issuecomment-879477586", "issue_url": "https://api.github.com/repos/dogsheep/healthkit-to-sqlite/issues/12", "id": 879477586, "node_id": "MDEyOklzc3VlQ29tbWVudDg3OTQ3NzU4Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-07-13T23:50:06Z", "updated_at": "2021-07-13T23:50:06Z", "author_association": "MEMBER", "body": "Unfortunately I don't think updating the database is practical, because the export doesn't include unique identifiers which can be used to update existing records and create new ones. Recreating from scratch works around that limitation.\r\n\r\nI've not explored workouts with SpatiaLite but that's a really good idea.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 727848625, "label": "Some workout columns should be float, not text"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/issues/64#issuecomment-861042050", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/64", "id": 861042050, "node_id": "MDEyOklzc3VlQ29tbWVudDg2MTA0MjA1MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-06-14T22:45:42Z", "updated_at": "2021-06-14T22:45:42Z", "author_association": "MEMBER", "body": "I'm definitely interested in supporting events in this tool - see #14.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 920636216, "label": "feature: support \"events\""}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/issues/64#issuecomment-861041597", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/64", "id": 861041597, "node_id": "MDEyOklzc3VlQ29tbWVudDg2MTA0MTU5Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-06-14T22:44:54Z", "updated_at": "2021-06-14T22:44:54Z", "author_association": "MEMBER", "body": "Have you found a way to access events in GraphQL? I can only see way to access a timeline of events for a single issue or a single pull request. See also https://github.community/t/get-event-equivalent-for-v4/13600/2", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 920636216, "label": "feature: support \"events\""}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/pull/59#issuecomment-844250232", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/59", "id": 844250232, "node_id": "MDEyOklzc3VlQ29tbWVudDg0NDI1MDIzMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-05-19T16:08:10Z", "updated_at": "2021-05-19T16:08:10Z", "author_association": "MEMBER", "body": "Thanks for catching this.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 771872303, "label": "Remove unneeded exists=True for -a/--auth flag."}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/pull/61#issuecomment-844249385", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/61", "id": 844249385, "node_id": "MDEyOklzc3VlQ29tbWVudDg0NDI0OTM4NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-05-19T16:07:06Z", "updated_at": "2021-05-19T16:07:06Z", "author_association": "MEMBER", "body": "Thanks!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 797108702, "label": "fixing typo in get cli help text"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/pull/29#issuecomment-739058820", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/29", "id": 739058820, "node_id": "MDEyOklzc3VlQ29tbWVudDczOTA1ODgyMA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-04T22:32:35Z", "updated_at": "2020-12-04T22:32:35Z", "author_association": "MEMBER", "body": "Thanks for this!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 638375985, "label": "Fixed bug in SQL query for photo scores"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/issues/53#issuecomment-735485677", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/53", "id": 735485677, "node_id": "MDEyOklzc3VlQ29tbWVudDczNTQ4NTY3Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-30T00:36:09Z", "updated_at": "2020-11-30T00:36:09Z", "author_association": "MEMBER", "body": "Given rate limits (see #51) this command might be better implemented by running a `git clone` into a temporary directory - doing so would retrieve all of the files in one go.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 753000405, "label": "Command for fetching file contents"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/issues/51#issuecomment-735484186", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/51", "id": 735484186, "node_id": "MDEyOklzc3VlQ29tbWVudDczNTQ4NDE4Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-30T00:29:31Z", "updated_at": "2020-11-30T00:29:31Z", "author_association": "MEMBER", "body": "This just caused a failure in deploying the demo: https://github.com/dogsheep/github-to-sqlite/runs/1471304407?check_suite_focus=true\r\n\r\n```\r\n File \"/opt/hostedtoolcache/Python/3.8.6/x64/bin/github-to-sqlite\", line 33, in \r\n sys.exit(load_entry_point('github-to-sqlite', 'console_scripts', 'github-to-sqlite')())\r\n File \"/opt/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/site-packages/click/core.py\", line 829, in __call__\r\n return self.main(*args, **kwargs)\r\n File \"/opt/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/site-packages/click/core.py\", line 782, in main\r\n rv = self.invoke(ctx)\r\n File \"/opt/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/site-packages/click/core.py\", line 1259, in invoke\r\n return _process_result(sub_ctx.command.invoke(sub_ctx))\r\n File \"/opt/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/site-packages/click/core.py\", line 1066, in invoke\r\n return ctx.invoke(self.callback, **ctx.params)\r\n File \"/opt/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/site-packages/click/core.py\", line 610, in invoke\r\n return callback(*args, **kwargs)\r\n File \"/home/runner/work/github-to-sqlite/github-to-sqlite/github_to_sqlite/cli.py\", line 142, in issue_comments\r\n for comment in utils.fetch_issue_comments(repo, token, issue):\r\n File \"/home/runner/work/github-to-sqlite/github-to-sqlite/github_to_sqlite/utils.py\", line 380, in fetch_issue_comments\r\n for comments in paginate(url, headers):\r\n File \"/home/runner/work/github-to-sqlite/github-to-sqlite/github_to_sqlite/utils.py\", line 472, in paginate\r\n raise GitHubError.from_response(response)\r\ngithub_to_sqlite.utils.GitHubError: ('API rate limit exceeded for user ID 9599.', 403)\r\nError: Process completed with exit code 1.\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 703246031, "label": "github-to-sqlite should handle rate limits better"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/issues/46#issuecomment-735483820", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/46", "id": 735483820, "node_id": "MDEyOklzc3VlQ29tbWVudDczNTQ4MzgyMA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-30T00:27:47Z", "updated_at": "2020-11-30T00:27:47Z", "author_association": "MEMBER", "body": "So it looks like anything that pulls reviews needs to pull each review, then for each one pull the comments.\r\n\r\nI'm going to consider this blocked on smarter rate limit handling in #51.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 664485022, "label": "Feature: pull request reviews and comments"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/issues/46#issuecomment-735483604", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/46", "id": 735483604, "node_id": "MDEyOklzc3VlQ29tbWVudDczNTQ4MzYwNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-30T00:26:50Z", "updated_at": "2020-11-30T00:26:50Z", "author_association": "MEMBER", "body": "It seems like there's a lot missing from that - those aren't particularly interesting given the data that is returned.\r\n\r\nFrom the docs at https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls#reviews it looks like each review consists of multiple comments, and the comments are where the useful material is - https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls#list-comments-for-a-pull-request-review\r\n\r\n`github-to-sqlite get https://api.github.com/repos/dogsheep/github-to-sqlite/pulls/48/reviews/503368921/comments --accept 'application/vnd.github.v3+json'`\r\n\r\n```json\r\n[\r\n {\r\n \"id\": 500603838,\r\n \"node_id\": \"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDUwMDYwMzgzOA==\",\r\n \"url\": \"https://api.github.com/repos/dogsheep/github-to-sqlite/pulls/comments/500603838\",\r\n \"pull_request_review_id\": 503368921,\r\n \"diff_hunk\": \"@@ -0,0 +1,370 @@\\n+[\\n+ {\\n+ \\\"url\\\": \\\"https://api.github.com/repos/simonw/datasette/pulls/571\\\",\\n+ \\\"id\\\": 313384926,\\n+ \\\"node_id\\\": \\\"MDExOlB1bGxSZXF1ZXN0MzEzMzg0OTI2\\\",\\n+ \\\"html_url\\\": \\\"https://github.com/simonw/datasette/pull/571\\\",\\n+ \\\"diff_url\\\": \\\"https://github.com/simonw/datasette/pull/571.diff\\\",\\n+ \\\"patch_url\\\": \\\"https://github.com/simonw/datasette/pull/571.patch\\\",\\n+ \\\"issue_url\\\": \\\"https://api.github.com/repos/simonw/datasette/issues/571\\\",\\n+ \\\"number\\\": 571,\\n+ \\\"state\\\": \\\"closed\\\",\\n+ \\\"locked\\\": false,\\n+ \\\"title\\\": \\\"detect_fts now works with alternative table escaping\\\",\\n+ \\\"user\\\": {\\n+ \\\"login\\\": \\\"simonw\\\",\\n+ \\\"id\\\": 9599,\\n+ \\\"node_id\\\": \\\"MDQ6VXNlcjk1OTk=\\\",\\n+ \\\"avatar_url\\\": \\\"https://avatars0.githubusercontent.com/u/9599?v=4\\\",\\n+ \\\"gravatar_id\\\": \\\"\\\",\\n+ \\\"url\\\": \\\"https://api.github.com/users/simonw\\\",\\n+ \\\"html_url\\\": \\\"https://github.com/simonw\\\",\\n+ \\\"followers_url\\\": \\\"https://api.github.com/users/simonw/followers\\\",\\n+ \\\"following_url\\\": \\\"https://api.github.com/users/simonw/following{/other_user}\\\",\\n+ \\\"gists_url\\\": \\\"https://api.github.com/users/simonw/gists{/gist_id}\\\",\\n+ \\\"starred_url\\\": \\\"https://api.github.com/users/simonw/starred{/owner}{/repo}\\\",\\n+ \\\"subscriptions_url\\\": \\\"https://api.github.com/users/simonw/subscriptions\\\",\\n+ \\\"organizations_url\\\": \\\"https://api.github.com/users/simonw/orgs\\\",\\n+ \\\"repos_url\\\": \\\"https://api.github.com/users/simonw/repos\\\",\\n+ \\\"events_url\\\": \\\"https://api.github.com/users/simonw/events{/privacy}\\\",\\n+ \\\"received_events_url\\\": \\\"https://api.github.com/users/simonw/received_events\\\",\\n+ \\\"type\\\": \\\"User\\\",\\n+ \\\"site_admin\\\": false\\n+ },\\n+ \\\"body\\\": \\\"Fixes #570\\\",\\n+ \\\"created_at\\\": \\\"2019-09-03T00:23:39Z\\\",\\n+ \\\"updated_at\\\": \\\"2019-09-03T00:32:28Z\\\",\\n+ \\\"closed_at\\\": \\\"2019-09-03T00:32:28Z\\\",\\n+ \\\"merged_at\\\": \\\"2019-09-03T00:32:28Z\\\",\\n+ \\\"merge_commit_sha\\\": \\\"2dc5c8dc259a0606162673d394ba8cc1c6f54428\\\",\\n+ \\\"assignee\\\": null,\\n+ \\\"assignees\\\": [\\n+\\n+ ],\\n+ \\\"requested_reviewers\\\": [\\n+\\n+ ],\\n+ \\\"requested_teams\\\": [\\n+\\n+ ],\\n+ \\\"labels\\\": [\\n+\\n+ ],\\n+ \\\"milestone\\\": null,\\n+ \\\"draft\\\": false,\\n+ \\\"commits_url\\\": \\\"https://api.github.com/repos/simonw/datasette/pulls/571/commits\\\",\\n+ \\\"review_comments_url\\\": \\\"https://api.github.com/repos/simonw/datasette/pulls/571/comments\\\",\\n+ \\\"review_comment_url\\\": \\\"https://api.github.com/repos/simonw/datasette/pulls/comments{/number}\\\",\\n+ \\\"comments_url\\\": \\\"https://api.github.com/repos/simonw/datasette/issues/571/comments\\\",\\n+ \\\"statuses_url\\\": \\\"https://api.github.com/repos/simonw/datasette/statuses/a85239f69261c10f1a9f90514c8b5d113cb94585\\\",\\n+ \\\"head\\\": {\\n+ \\\"label\\\": \\\"simonw:detect-fts\\\",\\n+ \\\"ref\\\": \\\"detect-fts\\\",\\n+ \\\"sha\\\": \\\"a85239f69261c10f1a9f90514c8b5d113cb94585\\\",\\n+ \\\"user\\\": {\\n+ \\\"login\\\": \\\"simonw\\\",\\n+ \\\"id\\\": 9599,\\n+ \\\"node_id\\\": \\\"MDQ6VXNlcjk1OTk=\\\",\\n+ \\\"avatar_url\\\": \\\"https://avatars0.githubusercontent.com/u/9599?v=4\\\",\\n+ \\\"gravatar_id\\\": \\\"\\\",\\n+ \\\"url\\\": \\\"https://api.github.com/users/simonw\\\",\\n+ \\\"html_url\\\": \\\"https://github.com/simonw\\\",\\n+ \\\"followers_url\\\": \\\"https://api.github.com/users/simonw/followers\\\",\\n+ \\\"following_url\\\": \\\"https://api.github.com/users/simonw/following{/other_user}\\\",\\n+ \\\"gists_url\\\": \\\"https://api.github.com/users/simonw/gists{/gist_id}\\\",\\n+ \\\"starred_url\\\": \\\"https://api.github.com/users/simonw/starred{/owner}{/repo}\\\",\\n+ \\\"subscriptions_url\\\": \\\"https://api.github.com/users/simonw/subscriptions\\\",\\n+ \\\"organizations_url\\\": \\\"https://api.github.com/users/simonw/orgs\\\",\\n+ \\\"repos_url\\\": \\\"https://api.github.com/users/simonw/repos\\\",\\n+ \\\"events_url\\\": \\\"https://api.github.com/users/simonw/events{/privacy}\\\",\\n+ \\\"received_events_url\\\": \\\"https://api.github.com/users/simonw/received_events\\\",\\n+ \\\"type\\\": \\\"User\\\",\\n+ \\\"site_admin\\\": false\\n+ },\\n+ \\\"repo\\\": {\\n+ \\\"id\\\": 107914493,\\n+ \\\"node_id\\\": \\\"MDEwOlJlcG9zaXRvcnkxMDc5MTQ0OTM=\\\",\\n+ \\\"name\\\": \\\"datasette\\\",\\n+ \\\"full_name\\\": \\\"simonw/datasette\\\",\\n+ \\\"private\\\": false,\\n+ \\\"owner\\\": {\\n+ \\\"login\\\": \\\"simonw\\\",\\n+ \\\"id\\\": 9599,\\n+ \\\"node_id\\\": \\\"MDQ6VXNlcjk1OTk=\\\",\\n+ \\\"avatar_url\\\": \\\"https://avatars0.githubusercontent.com/u/9599?v=4\\\",\\n+ \\\"gravatar_id\\\": \\\"\\\",\\n+ \\\"url\\\": \\\"https://api.github.com/users/simonw\\\",\\n+ \\\"html_url\\\": \\\"https://github.com/simonw\\\",\\n+ \\\"followers_url\\\": \\\"https://api.github.com/users/simonw/followers\\\",\\n+ \\\"following_url\\\": \\\"https://api.github.com/users/simonw/following{/other_user}\\\",\\n+ \\\"gists_url\\\": \\\"https://api.github.com/users/simonw/gists{/gist_id}\\\",\\n+ \\\"starred_url\\\": \\\"https://api.github.com/users/simonw/starred{/owner}{/repo}\\\",\\n+ \\\"subscriptions_url\\\": \\\"https://api.github.com/users/simonw/subscriptions\\\",\\n+ \\\"organizations_url\\\": \\\"https://api.github.com/users/simonw/orgs\\\",\\n+ \\\"repos_url\\\": \\\"https://api.github.com/users/simonw/repos\\\",\\n+ \\\"events_url\\\": \\\"https://api.github.com/users/simonw/events{/privacy}\\\",\\n+ \\\"received_events_url\\\": \\\"https://api.github.com/users/simonw/received_events\\\",\\n+ \\\"type\\\": \\\"User\\\",\\n+ \\\"site_admin\\\": false\\n+ },\\n+ \\\"html_url\\\": \\\"https://github.com/simonw/datasette\\\",\\n+ \\\"description\\\": \\\"An open source multi-tool for exploring and publishing data\\\",\\n+ \\\"fork\\\": false,\\n+ \\\"url\\\": \\\"https://api.github.com/repos/simonw/datasette\\\",\\n+ \\\"forks_url\\\": \\\"https://api.github.com/repos/simonw/datasette/forks\\\",\\n+ \\\"keys_url\\\": \\\"https://api.github.com/repos/simonw/datasette/keys{/key_id}\\\",\\n+ \\\"collaborators_url\\\": \\\"https://api.github.com/repos/simonw/datasette/collaborators{/collaborator}\\\",\\n+ \\\"teams_url\\\": \\\"https://api.github.com/repos/simonw/datasette/teams\\\",\\n+ \\\"hooks_url\\\": \\\"https://api.github.com/repos/simonw/datasette/hooks\\\",\\n+ \\\"issue_events_url\\\": \\\"https://api.github.com/repos/simonw/datasette/issues/events{/number}\\\",\\n+ \\\"events_url\\\": \\\"https://api.github.com/repos/simonw/datasette/events\\\",\\n+ \\\"assignees_url\\\": \\\"https://api.github.com/repos/simonw/datasette/assignees{/user}\\\",\\n+ \\\"branches_url\\\": \\\"https://api.github.com/repos/simonw/datasette/branches{/branch}\\\",\\n+ \\\"tags_url\\\": \\\"https://api.github.com/repos/simonw/datasette/tags\\\",\\n+ \\\"blobs_url\\\": \\\"https://api.github.com/repos/simonw/datasette/git/blobs{/sha}\\\",\\n+ \\\"git_tags_url\\\": \\\"https://api.github.com/repos/simonw/datasette/git/tags{/sha}\\\",\\n+ \\\"git_refs_url\\\": \\\"https://api.github.com/repos/simonw/datasette/git/refs{/sha}\\\",\\n+ \\\"trees_url\\\": \\\"https://api.github.com/repos/simonw/datasette/git/trees{/sha}\\\",\\n+ \\\"statuses_url\\\": \\\"https://api.github.com/repos/simonw/datasette/statuses/{sha}\\\",\\n+ \\\"languages_url\\\": \\\"https://api.github.com/repos/simonw/datasette/languages\\\",\\n+ \\\"stargazers_url\\\": \\\"https://api.github.com/repos/simonw/datasette/stargazers\\\",\\n+ \\\"contributors_url\\\": \\\"https://api.github.com/repos/simonw/datasette/contributors\\\",\\n+ \\\"subscribers_url\\\": \\\"https://api.github.com/repos/simonw/datasette/subscribers\\\",\\n+ \\\"subscription_url\\\": \\\"https://api.github.com/repos/simonw/datasette/subscription\\\",\\n+ \\\"commits_url\\\": \\\"https://api.github.com/repos/simonw/datasette/commits{/sha}\\\",\\n+ \\\"git_commits_url\\\": \\\"https://api.github.com/repos/simonw/datasette/git/commits{/sha}\\\",\\n+ \\\"comments_url\\\": \\\"https://api.github.com/repos/simonw/datasette/comments{/number}\\\",\\n+ \\\"issue_comment_url\\\": \\\"https://api.github.com/repos/simonw/datasette/issues/comments{/number}\\\",\\n+ \\\"contents_url\\\": \\\"https://api.github.com/repos/simonw/datasette/contents/{+path}\\\",\\n+ \\\"compare_url\\\": \\\"https://api.github.com/repos/simonw/datasette/compare/{base}...{head}\\\",\\n+ \\\"merges_url\\\": \\\"https://api.github.com/repos/simonw/datasette/merges\\\",\\n+ \\\"archive_url\\\": \\\"https://api.github.com/repos/simonw/datasette/{archive_format}{/ref}\\\",\\n+ \\\"downloads_url\\\": \\\"https://api.github.com/repos/simonw/datasette/downloads\\\",\\n+ \\\"issues_url\\\": \\\"https://api.github.com/repos/simonw/datasette/issues{/number}\\\",\\n+ \\\"pulls_url\\\": \\\"https://api.github.com/repos/simonw/datasette/pulls{/number}\\\",\\n+ \\\"milestones_url\\\": \\\"https://api.github.com/repos/simonw/datasette/milestones{/number}\\\",\\n+ \\\"notifications_url\\\": \\\"https://api.github.com/repos/simonw/datasette/notifications{?since,all,participating}\\\",\\n+ \\\"labels_url\\\": \\\"https://api.github.com/repos/simonw/datasette/labels{/name}\\\",\\n+ \\\"releases_url\\\": \\\"https://api.github.com/repos/simonw/datasette/releases{/id}\\\",\\n+ \\\"deployments_url\\\": \\\"https://api.github.com/repos/simonw/datasette/deployments\\\",\\n+ \\\"created_at\\\": \\\"2017-10-23T00:39:03Z\\\",\\n+ \\\"updated_at\\\": \\\"2020-07-27T20:42:15Z\\\",\\n+ \\\"pushed_at\\\": \\\"2020-07-26T01:21:05Z\\\",\\n+ \\\"git_url\\\": \\\"git://github.com/simonw/datasette.git\\\",\\n+ \\\"ssh_url\\\": \\\"git@github.com:simonw/datasette.git\\\",\\n+ \\\"clone_url\\\": \\\"https://github.com/simonw/datasette.git\\\",\\n+ \\\"svn_url\\\": \\\"https://github.com/simonw/datasette\\\",\\n+ \\\"homepage\\\": \\\"http://datasette.readthedocs.io/\\\",\\n+ \\\"size\\\": 3487,\\n+ \\\"stargazers_count\\\": 3642,\\n+ \\\"watchers_count\\\": 3642,\\n+ \\\"language\\\": \\\"Python\\\",\\n+ \\\"has_issues\\\": true,\\n+ \\\"has_projects\\\": false,\\n+ \\\"has_downloads\\\": true,\\n+ \\\"has_wiki\\\": true,\\n+ \\\"has_pages\\\": false,\\n+ \\\"forks_count\\\": 206,\\n+ \\\"mirror_url\\\": null,\\n+ \\\"archived\\\": false,\\n+ \\\"disabled\\\": false,\\n+ \\\"open_issues_count\\\": 190,\\n+ \\\"license\\\": {\\n+ \\\"key\\\": \\\"apache-2.0\\\",\\n+ \\\"name\\\": \\\"Apache License 2.0\\\",\\n+ \\\"spdx_id\\\": \\\"Apache-2.0\\\",\\n+ \\\"url\\\": \\\"https://api.github.com/licenses/apache-2.0\\\",\\n+ \\\"node_id\\\": \\\"MDc6TGljZW5zZTI=\\\"\\n+ },\\n+ \\\"forks\\\": 206,\\n+ \\\"open_issues\\\": 190,\\n+ \\\"watchers\\\": 3642,\\n+ \\\"default_branch\\\": \\\"master\\\"\\n+ }\\n+ },\\n+ \\\"base\\\": {\\n+ \\\"label\\\": \\\"simonw:master\\\",\\n+ \\\"ref\\\": \\\"master\\\",\\n+ \\\"sha\\\": \\\"f04deebec4f3842f7bd610cd5859de529f77d50e\\\",\\n+ \\\"user\\\": {\\n+ \\\"login\\\": \\\"simonw\\\",\\n+ \\\"id\\\": 9599,\\n+ \\\"node_id\\\": \\\"MDQ6VXNlcjk1OTk=\\\",\\n+ \\\"avatar_url\\\": \\\"https://avatars0.githubusercontent.com/u/9599?v=4\\\",\\n+ \\\"gravatar_id\\\": \\\"\\\",\\n+ \\\"url\\\": \\\"https://api.github.com/users/simonw\\\",\\n+ \\\"html_url\\\": \\\"https://github.com/simonw\\\",\\n+ \\\"followers_url\\\": \\\"https://api.github.com/users/simonw/followers\\\",\\n+ \\\"following_url\\\": \\\"https://api.github.com/users/simonw/following{/other_user}\\\",\\n+ \\\"gists_url\\\": \\\"https://api.github.com/users/simonw/gists{/gist_id}\\\",\\n+ \\\"starred_url\\\": \\\"https://api.github.com/users/simonw/starred{/owner}{/repo}\\\",\\n+ \\\"subscriptions_url\\\": \\\"https://api.github.com/users/simonw/subscriptions\\\",\\n+ \\\"organizations_url\\\": \\\"https://api.github.com/users/simonw/orgs\\\",\\n+ \\\"repos_url\\\": \\\"https://api.github.com/users/simonw/repos\\\",\\n+ \\\"events_url\\\": \\\"https://api.github.com/users/simonw/events{/privacy}\\\",\\n+ \\\"received_events_url\\\": \\\"https://api.github.com/users/simonw/received_events\\\",\\n+ \\\"type\\\": \\\"User\\\",\\n+ \\\"site_admin\\\": false\\n+ },\\n+ \\\"repo\\\": {\\n+ \\\"id\\\": 107914493,\\n+ \\\"node_id\\\": \\\"MDEwOlJlcG9zaXRvcnkxMDc5MTQ0OTM=\\\",\\n+ \\\"name\\\": \\\"datasette\\\",\\n+ \\\"full_name\\\": \\\"simonw/datasette\\\",\\n+ \\\"private\\\": false,\\n+ \\\"owner\\\": {\\n+ \\\"login\\\": \\\"simonw\\\",\\n+ \\\"id\\\": 9599,\\n+ \\\"node_id\\\": \\\"MDQ6VXNlcjk1OTk=\\\",\\n+ \\\"avatar_url\\\": \\\"https://avatars0.githubusercontent.com/u/9599?v=4\\\",\\n+ \\\"gravatar_id\\\": \\\"\\\",\\n+ \\\"url\\\": \\\"https://api.github.com/users/simonw\\\",\\n+ \\\"html_url\\\": \\\"https://github.com/simonw\\\",\\n+ \\\"followers_url\\\": \\\"https://api.github.com/users/simonw/followers\\\",\\n+ \\\"following_url\\\": \\\"https://api.github.com/users/simonw/following{/other_user}\\\",\\n+ \\\"gists_url\\\": \\\"https://api.github.com/users/simonw/gists{/gist_id}\\\",\\n+ \\\"starred_url\\\": \\\"https://api.github.com/users/simonw/starred{/owner}{/repo}\\\",\\n+ \\\"subscriptions_url\\\": \\\"https://api.github.com/users/simonw/subscriptions\\\",\\n+ \\\"organizations_url\\\": \\\"https://api.github.com/users/simonw/orgs\\\",\\n+ \\\"repos_url\\\": \\\"https://api.github.com/users/simonw/repos\\\",\\n+ \\\"events_url\\\": \\\"https://api.github.com/users/simonw/events{/privacy}\\\",\\n+ \\\"received_events_url\\\": \\\"https://api.github.com/users/simonw/received_events\\\",\\n+ \\\"type\\\": \\\"User\\\",\\n+ \\\"site_admin\\\": false\\n+ },\\n+ \\\"html_url\\\": \\\"https://github.com/simonw/datasette\\\",\\n+ \\\"description\\\": \\\"An open source multi-tool for exploring and publishing data\\\",\\n+ \\\"fork\\\": false,\\n+ \\\"url\\\": \\\"https://api.github.com/repos/simonw/datasette\\\",\\n+ \\\"forks_url\\\": \\\"https://api.github.com/repos/simonw/datasette/forks\\\",\\n+ \\\"keys_url\\\": \\\"https://api.github.com/repos/simonw/datasette/keys{/key_id}\\\",\\n+ \\\"collaborators_url\\\": \\\"https://api.github.com/repos/simonw/datasette/collaborators{/collaborator}\\\",\\n+ \\\"teams_url\\\": \\\"https://api.github.com/repos/simonw/datasette/teams\\\",\\n+ \\\"hooks_url\\\": \\\"https://api.github.com/repos/simonw/datasette/hooks\\\",\\n+ \\\"issue_events_url\\\": \\\"https://api.github.com/repos/simonw/datasette/issues/events{/number}\\\",\\n+ \\\"events_url\\\": \\\"https://api.github.com/repos/simonw/datasette/events\\\",\\n+ \\\"assignees_url\\\": \\\"https://api.github.com/repos/simonw/datasette/assignees{/user}\\\",\\n+ \\\"branches_url\\\": \\\"https://api.github.com/repos/simonw/datasette/branches{/branch}\\\",\\n+ \\\"tags_url\\\": \\\"https://api.github.com/repos/simonw/datasette/tags\\\",\\n+ \\\"blobs_url\\\": \\\"https://api.github.com/repos/simonw/datasette/git/blobs{/sha}\\\",\\n+ \\\"git_tags_url\\\": \\\"https://api.github.com/repos/simonw/datasette/git/tags{/sha}\\\",\\n+ \\\"git_refs_url\\\": \\\"https://api.github.com/repos/simonw/datasette/git/refs{/sha}\\\",\\n+ \\\"trees_url\\\": \\\"https://api.github.com/repos/simonw/datasette/git/trees{/sha}\\\",\\n+ \\\"statuses_url\\\": \\\"https://api.github.com/repos/simonw/datasette/statuses/{sha}\\\",\\n+ \\\"languages_url\\\": \\\"https://api.github.com/repos/simonw/datasette/languages\\\",\\n+ \\\"stargazers_url\\\": \\\"https://api.github.com/repos/simonw/datasette/stargazers\\\",\\n+ \\\"contributors_url\\\": \\\"https://api.github.com/repos/simonw/datasette/contributors\\\",\\n+ \\\"subscribers_url\\\": \\\"https://api.github.com/repos/simonw/datasette/subscribers\\\",\\n+ \\\"subscription_url\\\": \\\"https://api.github.com/repos/simonw/datasette/subscription\\\",\\n+ \\\"commits_url\\\": \\\"https://api.github.com/repos/simonw/datasette/commits{/sha}\\\",\\n+ \\\"git_commits_url\\\": \\\"https://api.github.com/repos/simonw/datasette/git/commits{/sha}\\\",\\n+ \\\"comments_url\\\": \\\"https://api.github.com/repos/simonw/datasette/comments{/number}\\\",\\n+ \\\"issue_comment_url\\\": \\\"https://api.github.com/repos/simonw/datasette/issues/comments{/number}\\\",\\n+ \\\"contents_url\\\": \\\"https://api.github.com/repos/simonw/datasette/contents/{+path}\\\",\\n+ \\\"compare_url\\\": \\\"https://api.github.com/repos/simonw/datasette/compare/{base}...{head}\\\",\\n+ \\\"merges_url\\\": \\\"https://api.github.com/repos/simonw/datasette/merges\\\",\\n+ \\\"archive_url\\\": \\\"https://api.github.com/repos/simonw/datasette/{archive_format}{/ref}\\\",\\n+ \\\"downloads_url\\\": \\\"https://api.github.com/repos/simonw/datasette/downloads\\\",\\n+ \\\"issues_url\\\": \\\"https://api.github.com/repos/simonw/datasette/issues{/number}\\\",\\n+ \\\"pulls_url\\\": \\\"https://api.github.com/repos/simonw/datasette/pulls{/number}\\\",\\n+ \\\"milestones_url\\\": \\\"https://api.github.com/repos/simonw/datasette/milestones{/number}\\\",\\n+ \\\"notifications_url\\\": \\\"https://api.github.com/repos/simonw/datasette/notifications{?since,all,participating}\\\",\\n+ \\\"labels_url\\\": \\\"https://api.github.com/repos/simonw/datasette/labels{/name}\\\",\\n+ \\\"releases_url\\\": \\\"https://api.github.com/repos/simonw/datasette/releases{/id}\\\",\\n+ \\\"deployments_url\\\": \\\"https://api.github.com/repos/simonw/datasette/deployments\\\",\\n+ \\\"created_at\\\": \\\"2017-10-23T00:39:03Z\\\",\\n+ \\\"updated_at\\\": \\\"2020-07-27T20:42:15Z\\\",\\n+ \\\"pushed_at\\\": \\\"2020-07-26T01:21:05Z\\\",\\n+ \\\"git_url\\\": \\\"git://github.com/simonw/datasette.git\\\",\\n+ \\\"ssh_url\\\": \\\"git@github.com:simonw/datasette.git\\\",\\n+ \\\"clone_url\\\": \\\"https://github.com/simonw/datasette.git\\\",\\n+ \\\"svn_url\\\": \\\"https://github.com/simonw/datasette\\\",\\n+ \\\"homepage\\\": \\\"http://datasette.readthedocs.io/\\\",\\n+ \\\"size\\\": 3487,\\n+ \\\"stargazers_count\\\": 3642,\\n+ \\\"watchers_count\\\": 3642,\\n+ \\\"language\\\": \\\"Python\\\",\\n+ \\\"has_issues\\\": true,\\n+ \\\"has_projects\\\": false,\\n+ \\\"has_downloads\\\": true,\\n+ \\\"has_wiki\\\": true,\\n+ \\\"has_pages\\\": false,\\n+ \\\"forks_count\\\": 206,\\n+ \\\"mirror_url\\\": null,\\n+ \\\"archived\\\": false,\\n+ \\\"disabled\\\": false,\\n+ \\\"open_issues_count\\\": 190,\\n+ \\\"license\\\": {\\n+ \\\"key\\\": \\\"apache-2.0\\\",\\n+ \\\"name\\\": \\\"Apache License 2.0\\\",\\n+ \\\"spdx_id\\\": \\\"Apache-2.0\\\",\\n+ \\\"url\\\": \\\"https://api.github.com/licenses/apache-2.0\\\",\\n+ \\\"node_id\\\": \\\"MDc6TGljZW5zZTI=\\\"\\n+ },\\n+ \\\"forks\\\": 206,\\n+ \\\"open_issues\\\": 190,\\n+ \\\"watchers\\\": 3642,\\n+ \\\"default_branch\\\": \\\"master\\\"\\n+ }\\n+ },\\n+ \\\"_links\\\": {\\n+ \\\"self\\\": {\\n+ \\\"href\\\": \\\"https://api.github.com/repos/simonw/datasette/pulls/571\\\"\\n+ },\\n+ \\\"html\\\": {\\n+ \\\"href\\\": \\\"https://github.com/simonw/datasette/pull/571\\\"\\n+ },\\n+ \\\"issue\\\": {\\n+ \\\"href\\\": \\\"https://api.github.com/repos/simonw/datasette/issues/571\\\"\\n+ },\\n+ \\\"comments\\\": {\\n+ \\\"href\\\": \\\"https://api.github.com/repos/simonw/datasette/issues/571/comments\\\"\\n+ },\\n+ \\\"review_comments\\\": {\\n+ \\\"href\\\": \\\"https://api.github.com/repos/simonw/datasette/pulls/571/comments\\\"\\n+ },\\n+ \\\"review_comment\\\": {\\n+ \\\"href\\\": \\\"https://api.github.com/repos/simonw/datasette/pulls/comments{/number}\\\"\\n+ },\\n+ \\\"commits\\\": {\\n+ \\\"href\\\": \\\"https://api.github.com/repos/simonw/datasette/pulls/571/commits\\\"\\n+ },\\n+ \\\"statuses\\\": {\\n+ \\\"href\\\": \\\"https://api.github.com/repos/simonw/datasette/statuses/a85239f69261c10f1a9f90514c8b5d113cb94585\\\"\\n+ }\\n+ },\\n+ \\\"author_association\\\": \\\"OWNER\\\",\\n+ \\\"active_lock_reason\\\": null,\\n+ \\\"merged\\\": true,\\n+ \\\"mergeable\\\": null,\\n+ \\\"rebaseable\\\": null,\\n+ \\\"mergeable_state\\\": \\\"unknown\\\",\\n+ \\\"merged_by\\\": {\",\r\n \"path\": \"tests/pull_requests.json\",\r\n \"position\": 342,\r\n \"original_position\": 342,\r\n \"commit_id\": \"3a0d5c498f9faae4e40aab204cd01b965a4f61f3\",\r\n \"user\": {\r\n \"login\": \"simonw\",\r\n \"id\": 9599,\r\n \"node_id\": \"MDQ6VXNlcjk1OTk=\",\r\n \"avatar_url\": \"https://avatars0.githubusercontent.com/u/9599?u=5968723deb1a55b82620e106f5ca58e9b11a0942&v=4\",\r\n \"gravatar_id\": \"\",\r\n \"url\": \"https://api.github.com/users/simonw\",\r\n \"html_url\": \"https://github.com/simonw\",\r\n \"followers_url\": \"https://api.github.com/users/simonw/followers\",\r\n \"following_url\": \"https://api.github.com/users/simonw/following{/other_user}\",\r\n \"gists_url\": \"https://api.github.com/users/simonw/gists{/gist_id}\",\r\n \"starred_url\": \"https://api.github.com/users/simonw/starred{/owner}{/repo}\",\r\n \"subscriptions_url\": \"https://api.github.com/users/simonw/subscriptions\",\r\n \"organizations_url\": \"https://api.github.com/users/simonw/orgs\",\r\n \"repos_url\": \"https://api.github.com/users/simonw/repos\",\r\n \"events_url\": \"https://api.github.com/users/simonw/events{/privacy}\",\r\n \"received_events_url\": \"https://api.github.com/users/simonw/received_events\",\r\n \"type\": \"User\",\r\n \"site_admin\": false\r\n },\r\n \"body\": \"Running this should create a `merged_by` column on the `pull_requests` table which is a foreign key to the `users` table.\",\r\n \"created_at\": \"2020-10-06T21:22:47Z\",\r\n \"updated_at\": \"2020-10-20T20:56:33Z\",\r\n \"html_url\": \"https://github.com/dogsheep/github-to-sqlite/pull/48#discussion_r500603838\",\r\n \"pull_request_url\": \"https://api.github.com/repos/dogsheep/github-to-sqlite/pulls/48\",\r\n \"author_association\": \"MEMBER\",\r\n \"_links\": {\r\n \"self\": {\r\n \"href\": \"https://api.github.com/repos/dogsheep/github-to-sqlite/pulls/comments/500603838\"\r\n },\r\n \"html\": {\r\n \"href\": \"https://github.com/dogsheep/github-to-sqlite/pull/48#discussion_r500603838\"\r\n },\r\n \"pull_request\": {\r\n \"href\": \"https://api.github.com/repos/dogsheep/github-to-sqlite/pulls/48\"\r\n }\r\n },\r\n \"original_commit_id\": \"4f33b850bd37829262dd29e1c520afffebedc19c\"\r\n },\r\n {\r\n \"id\": 500606198,\r\n \"node_id\": \"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDUwMDYwNjE5OA==\",\r\n \"url\": \"https://api.github.com/repos/dogsheep/github-to-sqlite/pulls/comments/500606198\",\r\n \"pull_request_review_id\": 503368921,\r\n \"diff_hunk\": \"@@ -0,0 +1,124 @@\\n+from github_to_sqlite import utils\\n+import pytest\\n+import pathlib\\n+import sqlite_utils\\n+from sqlite_utils.db import ForeignKey\\n+import json\\n+\\n+\\n+@pytest.fixture\\n+def pull_requests():\\n+ return json.load(open(pathlib.Path(__file__).parent / \\\"pull_requests.json\\\"))\\n+\\n+\\n+@pytest.fixture\\n+def db(pull_requests):\\n+ db = sqlite_utils.Database(memory=True)\\n+ db[\\\"repos\\\"].insert(\\n+ {\\\"id\\\": 1},\\n+ pk=\\\"id\\\",\\n+ columns={\\\"organization\\\": int, \\\"topics\\\": str, \\\"name\\\": str, \\\"description\\\": str},\\n+ )\\n+ utils.save_pull_requests(db, pull_requests, {\\\"id\\\": 1})\\n+ return db\\n+\\n+\\n+def test_tables(db):\\n+ assert {\\\"pull_requests\\\", \\\"users\\\", \\\"repos\\\", \\\"milestones\\\"} == set(\\n+ db.table_names()\\n+ )\\n+ assert {\\n+ ForeignKey(\\n+ table=\\\"pull_requests\\\", column=\\\"repo\\\", other_table=\\\"repos\\\", other_column=\\\"id\\\"\\n+ ),\\n+ ForeignKey(\\n+ table=\\\"pull_requests\\\",\\n+ column=\\\"milestone\\\",\\n+ other_table=\\\"milestones\\\",\\n+ other_column=\\\"id\\\",\\n+ ),\\n+ ForeignKey(\\n+ table=\\\"pull_requests\\\", column=\\\"assignee\\\", other_table=\\\"users\\\", other_column=\\\"id\\\"\\n+ ),\\n+ ForeignKey(\\n+ table=\\\"pull_requests\\\", column=\\\"user\\\", other_table=\\\"users\\\", other_column=\\\"id\\\"\\n+ ),\\n+ } == set(db[\\\"pull_requests\\\"].foreign_keys)\\n+\\n+\\n+def test_pull_requests(db):\\n+ pull_request_rows = list(db[\\\"pull_requests\\\"].rows)\\n+ assert [\\n+ {\\n+ 'id': 313384926,\\n+ 'node_id': 'MDExOlB1bGxSZXF1ZXN0MzEzMzg0OTI2',\\n+ 'number': 571,\\n+ 'state': 'closed',\\n+ 'locked': 0,\\n+ 'title': 'detect_fts now works with alternative table escaping',\\n+ 'user': 9599,\\n+ 'body': 'Fixes #570',\\n+ 'created_at': '2019-09-03T00:23:39Z',\\n+ 'updated_at': '2019-09-03T00:32:28Z',\\n+ 'closed_at': '2019-09-03T00:32:28Z',\\n+ 'merged_at': '2019-09-03T00:32:28Z',\\n+ 'merge_commit_sha': '2dc5c8dc259a0606162673d394ba8cc1c6f54428',\\n+ 'assignee': None,\\n+ 'milestone': None,\\n+ 'draft': 0,\\n+ 'head': 'a85239f69261c10f1a9f90514c8b5d113cb94585',\\n+ 'base': 'f04deebec4f3842f7bd610cd5859de529f77d50e',\\n+ 'author_association': 'OWNER',\\n+ 'merged': 1,\\n+ 'mergeable': None,\\n+ 'rebaseable': None,\\n+ 'mergeable_state': 'unknown',\\n+ 'merged_by': '{\\\"login\\\": \\\"simonw\\\", \\\"id\\\": 9599, \\\"node_id\\\": \\\"MDQ6VXNlcjk1OTk=\\\", \\\"avatar_url\\\": \\\"https://avatars0.githubusercontent.com/u/9599?v=4\\\", \\\"gravatar_id\\\": \\\"\\\", \\\"url\\\": \\\"https://api.github.com/users/simonw\\\", \\\"html_url\\\": \\\"https://github.com/simonw\\\", \\\"followers_url\\\": \\\"https://api.github.com/users/simonw/followers\\\", \\\"following_url\\\": \\\"https://api.github.com/users/simonw/following{/other_user}\\\", \\\"gists_url\\\": \\\"https://api.github.com/users/simonw/gists{/gist_id}\\\", \\\"starred_url\\\": \\\"https://api.github.com/users/simonw/starred{/owner}{/repo}\\\", \\\"subscriptions_url\\\": \\\"https://api.github.com/users/simonw/subscriptions\\\", \\\"organizations_url\\\": \\\"https://api.github.com/users/simonw/orgs\\\", \\\"repos_url\\\": \\\"https://api.github.com/users/simonw/repos\\\", \\\"events_url\\\": \\\"https://api.github.com/users/simonw/events{/privacy}\\\", \\\"received_events_url\\\": \\\"https://api.github.com/users/simonw/received_events\\\", \\\"type\\\": \\\"User\\\", \\\"site_admin\\\": false}',\",\r\n \"path\": \"tests/test_pull_requests.py\",\r\n \"position\": null,\r\n \"original_position\": 76,\r\n \"commit_id\": \"3a0d5c498f9faae4e40aab204cd01b965a4f61f3\",\r\n \"user\": {\r\n \"login\": \"simonw\",\r\n \"id\": 9599,\r\n \"node_id\": \"MDQ6VXNlcjk1OTk=\",\r\n \"avatar_url\": \"https://avatars0.githubusercontent.com/u/9599?u=5968723deb1a55b82620e106f5ca58e9b11a0942&v=4\",\r\n \"gravatar_id\": \"\",\r\n \"url\": \"https://api.github.com/users/simonw\",\r\n \"html_url\": \"https://github.com/simonw\",\r\n \"followers_url\": \"https://api.github.com/users/simonw/followers\",\r\n \"following_url\": \"https://api.github.com/users/simonw/following{/other_user}\",\r\n \"gists_url\": \"https://api.github.com/users/simonw/gists{/gist_id}\",\r\n \"starred_url\": \"https://api.github.com/users/simonw/starred{/owner}{/repo}\",\r\n \"subscriptions_url\": \"https://api.github.com/users/simonw/subscriptions\",\r\n \"organizations_url\": \"https://api.github.com/users/simonw/orgs\",\r\n \"repos_url\": \"https://api.github.com/users/simonw/repos\",\r\n \"events_url\": \"https://api.github.com/users/simonw/events{/privacy}\",\r\n \"received_events_url\": \"https://api.github.com/users/simonw/received_events\",\r\n \"type\": \"User\",\r\n \"site_admin\": false\r\n },\r\n \"body\": \"See above - this should be 9599, an integer reference to the row in the users table.\",\r\n \"created_at\": \"2020-10-06T21:27:43Z\",\r\n \"updated_at\": \"2020-10-20T20:56:33Z\",\r\n \"html_url\": \"https://github.com/dogsheep/github-to-sqlite/pull/48#discussion_r500606198\",\r\n \"pull_request_url\": \"https://api.github.com/repos/dogsheep/github-to-sqlite/pulls/48\",\r\n \"author_association\": \"MEMBER\",\r\n \"_links\": {\r\n \"self\": {\r\n \"href\": \"https://api.github.com/repos/dogsheep/github-to-sqlite/pulls/comments/500606198\"\r\n },\r\n \"html\": {\r\n \"href\": \"https://github.com/dogsheep/github-to-sqlite/pull/48#discussion_r500606198\"\r\n },\r\n \"pull_request\": {\r\n \"href\": \"https://api.github.com/repos/dogsheep/github-to-sqlite/pulls/48\"\r\n }\r\n },\r\n \"original_commit_id\": \"4f33b850bd37829262dd29e1c520afffebedc19c\"\r\n },\r\n {\r\n \"id\": 500606665,\r\n \"node_id\": \"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDUwMDYwNjY2NQ==\",\r\n \"url\": \"https://api.github.com/repos/dogsheep/github-to-sqlite/pulls/comments/500606665\",\r\n \"pull_request_review_id\": 503368921,\r\n \"diff_hunk\": \"@@ -0,0 +1,124 @@\\n+from github_to_sqlite import utils\\n+import pytest\\n+import pathlib\\n+import sqlite_utils\\n+from sqlite_utils.db import ForeignKey\\n+import json\\n+\\n+\\n+@pytest.fixture\\n+def pull_requests():\\n+ return json.load(open(pathlib.Path(__file__).parent / \\\"pull_requests.json\\\"))\\n+\\n+\\n+@pytest.fixture\\n+def db(pull_requests):\\n+ db = sqlite_utils.Database(memory=True)\\n+ db[\\\"repos\\\"].insert(\\n+ {\\\"id\\\": 1},\\n+ pk=\\\"id\\\",\\n+ columns={\\\"organization\\\": int, \\\"topics\\\": str, \\\"name\\\": str, \\\"description\\\": str},\\n+ )\\n+ utils.save_pull_requests(db, pull_requests, {\\\"id\\\": 1})\\n+ return db\\n+\\n+\\n+def test_tables(db):\\n+ assert {\\\"pull_requests\\\", \\\"users\\\", \\\"repos\\\", \\\"milestones\\\"} == set(\\n+ db.table_names()\\n+ )\\n+ assert {\\n+ ForeignKey(\\n+ table=\\\"pull_requests\\\", column=\\\"repo\\\", other_table=\\\"repos\\\", other_column=\\\"id\\\"\\n+ ),\\n+ ForeignKey(\\n+ table=\\\"pull_requests\\\",\\n+ column=\\\"milestone\\\",\\n+ other_table=\\\"milestones\\\",\\n+ other_column=\\\"id\\\",\\n+ ),\\n+ ForeignKey(\\n+ table=\\\"pull_requests\\\", column=\\\"assignee\\\", other_table=\\\"users\\\", other_column=\\\"id\\\"\\n+ ),\\n+ ForeignKey(\\n+ table=\\\"pull_requests\\\", column=\\\"user\\\", other_table=\\\"users\\\", other_column=\\\"id\\\"\\n+ ),\\n+ } == set(db[\\\"pull_requests\\\"].foreign_keys)\\n+\\n+\\n+def test_pull_requests(db):\\n+ pull_request_rows = list(db[\\\"pull_requests\\\"].rows)\\n+ assert [\\n+ {\\n+ 'id': 313384926,\",\r\n \"path\": \"tests/test_pull_requests.py\",\r\n \"position\": null,\r\n \"original_position\": 53,\r\n \"commit_id\": \"3a0d5c498f9faae4e40aab204cd01b965a4f61f3\",\r\n \"user\": {\r\n \"login\": \"simonw\",\r\n \"id\": 9599,\r\n \"node_id\": \"MDQ6VXNlcjk1OTk=\",\r\n \"avatar_url\": \"https://avatars0.githubusercontent.com/u/9599?u=5968723deb1a55b82620e106f5ca58e9b11a0942&v=4\",\r\n \"gravatar_id\": \"\",\r\n \"url\": \"https://api.github.com/users/simonw\",\r\n \"html_url\": \"https://github.com/simonw\",\r\n \"followers_url\": \"https://api.github.com/users/simonw/followers\",\r\n \"following_url\": \"https://api.github.com/users/simonw/following{/other_user}\",\r\n \"gists_url\": \"https://api.github.com/users/simonw/gists{/gist_id}\",\r\n \"starred_url\": \"https://api.github.com/users/simonw/starred{/owner}{/repo}\",\r\n \"subscriptions_url\": \"https://api.github.com/users/simonw/subscriptions\",\r\n \"organizations_url\": \"https://api.github.com/users/simonw/orgs\",\r\n \"repos_url\": \"https://api.github.com/users/simonw/repos\",\r\n \"events_url\": \"https://api.github.com/users/simonw/events{/privacy}\",\r\n \"received_events_url\": \"https://api.github.com/users/simonw/received_events\",\r\n \"type\": \"User\",\r\n \"site_admin\": false\r\n },\r\n \"body\": \"Minor detail: I use Black for this repo, which requires double quotes - running \\\"black .\\\" in the root directory (with the latest version of Black) should handle this for you.\",\r\n \"created_at\": \"2020-10-06T21:28:31Z\",\r\n \"updated_at\": \"2020-10-20T20:56:33Z\",\r\n \"html_url\": \"https://github.com/dogsheep/github-to-sqlite/pull/48#discussion_r500606665\",\r\n \"pull_request_url\": \"https://api.github.com/repos/dogsheep/github-to-sqlite/pulls/48\",\r\n \"author_association\": \"MEMBER\",\r\n \"_links\": {\r\n \"self\": {\r\n \"href\": \"https://api.github.com/repos/dogsheep/github-to-sqlite/pulls/comments/500606665\"\r\n },\r\n \"html\": {\r\n \"href\": \"https://github.com/dogsheep/github-to-sqlite/pull/48#discussion_r500606665\"\r\n },\r\n \"pull_request\": {\r\n \"href\": \"https://api.github.com/repos/dogsheep/github-to-sqlite/pulls/48\"\r\n }\r\n },\r\n \"original_commit_id\": \"4f33b850bd37829262dd29e1c520afffebedc19c\"\r\n }\r\n]\r\n```\r\nThat's a lot more interesting.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 664485022, "label": "Feature: pull request reviews and comments"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/issues/46#issuecomment-735482546", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/46", "id": 735482546, "node_id": "MDEyOklzc3VlQ29tbWVudDczNTQ4MjU0Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-30T00:22:02Z", "updated_at": "2020-11-30T00:22:02Z", "author_association": "MEMBER", "body": "As for reviews... here's the output of `github-to-sqlite get https://api.github.com/repos/dogsheep/github-to-sqlite/pulls/48/reviews --accept 'application/vnd.github.v3+json'`\r\n\r\n```json\r\n[\r\n {\r\n \"id\": 503368921,\r\n \"node_id\": \"MDE3OlB1bGxSZXF1ZXN0UmV2aWV3NTAzMzY4OTIx\",\r\n \"user\": {\r\n \"login\": \"simonw\",\r\n \"id\": 9599,\r\n \"node_id\": \"MDQ6VXNlcjk1OTk=\",\r\n \"avatar_url\": \"https://avatars0.githubusercontent.com/u/9599?u=5968723deb1a55b82620e106f5ca58e9b11a0942&v=4\",\r\n \"gravatar_id\": \"\",\r\n \"url\": \"https://api.github.com/users/simonw\",\r\n \"html_url\": \"https://github.com/simonw\",\r\n \"followers_url\": \"https://api.github.com/users/simonw/followers\",\r\n \"following_url\": \"https://api.github.com/users/simonw/following{/other_user}\",\r\n \"gists_url\": \"https://api.github.com/users/simonw/gists{/gist_id}\",\r\n \"starred_url\": \"https://api.github.com/users/simonw/starred{/owner}{/repo}\",\r\n \"subscriptions_url\": \"https://api.github.com/users/simonw/subscriptions\",\r\n \"organizations_url\": \"https://api.github.com/users/simonw/orgs\",\r\n \"repos_url\": \"https://api.github.com/users/simonw/repos\",\r\n \"events_url\": \"https://api.github.com/users/simonw/events{/privacy}\",\r\n \"received_events_url\": \"https://api.github.com/users/simonw/received_events\",\r\n \"type\": \"User\",\r\n \"site_admin\": false\r\n },\r\n \"body\": \"\",\r\n \"state\": \"CHANGES_REQUESTED\",\r\n \"html_url\": \"https://github.com/dogsheep/github-to-sqlite/pull/48#pullrequestreview-503368921\",\r\n \"pull_request_url\": \"https://api.github.com/repos/dogsheep/github-to-sqlite/pulls/48\",\r\n \"author_association\": \"MEMBER\",\r\n \"_links\": {\r\n \"html\": {\r\n \"href\": \"https://github.com/dogsheep/github-to-sqlite/pull/48#pullrequestreview-503368921\"\r\n },\r\n \"pull_request\": {\r\n \"href\": \"https://api.github.com/repos/dogsheep/github-to-sqlite/pulls/48\"\r\n }\r\n },\r\n \"submitted_at\": \"2020-10-06T21:28:40Z\",\r\n \"commit_id\": \"4f33b850bd37829262dd29e1c520afffebedc19c\"\r\n },\r\n {\r\n \"id\": 513118561,\r\n \"node_id\": \"MDE3OlB1bGxSZXF1ZXN0UmV2aWV3NTEzMTE4NTYx\",\r\n \"user\": {\r\n \"login\": \"adamjonas\",\r\n \"id\": 755825,\r\n \"node_id\": \"MDQ6VXNlcjc1NTgyNQ==\",\r\n \"avatar_url\": \"https://avatars1.githubusercontent.com/u/755825?v=4\",\r\n \"gravatar_id\": \"\",\r\n \"url\": \"https://api.github.com/users/adamjonas\",\r\n \"html_url\": \"https://github.com/adamjonas\",\r\n \"followers_url\": \"https://api.github.com/users/adamjonas/followers\",\r\n \"following_url\": \"https://api.github.com/users/adamjonas/following{/other_user}\",\r\n \"gists_url\": \"https://api.github.com/users/adamjonas/gists{/gist_id}\",\r\n \"starred_url\": \"https://api.github.com/users/adamjonas/starred{/owner}{/repo}\",\r\n \"subscriptions_url\": \"https://api.github.com/users/adamjonas/subscriptions\",\r\n \"organizations_url\": \"https://api.github.com/users/adamjonas/orgs\",\r\n \"repos_url\": \"https://api.github.com/users/adamjonas/repos\",\r\n \"events_url\": \"https://api.github.com/users/adamjonas/events{/privacy}\",\r\n \"received_events_url\": \"https://api.github.com/users/adamjonas/received_events\",\r\n \"type\": \"User\",\r\n \"site_admin\": false\r\n },\r\n \"body\": \"\",\r\n \"state\": \"COMMENTED\",\r\n \"html_url\": \"https://github.com/dogsheep/github-to-sqlite/pull/48#pullrequestreview-513118561\",\r\n \"pull_request_url\": \"https://api.github.com/repos/dogsheep/github-to-sqlite/pulls/48\",\r\n \"author_association\": \"CONTRIBUTOR\",\r\n \"_links\": {\r\n \"html\": {\r\n \"href\": \"https://github.com/dogsheep/github-to-sqlite/pull/48#pullrequestreview-513118561\"\r\n },\r\n \"pull_request\": {\r\n \"href\": \"https://api.github.com/repos/dogsheep/github-to-sqlite/pulls/48\"\r\n }\r\n },\r\n \"submitted_at\": \"2020-10-20T20:45:05Z\",\r\n \"commit_id\": \"4f33b850bd37829262dd29e1c520afffebedc19c\"\r\n },\r\n {\r\n \"id\": 513127529,\r\n \"node_id\": \"MDE3OlB1bGxSZXF1ZXN0UmV2aWV3NTEzMTI3NTI5\",\r\n \"user\": {\r\n \"login\": \"adamjonas\",\r\n \"id\": 755825,\r\n \"node_id\": \"MDQ6VXNlcjc1NTgyNQ==\",\r\n \"avatar_url\": \"https://avatars1.githubusercontent.com/u/755825?v=4\",\r\n \"gravatar_id\": \"\",\r\n \"url\": \"https://api.github.com/users/adamjonas\",\r\n \"html_url\": \"https://github.com/adamjonas\",\r\n \"followers_url\": \"https://api.github.com/users/adamjonas/followers\",\r\n \"following_url\": \"https://api.github.com/users/adamjonas/following{/other_user}\",\r\n \"gists_url\": \"https://api.github.com/users/adamjonas/gists{/gist_id}\",\r\n \"starred_url\": \"https://api.github.com/users/adamjonas/starred{/owner}{/repo}\",\r\n \"subscriptions_url\": \"https://api.github.com/users/adamjonas/subscriptions\",\r\n \"organizations_url\": \"https://api.github.com/users/adamjonas/orgs\",\r\n \"repos_url\": \"https://api.github.com/users/adamjonas/repos\",\r\n \"events_url\": \"https://api.github.com/users/adamjonas/events{/privacy}\",\r\n \"received_events_url\": \"https://api.github.com/users/adamjonas/received_events\",\r\n \"type\": \"User\",\r\n \"site_admin\": false\r\n },\r\n \"body\": \"\",\r\n \"state\": \"COMMENTED\",\r\n \"html_url\": \"https://github.com/dogsheep/github-to-sqlite/pull/48#pullrequestreview-513127529\",\r\n \"pull_request_url\": \"https://api.github.com/repos/dogsheep/github-to-sqlite/pulls/48\",\r\n \"author_association\": \"CONTRIBUTOR\",\r\n \"_links\": {\r\n \"html\": {\r\n \"href\": \"https://github.com/dogsheep/github-to-sqlite/pull/48#pullrequestreview-513127529\"\r\n },\r\n \"pull_request\": {\r\n \"href\": \"https://api.github.com/repos/dogsheep/github-to-sqlite/pulls/48\"\r\n }\r\n },\r\n \"submitted_at\": \"2020-10-20T20:57:33Z\",\r\n \"commit_id\": \"3a0d5c498f9faae4e40aab204cd01b965a4f61f3\"\r\n }\r\n]\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 664485022, "label": "Feature: pull request reviews and comments"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/issues/46#issuecomment-735482187", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/46", "id": 735482187, "node_id": "MDEyOklzc3VlQ29tbWVudDczNTQ4MjE4Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-30T00:20:11Z", "updated_at": "2020-11-30T00:20:11Z", "author_association": "MEMBER", "body": "Pull request are now added, thanks to @adamjonas.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 664485022, "label": "Feature: pull request reviews and comments"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/issues/54#issuecomment-735465708", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/54", "id": 735465708, "node_id": "MDEyOklzc3VlQ29tbWVudDczNTQ2NTcwOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-29T22:08:46Z", "updated_at": "2020-11-29T22:08:46Z", "author_association": "MEMBER", "body": "Demo:\r\n- https://github-to-sqlite.dogsheep.net/github/steps?_facet=repo\r\n- https://github-to-sqlite.dogsheep.net/github/workflows\r\n- https://github-to-sqlite.dogsheep.net/github/jobs", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 753026003, "label": "github-to-sqlite workflows command"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/issues/54#issuecomment-735464438", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/54", "id": 735464438, "node_id": "MDEyOklzc3VlQ29tbWVudDczNTQ2NDQzOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-29T21:57:08Z", "updated_at": "2020-11-29T21:57:08Z", "author_association": "MEMBER", "body": "Inspired by this tweet from Michael Heap https://twitter.com/mheap/status/1333108608817631238", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 753026003, "label": "github-to-sqlite workflows command"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/issues/54#issuecomment-735464493", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/54", "id": 735464493, "node_id": "MDEyOklzc3VlQ29tbWVudDczNTQ2NDQ5Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-29T21:57:32Z", "updated_at": "2020-11-29T21:57:32Z", "author_association": "MEMBER", "body": "`$ github-to-sqlite workflows github.db simonw/datasette dogsheep/github-to-sqlite`", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 753026003, "label": "github-to-sqlite workflows command"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/swarm-to-sqlite/issues/11#issuecomment-727692413", "issue_url": "https://api.github.com/repos/dogsheep/swarm-to-sqlite/issues/11", "id": 727692413, "node_id": "MDEyOklzc3VlQ29tbWVudDcyNzY5MjQxMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-16T02:15:22Z", "updated_at": "2020-11-16T02:15:22Z", "author_association": "MEMBER", "body": "Thanks, I'll look into this.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 743400216, "label": "Error thrown: sqlite3.OperationalError: table users has no column named lastName"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-beta/issues/29#issuecomment-712266834", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/29", "id": 712266834, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMjI2NjgzNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-19T16:01:23Z", "updated_at": "2020-10-19T16:01:23Z", "author_association": "MEMBER", "body": "Might just be a documented pattern for how to configure this in YAML templates.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 724759588, "label": "Add search highlighting snippets"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/issues/50#issuecomment-711569063", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/50", "id": 711569063, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMTU2OTA2Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-19T05:01:29Z", "updated_at": "2020-10-19T05:01:29Z", "author_association": "MEMBER", "body": "Demo of `--accept`:\r\n\r\n github-to-sqlite get /repos/simonw/datasette/readme --accept 'application/vnd.github.VERSION.html'\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 703218756, "label": "Commands for making authenticated API calls"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-beta/issues/28#issuecomment-711089647", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/28", "id": 711089647, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMTA4OTY0Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-17T22:43:13Z", "updated_at": "2020-10-17T22:43:13Z", "author_association": "MEMBER", "body": "Since my personal Dogsheep uses Datasette authentication, I'm going to need to pass through cookies. https://github.com/simonw/datasette/issues/1020 will solve that in the future but for now I need to solve it explicitly.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 723861683, "label": "Switch to using datasette.client"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/healthkit-to-sqlite/issues/11#issuecomment-711081703", "issue_url": "https://api.github.com/repos/dogsheep/healthkit-to-sqlite/issues/11", "id": 711081703, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMTA4MTcwMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-17T21:18:35Z", "updated_at": "2020-10-17T21:18:35Z", "author_association": "MEMBER", "body": "OK, if you upgrade to the just-released 1.0 this should work (it worked against my Spanish export).", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 723838331, "label": "export.xml file name varies with different language settings"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/healthkit-to-sqlite/issues/11#issuecomment-711079760", "issue_url": "https://api.github.com/repos/dogsheep/healthkit-to-sqlite/issues/11", "id": 711079760, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMTA3OTc2MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-17T21:00:05Z", "updated_at": "2020-10-17T21:00:05Z", "author_association": "MEMBER", "body": "Checking for either `\r\n\"\r\nTEMPLATE = \"\"\"\r\n
{}
\r\n\"\"\".strip()\r\n\r\nEN_MEDIA_SCRIPT = \"\"\"\r\nArray.from(document.querySelectorAll('en-media')).forEach(el => {\r\n let hash = el.getAttribute('hash');\r\n let type = el.getAttribute('type');\r\n let path = `/evernote/resources_data/${hash}.json?_shape=array`;\r\n fetch(path).then(r => r.json()).then(rows => {\r\n let b64 = rows[0].data.encoded;\r\n let data = `data:${type};base64,${b64}`;\r\n el.innerHTML = ``;\r\n });\r\n});\r\n\"\"\"\r\n\r\n\r\n@hookimpl\r\ndef render_cell(value, table):\r\n if not table:\r\n # Don't render content from arbitrary SQL queries, could be XSS hole\r\n return\r\n if not value or not isinstance(value, str):\r\n return\r\n value = value.strip()\r\n if value.startswith(START) and value.endswith(END):\r\n trimmed = value[len(START) : -len(END)]\r\n trimmed = trimmed.split(\">\", 1)[1]\r\n # Replace those horrible double newlines\r\n trimmed = trimmed.replace(\"

\", \"
\")\r\n return jinja2.Markup(TEMPLATE.format(trimmed))\r\n\r\n\r\n@hookimpl\r\ndef extra_body_script():\r\n return EN_MEDIA_SCRIPT\r\n```\r\nIt works!\r\n\r\nIt does however demonstrate that Evernote's \"clip this webpage\" feature means there is a LOT of weird HTML that can get into a note. It looks like they've filtered out the scripts but I wouldn't bet on it - they certainly don't filter out many of the inline styles. So running Bleach is almost certainly a good idea.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 718938889, "label": "Figure out how to display images from tags inline in Datasette"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/evernote-to-sqlite/issues/4#issuecomment-706786548", "issue_url": "https://api.github.com/repos/dogsheep/evernote-to-sqlite/issues/4", "id": 706786548, "node_id": "MDEyOklzc3VlQ29tbWVudDcwNjc4NjU0OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-11T23:39:46Z", "updated_at": "2020-10-11T23:39:46Z", "author_association": "MEMBER", "body": "Should have used porter stemming for this.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 718938508, "label": "Configure FTS + add an index on the date columns"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/evernote-to-sqlite/issues/6#issuecomment-706785201", "issue_url": "https://api.github.com/repos/dogsheep/evernote-to-sqlite/issues/6", "id": 706785201, "node_id": "MDEyOklzc3VlQ29tbWVudDcwNjc4NTIwMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-11T23:29:39Z", "updated_at": "2020-10-11T23:29:39Z", "author_association": "MEMBER", "body": "It looks to me like each of those `` blocks has a number of guesses in order of confidence:\r\n```xml\r\n \r\n wonders,\r\n wanders,\r\n wonders ?\r\n wonders\r\n wonders.\r\n \r\n```\r\nSo maybe the best approach here is to just take the first `t` element within each `item`.\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 718949182, "label": "Better handling of OCR data"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/evernote-to-sqlite/issues/6#issuecomment-706785086", "issue_url": "https://api.github.com/repos/dogsheep/evernote-to-sqlite/issues/6", "id": 706785086, "node_id": "MDEyOklzc3VlQ29tbWVudDcwNjc4NTA4Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-11T23:28:50Z", "updated_at": "2020-10-11T23:28:50Z", "author_association": "MEMBER", "body": "The XML for the OCR stuff is a bit weird. Currently I'm doing this to it:\r\n\r\nhttps://github.com/dogsheep/evernote-to-sqlite/blob/c33d7b043a45eb3e88676e5fa3ce31755199d9f8/evernote_to_sqlite/utils.py#L70-L78\r\n\r\nThis can produce some odd results, for example:\r\n\r\n> Sure 'Sure, 'Sure. Sure, Sure. sure sure. sure ? If you If Yau [you live jive In m 1n an area devoid of natural wonders, wanders, wonders ? wonders wonders. your mind will be blown, blown' blown. blown ? -e i ? ,1 IL it ? at ? KY ? fl ft bat at\r\n\r\nWhich came from this image:\r\n\r\n![image](https://user-images.githubusercontent.com/9599/95692952-5dd7c880-0bde-11eb-939a-d10b800a4105.png)\r\n\r\nThe XML for that is:\r\n\r\n```xml\r\n\r\n \r\n Sure\r\n 'Sure,\r\n 'Sure.\r\n Sure,\r\n Sure.\r\n \r\n \r\n sure\r\n sure.\r\n sure ?\r\n \r\n \r\n If you\r\n If Yau\r\n [you\r\n \r\n \r\n live\r\n jive\r\n \r\n \r\n In\r\n m\r\n 1n\r\n \r\n \r\n an\r\n \r\n \r\n area\r\n \r\n \r\n devoid\r\n \r\n \r\n of\r\n \r\n \r\n natural\r\n \r\n \r\n wonders,\r\n wanders,\r\n wonders ?\r\n wonders\r\n wonders.\r\n \r\n \r\n your\r\n \r\n \r\n mind\r\n \r\n \r\n will\r\n \r\n \r\n be\r\n \r\n \r\n blown,\r\n blown'\r\n blown.\r\n blown ?\r\n \r\n \r\n -e\r\n \r\n \r\n i ?\r\n \r\n \r\n ,1\r\n \r\n \r\n IL\r\n \r\n \r\n it ?\r\n at ?\r\n KY ?\r\n \r\n \r\n fl\r\n ft\r\n bat\r\n at\r\n \r\n\r\n```\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 718949182, "label": "Better handling of OCR data"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/evernote-to-sqlite/issues/4#issuecomment-706784028", "issue_url": "https://api.github.com/repos/dogsheep/evernote-to-sqlite/issues/4", "id": 706784028, "node_id": "MDEyOklzc3VlQ29tbWVudDcwNjc4NDAyOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-11T23:20:32Z", "updated_at": "2020-10-11T23:20:32Z", "author_association": "MEMBER", "body": "I haven't done the FTS on OCR yet. I'm going to move that to another ticket because it requires more thought.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 718938508, "label": "Configure FTS + add an index on the date columns"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/evernote-to-sqlite/issues/5#issuecomment-706776808", "issue_url": "https://api.github.com/repos/dogsheep/evernote-to-sqlite/issues/5", "id": 706776808, "node_id": "MDEyOklzc3VlQ29tbWVudDcwNjc3NjgwOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-11T22:23:14Z", "updated_at": "2020-10-11T22:23:14Z", "author_association": "MEMBER", "body": "... but it's still important to be able to get to the rendered note directly from the browse notes `/evernote/notes` page. Maybe use a simple `render_cell()` hook that just knows how to generate the link to the rendered note page?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 718938889, "label": "Figure out how to display images from tags inline in Datasette"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/evernote-to-sqlite/issues/5#issuecomment-706776680", "issue_url": "https://api.github.com/repos/dogsheep/evernote-to-sqlite/issues/5", "id": 706776680, "node_id": "MDEyOklzc3VlQ29tbWVudDcwNjc3NjY4MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-11T22:22:16Z", "updated_at": "2020-10-11T22:22:16Z", "author_association": "MEMBER", "body": "Maybe the best way do this is with a custom route, `/-/evernote/note-id` - that way I can clean the HTML and resolve the other things in the `` structure without using `render_cell()` and the like. My concern about using `render_cell()` is that it could lead to weird security problems when combined with `?sql=` queries.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 718938889, "label": "Figure out how to display images from tags inline in Datasette"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/evernote-to-sqlite/issues/5#issuecomment-706776447", "issue_url": "https://api.github.com/repos/dogsheep/evernote-to-sqlite/issues/5", "id": 706776447, "node_id": "MDEyOklzc3VlQ29tbWVudDcwNjc3NjQ0Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-11T22:20:32Z", "updated_at": "2020-10-11T22:20:32Z", "author_association": "MEMBER", "body": "Or... I could do this client-side. JavaScript that looks for `` tags and fetches the data using `fetch()` wouldn't be too hard to write.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 718938889, "label": "Figure out how to display images from tags inline in Datasette"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/evernote-to-sqlite/issues/5#issuecomment-706776242", "issue_url": "https://api.github.com/repos/dogsheep/evernote-to-sqlite/issues/5", "id": 706776242, "node_id": "MDEyOklzc3VlQ29tbWVudDcwNjc3NjI0Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-11T22:18:30Z", "updated_at": "2020-10-11T22:19:48Z", "author_association": "MEMBER", "body": "Alternatively, rather than relying on `datasette-media` this could base64-embed the images. `evernote-to-sqlite` could register itself as a Datasette plugin that knows how to do this.\r\n\r\nMaybe rename the column to `evernote_content` and register a render cell hook that knows how to rewrite those note bodies so that they are visible?\r\n\r\nMight need to feed them through Bleach too, just in case any nasty code can get into them.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 718938889, "label": "Figure out how to display images from tags inline in Datasette"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/evernote-to-sqlite/issues/5#issuecomment-706776180", "issue_url": "https://api.github.com/repos/dogsheep/evernote-to-sqlite/issues/5", "id": 706776180, "node_id": "MDEyOklzc3VlQ29tbWVudDcwNjc3NjE4MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-11T22:17:55Z", "updated_at": "2020-10-11T22:17:55Z", "author_association": "MEMBER", "body": "We could even do server-side thumbnailing for some of these images, but I'm inclined to serve up the full size ones and set a width on the image element based on the `width` attribute on ``.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 718938889, "label": "Figure out how to display images from tags inline in Datasette"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/evernote-to-sqlite/issues/1#issuecomment-706775706", "issue_url": "https://api.github.com/repos/dogsheep/evernote-to-sqlite/issues/1", "id": 706775706, "node_id": "MDEyOklzc3VlQ29tbWVudDcwNjc3NTcwNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-11T22:14:00Z", "updated_at": "2020-10-11T22:14:00Z", "author_association": "MEMBER", "body": "A live demo would be good too.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 718934942, "label": "Documentation on how to use this with Datasette"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/pull/48#issuecomment-704553385", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/48", "id": 704553385, "node_id": "MDEyOklzc3VlQ29tbWVudDcwNDU1MzM4NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-06T21:07:44Z", "updated_at": "2020-10-06T21:07:44Z", "author_association": "MEMBER", "body": "Sorry for not looking at this sooner, trying it out now - pull request looks great!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 681228542, "label": "Add pull requests"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/google-takeout-to-sqlite/pull/5#issuecomment-790695126", "issue_url": "https://api.github.com/repos/dogsheep/google-takeout-to-sqlite/issues/5", "id": 790695126, "node_id": "MDEyOklzc3VlQ29tbWVudDc5MDY5NTEyNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-04T15:20:42Z", "updated_at": "2021-03-04T15:20:42Z", "author_association": "MEMBER", "body": "I'm not sure why but my most recent import, when displayed in Datasette, looks like this:\r\n\r\n\"mbox__mbox_emails__753_446_rows\"\r\n\r\nSorting by `id` in the opposite order gives me the data I would expect - so it looks like a bunch of null/blank messages are being imported at some point and showing up first due to ID ordering.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 813880401, "label": "WIP: Add Gmail takeout mbox import"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/google-takeout-to-sqlite/pull/5#issuecomment-790693674", "issue_url": "https://api.github.com/repos/dogsheep/google-takeout-to-sqlite/issues/5", "id": 790693674, "node_id": "MDEyOklzc3VlQ29tbWVudDc5MDY5MzY3NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-04T15:18:36Z", "updated_at": "2021-03-04T15:18:36Z", "author_association": "MEMBER", "body": "I imported my 10GB mbox with 750,000 emails in it, ran this tool (with a hacked fix for the blob column problem) - and now a search that returns 92 results takes 25.37ms! This is fantastic.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 813880401, "label": "WIP: Add Gmail takeout mbox import"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/google-takeout-to-sqlite/pull/5#issuecomment-790669767", "issue_url": "https://api.github.com/repos/dogsheep/google-takeout-to-sqlite/issues/5", "id": 790669767, "node_id": "MDEyOklzc3VlQ29tbWVudDc5MDY2OTc2Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-04T14:46:06Z", "updated_at": "2021-03-04T14:46:06Z", "author_association": "MEMBER", "body": "Solution could be to pre-process that string by splitting on `(` and dropping everything afterwards, assuming that the `(...)` bit isn't necessary for correctly parsing the date.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 813880401, "label": "WIP: Add Gmail takeout mbox import"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/google-takeout-to-sqlite/pull/5#issuecomment-790668263", "issue_url": "https://api.github.com/repos/dogsheep/google-takeout-to-sqlite/issues/5", "id": 790668263, "node_id": "MDEyOklzc3VlQ29tbWVudDc5MDY2ODI2Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-04T14:43:58Z", "updated_at": "2021-03-04T14:43:58Z", "author_association": "MEMBER", "body": "I added this code to output a message ID on errors:\r\n```diff\r\n print(\"Errors: {}\".format(num_errors))\r\n print(traceback.format_exc())\r\n+ print(\"Message-Id: {}\".format(email.get(\"Message-Id\", \"None\")))\r\n continue\r\n```\r\nHaving found a message ID that had an error, I ran this command to see the context:\r\n\r\n rg --text --context 20 '44F289B0.000001.02100@SCHWARZE-DWFXMI' ~/gmail.mbox\r\n\r\nThis was for the following error:\r\n```\r\n File \"/Users/simon/Dropbox/Development/google-takeout-to-sqlite/google_takeout_to_sqlite/utils.py\", line 102, in get_mbox\r\n message[\"date\"] = get_message_date(email.get(\"Date\"), email.get_from())\r\n File \"/Users/simon/Dropbox/Development/google-takeout-to-sqlite/google_takeout_to_sqlite/utils.py\", line 178, in get_message_date\r\n datetime_tuple = email.utils.parsedate_tz(mail_date)\r\n File \"/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/email/_parseaddr.py\", line 50, in parsedate_tz\r\n res = _parsedate_tz(data)\r\n File \"/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/email/_parseaddr.py\", line 69, in _parsedate_tz\r\n data = data.split()\r\nAttributeError: 'Header' object has no attribute 'split'\r\n```\r\nHere's what I spotted in the `ripgrep` output:\r\n```\r\n177133570:Message-Id: <44F289B0.000001.02100@SCHWARZE-DWFXMI>\r\n177133571-Date: Mon, 28 Aug 2006 08:14:08 +0200 (Westeurop\ufffdische Sommerzeit)\r\n177133572-X-Mailer: IncrediMail (5002253)\r\n```\r\nSo it could it be that `_parsedate_tz` is having trouble with that `Mon, 28 Aug 2006 08:14:08 +0200 (Westeurop\ufffdische Sommerzeit)` string.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 813880401, "label": "WIP: Add Gmail takeout mbox import"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/google-takeout-to-sqlite/pull/5#issuecomment-790312268", "issue_url": "https://api.github.com/repos/dogsheep/google-takeout-to-sqlite/issues/5", "id": 790312268, "node_id": "MDEyOklzc3VlQ29tbWVudDc5MDMxMjI2OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-04T05:48:16Z", "updated_at": "2021-03-04T05:48:16Z", "author_association": "MEMBER", "body": "Wow, my mbox is a 10.35 GB download!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 813880401, "label": "WIP: Add Gmail takeout mbox import"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/google-takeout-to-sqlite/issues/6#issuecomment-790384087", "issue_url": "https://api.github.com/repos/dogsheep/google-takeout-to-sqlite/issues/6", "id": 790384087, "node_id": "MDEyOklzc3VlQ29tbWVudDc5MDM4NDA4Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-04T07:22:51Z", "updated_at": "2021-03-04T07:22:51Z", "author_association": "MEMBER", "body": "#3 also mentions the conflicting version with other tools.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 821841046, "label": "Upgrade to latest sqlite-utils"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/google-takeout-to-sqlite/pull/5#issuecomment-790380839", "issue_url": "https://api.github.com/repos/dogsheep/google-takeout-to-sqlite/issues/5", "id": 790380839, "node_id": "MDEyOklzc3VlQ29tbWVudDc5MDM4MDgzOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-04T07:17:05Z", "updated_at": "2021-03-04T07:17:05Z", "author_association": "MEMBER", "body": "Looks like you're doing this:\r\n```python\r\n elif message.get_content_type() == \"text/plain\":\r\n body = message.get_payload(decode=True)\r\n```\r\nSo presumably that decodes to a unicode string?\r\n\r\nI imagine the reason the column is a `BLOB` for me is that `sqlite-utils` determines the column type based on the first batch of items - https://github.com/simonw/sqlite-utils/blob/09c3386f55f766b135b6a1c00295646c4ae29bec/sqlite_utils/db.py#L1927-L1928 - and I got unlucky and had something in my first batch that wasn't a unicode string.\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 813880401, "label": "WIP: Add Gmail takeout mbox import"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/google-takeout-to-sqlite/pull/5#issuecomment-790379629", "issue_url": "https://api.github.com/repos/dogsheep/google-takeout-to-sqlite/issues/5", "id": 790379629, "node_id": "MDEyOklzc3VlQ29tbWVudDc5MDM3OTYyOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-04T07:14:41Z", "updated_at": "2021-03-04T07:14:41Z", "author_association": "MEMBER", "body": "Confirmed: removing the `len()` call does not speed things up, so it's reading through the entire file for some other purpose too.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 813880401, "label": "WIP: Add Gmail takeout mbox import"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/google-takeout-to-sqlite/pull/5#issuecomment-790378658", "issue_url": "https://api.github.com/repos/dogsheep/google-takeout-to-sqlite/issues/5", "id": 790378658, "node_id": "MDEyOklzc3VlQ29tbWVudDc5MDM3ODY1OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-04T07:12:48Z", "updated_at": "2021-03-04T07:12:48Z", "author_association": "MEMBER", "body": "It looks like the `body` is being loaded into a BLOB column - so in Datasette default it looks like this:\r\n\r\n\"mbox__mbox_emails__753_446_rows\"\r\n\r\nIf I `datasette install datasette-render-binary` and then try again I get this:\r\n\r\n\"mbox__mbox_emails__753_446_rows\"\r\n\r\nIt would be great if we could store the `body` as unicode text instead. May have to do something clever to decode it based on some kind of charset header?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 813880401, "label": "WIP: Add Gmail takeout mbox import"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/google-takeout-to-sqlite/pull/5#issuecomment-790373024", "issue_url": "https://api.github.com/repos/dogsheep/google-takeout-to-sqlite/issues/5", "id": 790373024, "node_id": "MDEyOklzc3VlQ29tbWVudDc5MDM3MzAyNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-04T07:01:58Z", "updated_at": "2021-03-04T07:04:06Z", "author_association": "MEMBER", "body": "I got 9 warnings that look like this:\r\n```\r\nErrors: 1\r\nTraceback (most recent call last):\r\n File \"/Users/simon/Dropbox/Development/google-takeout-to-sqlite/google_takeout_to_sqlite/utils.py\", line 103, in get_mbox\r\n message[\"date\"] = get_message_date(email.get(\"Date\"), email.get_from())\r\n File \"/Users/simon/Dropbox/Development/google-takeout-to-sqlite/google_takeout_to_sqlite/utils.py\", line 167, in get_message_date\r\n datetime_tuple = email.utils.parsedate_tz(mail_date)\r\n File \"/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/email/_parseaddr.py\", line 50, in parsedate_tz\r\n res = _parsedate_tz(data)\r\n File \"/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/email/_parseaddr.py\", line 69, in _parsedate_tz\r\n data = data.split()\r\nAttributeError: 'Header' object has no attribute 'split'\r\n```\r\nIt would be useful if those warnings told me the message ID (or similar) of the affected message so I could grep for it in the `mbox` and see what was going on.\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 813880401, "label": "WIP: Add Gmail takeout mbox import"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/google-takeout-to-sqlite/pull/5#issuecomment-790372621", "issue_url": "https://api.github.com/repos/dogsheep/google-takeout-to-sqlite/issues/5", "id": 790372621, "node_id": "MDEyOklzc3VlQ29tbWVudDc5MDM3MjYyMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-04T07:01:18Z", "updated_at": "2021-03-04T07:01:18Z", "author_association": "MEMBER", "body": "I'm not sure if it would work, but there is an alternative pattern for showing a progress bar against a really large file that I've used in `healthkit-to-sqlite` - you set the progress bar size to the size of the file in bytes, then update a counter as you read the file.\r\n\r\nhttps://github.com/dogsheep/healthkit-to-sqlite/blob/3eb2b06bfe3b4faaf10e9cf9dfcb28e3d16c14ff/healthkit_to_sqlite/cli.py#L24-L57 and https://github.com/dogsheep/healthkit-to-sqlite/blob/3eb2b06bfe3b4faaf10e9cf9dfcb28e3d16c14ff/healthkit_to_sqlite/utils.py#L4-L19 (the `progress_callback()` bit) is where that happens.\r\n\r\nIt can be a bit of a convoluted pattern, and I'm not at all sure it would work for `mbox` files since it looks like that library has other reasons it needs to do a file scan rather than streaming it through one chunk of bytes at a time. So I imagine this would not work here.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 813880401, "label": "WIP: Add Gmail takeout mbox import"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/google-takeout-to-sqlite/pull/5#issuecomment-790370485", "issue_url": "https://api.github.com/repos/dogsheep/google-takeout-to-sqlite/issues/5", "id": 790370485, "node_id": "MDEyOklzc3VlQ29tbWVudDc5MDM3MDQ4NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-04T06:57:25Z", "updated_at": "2021-03-04T06:57:48Z", "author_association": "MEMBER", "body": "The command takes quite a while to start running, presumably because this line causes it to have to scan the WHOLE file in order to generate a count:\r\n\r\nhttps://github.com/dogsheep/google-takeout-to-sqlite/blob/a3de045eba0fae4b309da21aa3119102b0efc576/google_takeout_to_sqlite/utils.py#L66-L67\r\n\r\nI'm fine with waiting though. It's not like this is a command people run every day - and without that count we can't show a progress bar, which seems pretty important for a process that takes this long.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 813880401, "label": "WIP: Add Gmail takeout mbox import"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/google-takeout-to-sqlite/pull/5#issuecomment-790369076", "issue_url": "https://api.github.com/repos/dogsheep/google-takeout-to-sqlite/issues/5", "id": 790369076, "node_id": "MDEyOklzc3VlQ29tbWVudDc5MDM2OTA3Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-04T06:54:46Z", "updated_at": "2021-03-04T06:54:46Z", "author_association": "MEMBER", "body": "The Rich-powered progress bar is pretty:\r\n\r\n![rich](https://user-images.githubusercontent.com/9599/109923307-71f69200-7c73-11eb-9ee2-8f0a240f3994.gif)\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 813880401, "label": "WIP: Add Gmail takeout mbox import"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/google-takeout-to-sqlite/pull/5#issuecomment-786925280", "issue_url": "https://api.github.com/repos/dogsheep/google-takeout-to-sqlite/issues/5", "id": 786925280, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NjkyNTI4MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-26T22:23:10Z", "updated_at": "2021-02-26T22:23:10Z", "author_association": "MEMBER", "body": "Thanks!\r\n\r\nI requested my Gmail export from takeout - once that arrives I'll test it against this and then merge the PR.", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 813880401, "label": "WIP: Add Gmail takeout mbox import"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/evernote-to-sqlite/pull/10#issuecomment-777839351", "issue_url": "https://api.github.com/repos/dogsheep/evernote-to-sqlite/issues/10", "id": 777839351, "node_id": "MDEyOklzc3VlQ29tbWVudDc3NzgzOTM1MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-11T22:37:55Z", "updated_at": "2021-02-11T22:37:55Z", "author_association": "MEMBER", "body": "I've merged these changes by hand now, thanks!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 770712149, "label": "BugFix for encoding and not update info."}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/evernote-to-sqlite/issues/7#issuecomment-777827396", "issue_url": "https://api.github.com/repos/dogsheep/evernote-to-sqlite/issues/7", "id": 777827396, "node_id": "MDEyOklzc3VlQ29tbWVudDc3NzgyNzM5Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-11T22:13:14Z", "updated_at": "2021-02-11T22:13:14Z", "author_association": "MEMBER", "body": "My best guess is that you have an older version of `sqlite-utils` installed here - the `replace=True` argument was added in version 2.0. I've bumped the dependency in `setup.py`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 743297582, "label": "evernote-to-sqlite on windows 10 give this error: TypeError: insert() got an unexpected keyword argument 'replace'"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/evernote-to-sqlite/issues/9#issuecomment-777821383", "issue_url": "https://api.github.com/repos/dogsheep/evernote-to-sqlite/issues/9", "id": 777821383, "node_id": "MDEyOklzc3VlQ29tbWVudDc3NzgyMTM4Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-11T22:01:28Z", "updated_at": "2021-02-11T22:01:28Z", "author_association": "MEMBER", "body": "Aha! I think I've figured out what's going on here.\r\n\r\nThe CData blocks containing the notes look like this:\r\n\r\n`
This note includes two images.

...`\r\n\r\nThe DTD at http://xml.evernote.com/pub/enml2.dtd includes some entities:\r\n\r\n```\r\n\r\n\r\n\r\n%HTMLlat1;\r\n\r\n\r\n%HTMLsymbol;\r\n\r\n\r\n%HTMLspecial;\r\n```\r\nSo I need to be able to handle all of those different entities. I think I can do that using `html.entities.entitydefs` from the Python standard library, which looks a bit like this:\r\n\r\n```python\r\n{'Aacute': '\u00c1',\r\n 'aacute': '\u00e1',\r\n 'Aacute;': '\u00c1',\r\n 'aacute;': '\u00e1',\r\n 'Abreve;': '\u0102',\r\n 'abreve;': '\u0103',\r\n 'ac;': '\u223e',\r\n 'acd;': '\u223f',\r\n# ...\r\n}\r\n```\r\n\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 748372469, "label": "ParseError: undefined entity š"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/evernote-to-sqlite/issues/11#issuecomment-777798330", "issue_url": "https://api.github.com/repos/dogsheep/evernote-to-sqlite/issues/11", "id": 777798330, "node_id": "MDEyOklzc3VlQ29tbWVudDc3Nzc5ODMzMA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-11T21:18:58Z", "updated_at": "2021-02-11T21:18:58Z", "author_association": "MEMBER", "body": "Thanks for the fix!", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 792851444, "label": "XML parse error"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/issues/60#issuecomment-770071568", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/60", "id": 770071568, "node_id": "MDEyOklzc3VlQ29tbWVudDc3MDA3MTU2OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-29T21:56:15Z", "updated_at": "2021-01-29T21:56:15Z", "author_association": "MEMBER", "body": "I really like the way you're using pipes here - really smart. It's similar to how I build the demo database in this GitHub Actions workflow:\r\n\r\nhttps://github.com/dogsheep/github-to-sqlite/blob/62dfd3bc4014b108200001ef4bc746feb6f33b45/.github/workflows/deploy-demo.yml#L52-L82\r\n\r\n`twitter-to-sqlite` actually has a mechanism for doing this kind of thing, documented at https://github.com/dogsheep/twitter-to-sqlite#providing-input-from-a-sql-query-with---sql-and---attach\r\n\r\nIt lets you do things like:\r\n\r\n```\r\n$ twitter-to-sqlite users-lookup my.db --sql=\"select follower_id from following\" --ids\r\n```\r\nMaybe I should add something similar to `github-to-sqlite`? Feels like it could be really useful.", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 797097140, "label": "Use Data from SQLite in other commands"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/twitter-to-sqlite/issues/56#issuecomment-769957751", "issue_url": "https://api.github.com/repos/dogsheep/twitter-to-sqlite/issues/56", "id": 769957751, "node_id": "MDEyOklzc3VlQ29tbWVudDc2OTk1Nzc1MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-29T17:59:40Z", "updated_at": "2021-01-29T17:59:40Z", "author_association": "MEMBER", "body": "This is interesting - how did you create that initial table? Was this using the `twitter-to-sqlite import archive.db ~/Downloads/twitter-2019-06-25-b31f2.zip` command, or something else?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 796736607, "label": "Not all quoted statuses get fetched?"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/swarm-to-sqlite/issues/11#issuecomment-761967094", "issue_url": "https://api.github.com/repos/dogsheep/swarm-to-sqlite/issues/11", "id": 761967094, "node_id": "MDEyOklzc3VlQ29tbWVudDc2MTk2NzA5NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-18T04:11:13Z", "updated_at": "2021-01-18T04:11:13Z", "author_association": "MEMBER", "body": "I just got a similar error:\r\n\r\n```\r\n File \"/home/dogsheep/datasette-venv/lib/python3.8/site-packages/swarm_to_sqlite/utils.py\", line 79, in save_checkin\r\n checkins_table.m2m(\"users\", user, m2m_table=\"with\", pk=\"id\")\r\n File \"/home/dogsheep/datasette-venv/lib/python3.8/site-packages/sqlite_utils/db.py\", line 2048, in m2m\r\n id = other_table.insert(record, pk=pk, replace=True).last_pk\r\n File \"/home/dogsheep/datasette-venv/lib/python3.8/site-packages/sqlite_utils/db.py\", line 1781, in insert\r\n return self.insert_all(\r\n File \"/home/dogsheep/datasette-venv/lib/python3.8/site-packages/sqlite_utils/db.py\", line 1899, in insert_all\r\n self.insert_chunk(\r\n File \"/home/dogsheep/datasette-venv/lib/python3.8/site-packages/sqlite_utils/db.py\", line 1709, in insert_chunk\r\n result = self.db.execute(query, params)\r\n File \"/home/dogsheep/datasette-venv/lib/python3.8/site-packages/sqlite_utils/db.py\", line 226, in execute\r\n return self.conn.execute(sql, parameters)\r\npysqlite3.dbapi2.OperationalError: table users has no column named countryCode\r\n\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 743400216, "label": "Error thrown: sqlite3.OperationalError: table users has no column named lastName"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-beta/issues/31#issuecomment-748426877", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/31", "id": 748426877, "node_id": "MDEyOklzc3VlQ29tbWVudDc0ODQyNjg3Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-19T06:16:11Z", "updated_at": "2020-12-19T06:16:11Z", "author_association": "MEMBER", "body": "Here's why:\r\n\r\n if \"fts5\" in str(e):\r\n\r\nBut the error being raised here is:\r\n\r\n sqlite3.OperationalError: no such column: to\r\n\r\nI'm going to attempt the escaped on on every error.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 771316301, "label": "Searching for \"github-to-sqlite\" throws an error"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-beta/issues/31#issuecomment-748426663", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/31", "id": 748426663, "node_id": "MDEyOklzc3VlQ29tbWVudDc0ODQyNjY2Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-19T06:14:06Z", "updated_at": "2020-12-19T06:14:06Z", "author_association": "MEMBER", "body": "Looks like I already do that here: https://github.com/dogsheep/dogsheep-beta/blob/9ba4401017ac24ffa3bc1db38e0910ea49de7616/dogsheep_beta/__init__.py#L141-L146", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 771316301, "label": "Searching for \"github-to-sqlite\" throws an error"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-beta/issues/31#issuecomment-748426501", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/31", "id": 748426501, "node_id": "MDEyOklzc3VlQ29tbWVudDc0ODQyNjUwMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-19T06:12:22Z", "updated_at": "2020-12-19T06:12:22Z", "author_association": "MEMBER", "body": "I deliberately added support for advanced FTS in https://github.com/dogsheep/dogsheep-beta/commit/cbb2491b85d7ff416d6d429b60109e6c2d6d50b9 for #13 but that's the cause of this bug.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 771316301, "label": "Searching for \"github-to-sqlite\" throws an error"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-beta/issues/31#issuecomment-748426581", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/31", "id": 748426581, "node_id": "MDEyOklzc3VlQ29tbWVudDc0ODQyNjU4MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-19T06:13:17Z", "updated_at": "2020-12-19T06:13:17Z", "author_association": "MEMBER", "body": "One fix for this could be to try running the raw query, but if it throws an error run it again with the query escaped.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 771316301, "label": "Searching for \"github-to-sqlite\" throws an error"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/google-takeout-to-sqlite/issues/2#issuecomment-747126777", "issue_url": "https://api.github.com/repos/dogsheep/google-takeout-to-sqlite/issues/2", "id": 747126777, "node_id": "MDEyOklzc3VlQ29tbWVudDc0NzEyNjc3Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-17T00:36:52Z", "updated_at": "2020-12-17T00:36:52Z", "author_association": "MEMBER", "body": "The memory profiler tricks I used in https://github.com/dogsheep/healthkit-to-sqlite/issues/7 could help figure out what's going on here.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 769376447, "label": "killed by oomkiller on large location-history"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-beta/issues/29#issuecomment-747034481", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/29", "id": 747034481, "node_id": "MDEyOklzc3VlQ29tbWVudDc0NzAzNDQ4MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-16T21:17:05Z", "updated_at": "2020-12-16T21:17:05Z", "author_association": "MEMBER", "body": "I'm just going to add `q` for the moment.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 724759588, "label": "Add search highlighting snippets"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-beta/issues/29#issuecomment-747031608", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/29", "id": 747031608, "node_id": "MDEyOklzc3VlQ29tbWVudDc0NzAzMTYwOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-16T21:15:18Z", "updated_at": "2020-12-16T21:15:18Z", "author_association": "MEMBER", "body": "Should I pass any other details to the `display_sql` here as well?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 724759588, "label": "Add search highlighting snippets"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-beta/issues/29#issuecomment-747030964", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/29", "id": 747030964, "node_id": "MDEyOklzc3VlQ29tbWVudDc0NzAzMDk2NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-16T21:14:54Z", "updated_at": "2020-12-16T21:14:54Z", "author_association": "MEMBER", "body": "To do this I'll need the search term to be passed to the `display_sql` SQL query:\r\nhttps://github.com/dogsheep/dogsheep-beta/blob/4890ec87b5e2ec48940f32c9ad1f5aae25c75a4d/dogsheep_beta/__init__.py#L164-L171", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 724759588, "label": "Add search highlighting snippets"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-beta/issues/29#issuecomment-747029636", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-beta/issues/29", "id": 747029636, "node_id": "MDEyOklzc3VlQ29tbWVudDc0NzAyOTYzNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-16T21:14:03Z", "updated_at": "2020-12-16T21:14:03Z", "author_association": "MEMBER", "body": "I think I can do this as a cunning trick in `display_sql`. Consider this example query: https://til.simonwillison.net/tils?sql=select%0D%0A++path%2C%0D%0A++snippet%28til_fts%2C+-1%2C+%27b4de2a49c8%27%2C+%278c94a2ed4b%27%2C+%27...%27%2C+60%29+as+snippet%0D%0Afrom%0D%0A++til%0D%0A++join+til_fts+on+til.rowid+%3D+til_fts.rowid%0D%0Awhere%0D%0A++til_fts+match+escape_fts%28%3Aq%29%0D%0A++and+path+%3D+%27asgi_lifespan-test-httpx.md%27%0D%0A&q=pytest\r\n\r\n```sql\r\nselect\r\n path,\r\n snippet(til_fts, -1, 'b4de2a49c8', '8c94a2ed4b', '...', 60) as snippet\r\nfrom\r\n til\r\n join til_fts on til.rowid = til_fts.rowid\r\nwhere\r\n til_fts match escape_fts(:q)\r\n and path = 'asgi_lifespan-test-httpx.md'\r\n```\r\nThe `and path = 'asgi_lifespan-test-httpx.md'` bit means we only get back a specific document - but the snippet highlighting is applied to it.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 724759588, "label": "Add search highlighting snippets"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/issues/58#issuecomment-746735889", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/58", "id": 746735889, "node_id": "MDEyOklzc3VlQ29tbWVudDc0NjczNTg4OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-16T17:59:50Z", "updated_at": "2020-12-16T17:59:50Z", "author_association": "MEMBER", "body": "I don't want to add a full HTML parser (like BeautifulSoup) as a dependency for this feature. Since the HTML comes from a single, trusted source (GitHub) I could probably handle this using [regular expressions](https://stackoverflow.com/a/1732454).", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 769150394, "label": "Readme HTML has broken internal links"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/github-to-sqlite/issues/58#issuecomment-746734412", "issue_url": "https://api.github.com/repos/dogsheep/github-to-sqlite/issues/58", "id": 746734412, "node_id": "MDEyOklzc3VlQ29tbWVudDc0NjczNDQxMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-16T17:58:56Z", "updated_at": "2020-12-16T17:58:56Z", "author_association": "MEMBER", "body": "I'm going to rewrite those `` links to `` - but only if a corresponding `id=\"user-content-filtering-tables\"` element exists.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 769150394, "label": "Readme HTML has broken internal links"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/20#issuecomment-633704127", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/20", "id": 633704127, "node_id": "MDEyOklzc3VlQ29tbWVudDYzMzcwNDEyNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-25T20:14:22Z", "updated_at": "2020-05-25T20:14:22Z", "author_association": "MEMBER", "body": "https://github.com/dogsheep/dogsheep-photos/blob/0.4.1/README.md#serving-photos-locally-with-datasette-media", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 613006393, "label": "Ability to serve thumbnailed Apple Photo from its place on disk"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/20#issuecomment-633629944", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/20", "id": 633629944, "node_id": "MDEyOklzc3VlQ29tbWVudDYzMzYyOTk0NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-25T15:47:42Z", "updated_at": "2020-05-25T15:47:42Z", "author_association": "MEMBER", "body": "I'll add a proper section to the README, but for the moment here's how I do this.\r\n\r\nFirst, install `datasette` and the `datasette-media` plugin.\r\n\r\nCreate a `metadata.yaml` file with the following content:\r\n\r\n```yaml\r\nplugins:\r\n datasette-media:\r\n photo:\r\n sql: |-\r\n select path as filepath, 200 as resize_height from apple_photos where uuid = :key\r\n photo-big:\r\n sql: |-\r\n select path as filepath, 1024 as resize_height from apple_photos where uuid = :key\r\n```\r\nNow run `datasette -m metadata.yaml photos.db` - thumbnails will be served at http://127.0.0.1:8001/-/media/photo/F4469918-13F3-43D8-9EC1-734C0E6B60AD and larger sizes of the image at http://127.0.0.1:8001/-/media/photo-big/A8B02C7D-365E-448B-9510-69F80C26304D\r\n\r\nI also made myself two custom pages, one showing recent images and one showing random images.\r\n\r\nTo do this, install the `datasette-template-sql` plugin and then create a `templates/pages` directory and add these files:\r\n\r\n`recent-photos.html`\r\n```html\r\n

Recent photos

\r\n\r\n
\r\n{% for photo in sql(\"select * from apple_photos order by date desc limit 100\") %}\r\n \r\n{% endfor %}\r\n
\r\n```\r\n\r\n`random-photos.html`\r\n```html\r\n

Random photos

\r\n\r\n
\r\n{% for photo in sql(\"with foo as (select * from apple_photos order by date desc limit 5000) select * from foo order by random() limit 100\") %}\r\n \r\n{% endfor %}\r\n
\r\n```\r\n\r\nNow run `datasette -m metadata.yaml photos.db --template-dir=templates/`\r\n\r\nVisit http://127.0.0.1:8001/random-photos to see some random photos or http://127.0.0.1:8002/recent-photos for recent photos.\r\n\r\nThis is using this mechanism: https://datasette.readthedocs.io/en/stable/custom_templates.html#custom-pages", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 613006393, "label": "Ability to serve thumbnailed Apple Photo from its place on disk"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/20#issuecomment-633626741", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/20", "id": 633626741, "node_id": "MDEyOklzc3VlQ29tbWVudDYzMzYyNjc0MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-25T15:38:55Z", "updated_at": "2020-05-25T15:38:55Z", "author_association": "MEMBER", "body": "Sure, I should absolutely document this!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 613006393, "label": "Ability to serve thumbnailed Apple Photo from its place on disk"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/20#issuecomment-633644225", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/20", "id": 633644225, "node_id": "MDEyOklzc3VlQ29tbWVudDYzMzY0NDIyNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-25T16:30:44Z", "updated_at": "2020-05-25T16:30:44Z", "author_association": "MEMBER", "body": "I'll add docs on using `datasette-json-html` too.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 613006393, "label": "Ability to serve thumbnailed Apple Photo from its place on disk"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/20#issuecomment-633643921", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/20", "id": 633643921, "node_id": "MDEyOklzc3VlQ29tbWVudDYzMzY0MzkyMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-25T16:29:44Z", "updated_at": "2020-05-25T16:29:44Z", "author_association": "MEMBER", "body": "https://github.com/dogsheep/dogsheep-photos/blob/dc43fa8653cb9c7238a36f52239b91d1ec916d5c/README.md#serving-photos-locally-with-datasette-media", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 613006393, "label": "Ability to serve thumbnailed Apple Photo from its place on disk"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/26#issuecomment-631229409", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/26", "id": 631229409, "node_id": "MDEyOklzc3VlQ29tbWVudDYzMTIyOTQwOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-20T04:30:40Z", "updated_at": "2020-05-20T04:30:40Z", "author_association": "MEMBER", "body": "https://pypi.org/project/photos-to-sqlite/ now links to dogsheep-photos.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 621444763, "label": "Rename project to dogsheep-photos"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/26#issuecomment-631229485", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/26", "id": 631229485, "node_id": "MDEyOklzc3VlQ29tbWVudDYzMTIyOTQ4NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-20T04:31:02Z", "updated_at": "2020-05-20T04:31:02Z", "author_association": "MEMBER", "body": "https://pypi.org/project/dogsheep-photos/ is live.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 621444763, "label": "Rename project to dogsheep-photos"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/26#issuecomment-631227245", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/26", "id": 631227245, "node_id": "MDEyOklzc3VlQ29tbWVudDYzMTIyNzI0NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-20T04:21:38Z", "updated_at": "2020-05-20T04:21:38Z", "author_association": "MEMBER", "body": "I'm going to release 0.4 now.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 621444763, "label": "Rename project to dogsheep-photos"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/26#issuecomment-631227105", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/26", "id": 631227105, "node_id": "MDEyOklzc3VlQ29tbWVudDYzMTIyNzEwNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-20T04:21:06Z", "updated_at": "2020-05-20T04:21:06Z", "author_association": "MEMBER", "body": "Then I just need to push a final photos-to-sqlite release that updates the README to tell people about the name change.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 621444763, "label": "Rename project to dogsheep-photos"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/26#issuecomment-631227020", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/26", "id": 631227020, "node_id": "MDEyOklzc3VlQ29tbWVudDYzMTIyNzAyMA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-20T04:20:48Z", "updated_at": "2020-05-20T04:21:16Z", "author_association": "MEMBER", "body": "Next time I push a release it will create `dogsheep-photos` on PyPI.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 621444763, "label": "Rename project to dogsheep-photos"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/26#issuecomment-631226953", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/26", "id": 631226953, "node_id": "MDEyOklzc3VlQ29tbWVudDYzMTIyNjk1Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-20T04:20:34Z", "updated_at": "2020-05-20T04:20:34Z", "author_association": "MEMBER", "body": "Huh, it looks like Circle CI picked up the name change automatically. https://app.circleci.com/pipelines/github/dogsheep/dogsheep-photos", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 621444763, "label": "Rename project to dogsheep-photos"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/26#issuecomment-631226572", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/26", "id": 631226572, "node_id": "MDEyOklzc3VlQ29tbWVudDYzMTIyNjU3Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-20T04:18:52Z", "updated_at": "2020-05-20T04:18:52Z", "author_association": "MEMBER", "body": "Need to reconfigure Circle CI.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 621444763, "label": "Rename project to dogsheep-photos"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/26#issuecomment-631226481", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/26", "id": 631226481, "node_id": "MDEyOklzc3VlQ29tbWVudDYzMTIyNjQ4MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-20T04:18:29Z", "updated_at": "2020-05-20T04:18:29Z", "author_association": "MEMBER", "body": "I just renamed the repository.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 621444763, "label": "Rename project to dogsheep-photos"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/24#issuecomment-631255206", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/24", "id": 631255206, "node_id": "MDEyOklzc3VlQ29tbWVudDYzMTI1NTIwNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-20T06:00:25Z", "updated_at": "2020-05-20T06:00:25Z", "author_association": "MEMBER", "body": "This needs documentation.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 621323348, "label": "Configurable URL for images"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/25#issuecomment-631253852", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/25", "id": 631253852, "node_id": "MDEyOklzc3VlQ29tbWVudDYzMTI1Mzg1Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-20T05:56:17Z", "updated_at": "2020-05-21T22:26:16Z", "author_association": "MEMBER", "body": "I have a `deploy-demo.sh` script now:\r\n```bash\r\n#!/bin/bash\r\nif [ -f public.db ]; then\r\n rm public.db\r\nfi\r\npipenv run dogsheep-photos create-subset photos.db public.db \\\r\n \"select sha256 from apple_photos where albums like '%Public%'\"\r\npipenv run sqlite-utils create-view public.db photos_on_a_map \\\r\n \"select\r\n date,\r\n latitude,\r\n longitude,\r\n apple_photos.sha256,\r\n uploads.ext,\r\n json_object(\r\n 'title',\r\n 'Taken on ' || date,\r\n 'image',\r\n 'https://photos.simonwillison.net/i/' || uploads.sha256 || '.' || uploads.ext || '?w=400',\r\n 'link',\r\n 'https://photos.simonwillison.net/i/' || uploads.sha256 || '.' || uploads.ext || '?w=1200'\r\n ) as popup\r\n from\r\n apple_photos\r\n join uploads on apple_photos.sha256 = uploads.sha256\r\n where\r\n latitude is not null\r\n order by\r\n date desc\" \\\r\n --replace\r\npipenv run datasette publish now public.db --project dogsheep-photos \\\r\n --about=dogsheep/dogsheep-photos \\\r\n --about_url=\"https://github.com/dogsheep/dogsheep-photos\" \\\r\n --install=datasette-json-html \\\r\n --install=datasette-pretty-json \\\r\n --install=datasette-cluster-map>=0.10 \\\r\n --title \"Dogsheep Photos demo\"\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 621332242, "label": "Create a public demo"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/25#issuecomment-631253248", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/25", "id": 631253248, "node_id": "MDEyOklzc3VlQ29tbWVudDYzMTI1MzI0OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-20T05:54:18Z", "updated_at": "2020-05-20T05:54:18Z", "author_association": "MEMBER", "body": "https://dogsheep-photos.dogsheep.net/", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 621332242, "label": "Create a public demo"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/25#issuecomment-631253136", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/25", "id": 631253136, "node_id": "MDEyOklzc3VlQ29tbWVudDYzMTI1MzEzNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-20T05:53:58Z", "updated_at": "2020-05-20T05:53:58Z", "author_association": "MEMBER", "body": "Updated deploy command:\r\n```\r\ndatasette publish now public.db --project dogsheep-photos \\\r\n --about=dogsheep/dogsheep-photos \\\r\n --about_url=\"https://github.com/dogsheep/dogsheep-photos\" \\\r\n --install=datasette-json-html \\\r\n --install=datasette-cluster-map \\\r\n --title \"Dogsheep Photos demo\"\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 621332242, "label": "Create a public demo"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/25#issuecomment-631251707", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/25", "id": 631251707, "node_id": "MDEyOklzc3VlQ29tbWVudDYzMTI1MTcwNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-20T05:49:27Z", "updated_at": "2020-05-21T15:58:42Z", "author_association": "MEMBER", "body": "Renaming this demo to `dogsheep-photos.dogsheep.net`", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 621332242, "label": "Create a public demo"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/25#issuecomment-631127454", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/25", "id": 631127454, "node_id": "MDEyOklzc3VlQ29tbWVudDYzMTEyNzQ1NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-19T22:48:00Z", "updated_at": "2020-05-21T15:58:32Z", "author_association": "MEMBER", "body": "I built #23 to help with this.\r\n\r\n $ dogsheep-photos create-subset photos.db public.db \\\r\n \"select sha256 from apple_photos where albums like '%Public%'\"\r\n\r\nAnd publish with Vercel:\r\n\r\n $ datasette publish now public.db --project dogsheep-photos \\\r\n --about=dogsheep/dogsheep-photos \\\r\n --about_url=\"https://github.com/dogsheep/dogsheep-photos\" \\\r\n --install=datasette-json-html \\\r\n --install=datasette-cluster-map", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 621332242, "label": "Create a public demo"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/23#issuecomment-631120771", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/23", "id": 631120771, "node_id": "MDEyOklzc3VlQ29tbWVudDYzMTEyMDc3MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-19T22:32:48Z", "updated_at": "2020-05-19T22:32:48Z", "author_association": "MEMBER", "body": "Documentation: https://github.com/dogsheep/photos-to-sqlite/blob/e2fab012551eed05278040b5d57e7373a1b9a0bf/README.md#creating-a-subset-database", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 621280529, "label": "create-subset command for creating a publishable subset of a photos database"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/22#issuecomment-626941278", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/22", "id": 626941278, "node_id": "MDEyOklzc3VlQ29tbWVudDYyNjk0MTI3OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-11T20:25:58Z", "updated_at": "2020-05-11T20:25:58Z", "author_association": "MEMBER", "body": "Interesting - do you know if there's anything the `exiftool` process handles that `ExifReader` doesn't?\r\n\r\nI'm actually just going to extract a subset of the EXIF data at first - since the original photo files will always be available I don't feel the need to get everything out for the first step.\r\n\r\nMy plan is to use EXIF to help support photo collections that aren't in Apple Photos - I'm going to build a database table keyed by the `sha256` of each photo that extracts the camera make, lens, a few settings (ISO, aperture etc) and the GPS lat/lon.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 615626118, "label": "Try out ExifReader"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/21#issuecomment-626395781", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/21", "id": 626395781, "node_id": "MDEyOklzc3VlQ29tbWVudDYyNjM5NTc4MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-10T21:57:09Z", "updated_at": "2020-05-10T21:57:09Z", "author_association": "MEMBER", "body": "Yes, I just recreated my virtual environment from scratch and the error went away.\r\n\r\nThe problem occurred when I ran `pip install datasette-bplist` in the same virtual environment - https://github.com/simonw/datasette-bplist/blob/master/setup.py depends on `bpylist` which is incompatible with `bpylist2`.", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 615474990, "label": "bpylist.archiver.CircularReference: archive has a cycle with uid(13)"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/21#issuecomment-626395209", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/21", "id": 626395209, "node_id": "MDEyOklzc3VlQ29tbWVudDYyNjM5NTIwOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-10T21:52:42Z", "updated_at": "2020-05-10T21:52:42Z", "author_association": "MEMBER", "body": "Aha! It looks like I accidentally installed the old bplist into the same environment:\r\n```\r\n$ pip freeze | grep bpylist\r\nbpylist==0.1.4\r\nbpylist2==3.0.0\r\n```", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 615474990, "label": "bpylist.archiver.CircularReference: archive has a cycle with uid(13)"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/21#issuecomment-626395103", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/21", "id": 626395103, "node_id": "MDEyOklzc3VlQ29tbWVudDYyNjM5NTEwMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-10T21:51:36Z", "updated_at": "2020-05-10T21:51:36Z", "author_association": "MEMBER", "body": "@RhetTbull I tried that workaround and it turns out I'm getting this error on ALL of my photos now!\r\n\r\nIt's weird: a few day ago this wasn't happening. Now it's happening to everything. I'm not sure what I might have changed. ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 615474990, "label": "bpylist.archiver.CircularReference: archive has a cycle with uid(13)"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/21#issuecomment-626394989", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/21", "id": 626394989, "node_id": "MDEyOklzc3VlQ29tbWVudDYyNjM5NDk4OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-10T21:50:36Z", "updated_at": "2020-05-10T21:50:36Z", "author_association": "MEMBER", "body": "https://github.com/Marketcircle/bpylist/pull/2 looks relevant here.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 615474990, "label": "bpylist.archiver.CircularReference: archive has a cycle with uid(13)"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/21#issuecomment-626388837", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/21", "id": 626388837, "node_id": "MDEyOklzc3VlQ29tbWVudDYyNjM4ODgzNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-10T20:59:32Z", "updated_at": "2020-05-10T20:59:32Z", "author_association": "MEMBER", "body": "So it appears it's possible for `photo.place` to raise that exception. A workaround could be to catch that and treat those photos as not having a place.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 615474990, "label": "bpylist.archiver.CircularReference: archive has a cycle with uid(13)"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/21#issuecomment-626388764", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/21", "id": 626388764, "node_id": "MDEyOklzc3VlQ29tbWVudDYyNjM4ODc2NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-10T20:58:52Z", "updated_at": "2020-05-10T20:58:52Z", "author_association": "MEMBER", "body": "More from the debugger:\r\n```\r\n> /Users/simon/.local/share/virtualenvs/photos-to-sqlite-0uGSHd6e/lib/python3.8/site-packages/osxphotos/photoinfo.py(614)place()\r\n-> self._place = PlaceInfo5(self._info[\"reverse_geolocation\"])\r\n```\r\nAnd:\r\n```\r\n> /Users/simon/Dropbox/Development/photos-to-sqlite/photos_to_sqlite/utils.py(91)osxphoto_to_row()\r\n-> place = photo.place\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 615474990, "label": "bpylist.archiver.CircularReference: archive has a cycle with uid(13)"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/20#issuecomment-625947133", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/20", "id": 625947133, "node_id": "MDEyOklzc3VlQ29tbWVudDYyNTk0NzEzMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-08T18:13:06Z", "updated_at": "2020-05-08T18:13:06Z", "author_association": "MEMBER", "body": "`datasette-media` will be able to handle this once I implement https://github.com/simonw/datasette-media/issues/3", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 613006393, "label": "Ability to serve thumbnailed Apple Photo from its place on disk"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/20#issuecomment-624408738", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/20", "id": 624408738, "node_id": "MDEyOklzc3VlQ29tbWVudDYyNDQwODczOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-06T02:21:05Z", "updated_at": "2020-05-06T02:21:32Z", "author_association": "MEMBER", "body": "Here's rendering code from my hacked-together not-yet-released S3 image proxy:\r\n```python\r\nfrom starlette.responses import Response\r\nfrom PIL import Image, ExifTags\r\nimport pyheif\r\n\r\nfor ORIENTATION_TAG in ExifTags.TAGS.keys():\r\n if ExifTags.TAGS[ORIENTATION_TAG] == \"Orientation\":\r\n break\r\n ...\r\n # Load it into Pillow\r\n if ext == \"heic\":\r\n heic = pyheif.read_heif(image_response.content)\r\n image = Image.frombytes(mode=heic.mode, size=heic.size, data=heic.data)\r\n else:\r\n image = Image.open(io.BytesIO(image_response.content))\r\n\r\n # Does EXIF tell us to rotate it?\r\n try:\r\n exif = dict(image._getexif().items())\r\n if exif[ORIENTATION_TAG] == 3:\r\n image = image.rotate(180, expand=True)\r\n elif exif[ORIENTATION_TAG] == 6:\r\n image = image.rotate(270, expand=True)\r\n elif exif[ORIENTATION_TAG] == 8:\r\n image = image.rotate(90, expand=True)\r\n except (AttributeError, KeyError, IndexError):\r\n pass\r\n\r\n # Resize based on ?w= and ?h=, if set\r\n width, height = image.size\r\n w = request.query_params.get(\"w\")\r\n h = request.query_params.get(\"h\")\r\n if w is not None or h is not None:\r\n if h is None:\r\n # Set h based on w\r\n w = int(w)\r\n h = int((float(height) / width) * w)\r\n elif w is None:\r\n h = int(h)\r\n # Set w based on h\r\n w = int((float(width) / height) * h)\r\n w = int(w)\r\n h = int(h)\r\n image.thumbnail((w, h))\r\n\r\n # ?bw= converts to black and white\r\n if request.query_params.get(\"bw\"):\r\n image = image.convert(\"L\")\r\n\r\n # ?q= sets the quality - defaults to 75\r\n quality = 75\r\n q = request.query_params.get(\"q\")\r\n if q and q.isdigit() and 1 <= int(q) <= 100:\r\n quality = int(q)\r\n\r\n # Output as JPEG or PNG\r\n output_image = io.BytesIO()\r\n image_type = \"JPEG\"\r\n kwargs = {\"quality\": quality}\r\n if image.format == \"PNG\":\r\n image_type = \"PNG\"\r\n kwargs = {}\r\n\r\n image.save(output_image, image_type, **kwargs)\r\n return Response(\r\n output_image.getvalue(),\r\n media_type=\"image/jpeg\",\r\n headers={\"cache-control\": \"s-maxage={}, public\".format(365 * 24 * 60 * 60)},\r\n )\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 613006393, "label": "Ability to serve thumbnailed Apple Photo from its place on disk"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/20#issuecomment-624408370", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/20", "id": 624408370, "node_id": "MDEyOklzc3VlQ29tbWVudDYyNDQwODM3MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-06T02:19:27Z", "updated_at": "2020-05-06T02:19:27Z", "author_association": "MEMBER", "body": "The plugin can be generalized: it can be configured to know how to take the URL path, look it up in ANY table (via a custom SQL query) to get a path on disk and then serve that.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 613006393, "label": "Ability to serve thumbnailed Apple Photo from its place on disk"}, "performed_via_github_app": null}