{"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/1#issuecomment-623193947", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/1", "id": 623193947, "node_id": "MDEyOklzc3VlQ29tbWVudDYyMzE5Mzk0Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-03T22:36:17Z", "updated_at": "2020-05-03T22:36:17Z", "author_association": "MEMBER", "body": "I'm going to use [osxphotos](https://github.com/RhetTbull/osxphotos) for this.\r\n\r\nSince I've already got code to upload photos and insert them into a table based on their `sha256` hash, my first go at this will be to import data using the tool and foreign-key it to the `sha256` hash in the existing table.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 602533300, "label": "Import photo metadata from Apple Photos into SQLite"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/1#issuecomment-623195197", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/1", "id": 623195197, "node_id": "MDEyOklzc3VlQ29tbWVudDYyMzE5NTE5Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-03T22:44:33Z", "updated_at": "2020-05-03T22:44:33Z", "author_association": "MEMBER", "body": "Command will be this:\r\n\r\n $ photos-to-sqlite apple-photos photos.db\r\n\r\nThis will populate a `apple_photos` table with the data imported by the `osxphotos` library, plus the calculated sha256.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 602533300, "label": "Import photo metadata from Apple Photos into SQLite"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/1#issuecomment-623198653", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/1", "id": 623198653, "node_id": "MDEyOklzc3VlQ29tbWVudDYyMzE5ODY1Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-03T23:09:57Z", "updated_at": "2020-05-03T23:09:57Z", "author_association": "MEMBER", "body": "For locations: I'll add `place_x` columns for all of these:\r\n```\r\n(Pdb) photo.place.address._asdict()\r\n{'street': None, 'sub_locality': None, 'city': 'Loreto', 'sub_administrative_area': 'Loreto', 'state_province': 'BCS', 'postal_code': None, 'country': 'Mexico', 'iso_country_code': 'MX'}\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 602533300, "label": "Import photo metadata from Apple Photos into SQLite"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/1#issuecomment-623198986", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/1", "id": 623198986, "node_id": "MDEyOklzc3VlQ29tbWVudDYyMzE5ODk4Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-03T23:12:31Z", "updated_at": "2020-05-03T23:12:46Z", "author_association": "MEMBER", "body": "To get the taken date in UTC:\r\n```\r\nfrom datetime import timezone\r\n(Pdb) photo.date.astimezone(timezone.utc).isoformat()\r\n'2018-02-13T20:21:31.620000+00:00'\r\n(Pdb) photo.date.astimezone(timezone.utc).isoformat().split(\".\")\r\n['2018-02-13T20:21:31', '620000+00:00']\r\n(Pdb) photo.date.astimezone(timezone.utc).isoformat().split(\".\")[0]\r\n'2018-02-13T20:21:31'\r\n(Pdb) photo.date.astimezone(timezone.utc).isoformat().split(\".\")[0] + \"+00:00\"\r\n'2018-02-13T20:21:31+00:00'\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": 602533300, "label": "Import photo metadata from Apple Photos into SQLite"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/1#issuecomment-623199214", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/1", "id": 623199214, "node_id": "MDEyOklzc3VlQ29tbWVudDYyMzE5OTIxNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-03T23:14:08Z", "updated_at": "2020-05-03T23:14:08Z", "author_association": "MEMBER", "body": "Albums have UUIDs:\r\n```\r\n(Pdb) photo.album_info[0].__dict__\r\n{'_uuid': '17816791-ABF3-447B-942C-9FA8065EEBBA', '_db': osxphotos.PhotosDB(dbfile='/Users/simon/Pictures/Photos Library.photoslibrary/database/photos.db'), '_title': 'Geotaggable Photos geotagged'}\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 602533300, "label": "Import photo metadata from Apple Photos into SQLite"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/1#issuecomment-623199701", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/1", "id": 623199701, "node_id": "MDEyOklzc3VlQ29tbWVudDYyMzE5OTcwMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-03T23:17:38Z", "updated_at": "2020-05-03T23:17:38Z", "author_association": "MEMBER", "body": "Record burst_uuid as a column:\r\n```\r\n(Pdb) with_bursts[0]._info[\"burstUUID\"]\r\n'703FAA23-57BF-40B4-8A33-D9CEB143391B'\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 602533300, "label": "Import photo metadata from Apple Photos into SQLite"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/1#issuecomment-623199750", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/1", "id": 623199750, "node_id": "MDEyOklzc3VlQ29tbWVudDYyMzE5OTc1MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-03T23:17:58Z", "updated_at": "2020-05-03T23:17:58Z", "author_association": "MEMBER", "body": "Reading this source code is really useful for figuring out how to store a photo in a DB table: https://github.com/RhetTbull/osxphotos/blob/7444b6d173918a3ad2a07aefce5ecf054786c787/osxphotos/photoinfo.py", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 602533300, "label": "Import photo metadata from Apple Photos into SQLite"}, "performed_via_github_app": null} {"html_url": "https://github.com/dogsheep/dogsheep-photos/issues/1#issuecomment-623232984", "issue_url": "https://api.github.com/repos/dogsheep/dogsheep-photos/issues/1", "id": 623232984, "node_id": "MDEyOklzc3VlQ29tbWVudDYyMzIzMjk4NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-05-04T02:41:32Z", "updated_at": "2020-05-04T02:41:32Z", "author_association": "MEMBER", "body": "Needs documentation.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 602533300, "label": "Import photo metadata from Apple Photos into SQLite"}, "performed_via_github_app": null}