github
html_url | issue_url | id | node_id | user | created_at | updated_at | author_association | body | reactions | issue | performed_via_github_app |
---|---|---|---|---|---|---|---|---|---|---|---|
https://github.com/dogsheep/dogsheep-photos/issues/21#issuecomment-626395507 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/21 | 626395507 | MDEyOklzc3VlQ29tbWVudDYyNjM5NTUwNw== | 41546558 | 2020-05-10T21:54:45Z | 2020-05-10T21:54:45Z | CONTRIBUTOR | @simonw does Photos show valid reverse geolocation info? Are you sure you're using [bpylist2](https://github.com/xa4a/bpylist2) and not bpylist? They're both unfortunately imported as "bpylist" so if you somehow got the wrong (original bpylist) version installed, it could be the issue. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
615474990 | |
https://github.com/dogsheep/dogsheep-photos/issues/21#issuecomment-626395209 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/21 | 626395209 | MDEyOklzc3VlQ29tbWVudDYyNjM5NTIwOQ== | 9599 | 2020-05-10T21:52:42Z | 2020-05-10T21:52:42Z | MEMBER | Aha! It looks like I accidentally installed the old bplist into the same environment: ``` $ pip freeze | grep bpylist bpylist==0.1.4 bpylist2==3.0.0 ``` | { "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
615474990 | |
https://github.com/dogsheep/dogsheep-photos/issues/21#issuecomment-626395103 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/21 | 626395103 | MDEyOklzc3VlQ29tbWVudDYyNjM5NTEwMw== | 9599 | 2020-05-10T21:51:36Z | 2020-05-10T21:51:36Z | MEMBER | @RhetTbull I tried that workaround and it turns out I'm getting this error on ALL of my photos now! It'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. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
615474990 | |
https://github.com/dogsheep/dogsheep-photos/issues/21#issuecomment-626390317 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/21 | 626390317 | MDEyOklzc3VlQ29tbWVudDYyNjM5MDMxNw== | 41546558 | 2020-05-10T21:11:24Z | 2020-05-10T21:50:58Z | CONTRIBUTOR | Ugh....Yeah, I think easiest is to catch the exception and return no place as you suggest. This particular bit of code involves un-archiving a serialized NSKeyedArchiver which uses an object table and it is certainly possible to create a circular reference that way. Because this is happening in the decode, the circular reference must be in the original data. Does Photos show valid reverse geolocation info for the photo in question? If so, Photos may be doing something beyond a simple decode of the binary plist. For now, I'll push a patch to catch the exception. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
615474990 | |
https://github.com/dogsheep/dogsheep-photos/issues/21#issuecomment-626394989 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/21 | 626394989 | MDEyOklzc3VlQ29tbWVudDYyNjM5NDk4OQ== | 9599 | 2020-05-10T21:50:36Z | 2020-05-10T21:50:36Z | MEMBER | https://github.com/Marketcircle/bpylist/pull/2 looks relevant here. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
615474990 | |
https://github.com/simonw/sqlite-utils/issues/110#issuecomment-626391307 | https://api.github.com/repos/simonw/sqlite-utils/issues/110 | 626391307 | MDEyOklzc3VlQ29tbWVudDYyNjM5MTMwNw== | 9599 | 2020-05-10T21:19:04Z | 2020-05-10T21:19:04Z | OWNER | I'm going to set it up so that Python `decimal.Decimal` is treated in a FLOAT column, until someone convinces me otherwise! | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
613755043 | |
https://github.com/simonw/sqlite-utils/issues/110#issuecomment-626391217 | https://api.github.com/repos/simonw/sqlite-utils/issues/110 | 626391217 | MDEyOklzc3VlQ29tbWVudDYyNjM5MTIxNw== | 9599 | 2020-05-10T21:18:28Z | 2020-05-10T21:18:28Z | OWNER | `sqlite-utils` currently treats the SQLite NUMERIC concept as a float: https://github.com/simonw/sqlite-utils/blob/daf2a245aa4e0b0cf62a94c1232cfb858821803b/tests/test_column_affinity.py#L28-L30 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
613755043 | |
https://github.com/simonw/sqlite-utils/issues/110#issuecomment-626391063 | https://api.github.com/repos/simonw/sqlite-utils/issues/110 | 626391063 | MDEyOklzc3VlQ29tbWVudDYyNjM5MTA2Mw== | 9599 | 2020-05-10T21:17:16Z | 2020-05-10T21:17:16Z | OWNER | From https://www.sqlite.org/datatype3.html#type_affinity : > A column with NUMERIC affinity may contain values using all five storage classes. When text data is inserted into a NUMERIC column, the storage class of the text is converted to INTEGER or REAL (in order of preference) if the text is a well-formed integer or real literal, respectively. If the TEXT value is a well-formed integer literal that is too large to fit in a 64-bit signed integer, it is converted to REAL. For conversions between TEXT and REAL storage classes, only the first 15 significant decimal digits of the number are preserved. If the TEXT value is not a well-formed integer or real literal, then the value is stored as TEXT. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
613755043 | |
https://github.com/simonw/sqlite-utils/issues/110#issuecomment-626390822 | https://api.github.com/repos/simonw/sqlite-utils/issues/110 | 626390822 | MDEyOklzc3VlQ29tbWVudDYyNjM5MDgyMg== | 9599 | 2020-05-10T21:15:28Z | 2020-05-10T21:15:28Z | OWNER | https://www.sqlite.org/datatype3.html#affinity_name_examples suggests that `DECIMAL(10,5)` should be mapped to the SQLite affinity of `NUMERIC` - which I've not worked with before. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
613755043 | |
https://github.com/simonw/sqlite-utils/issues/110#issuecomment-626390456 | https://api.github.com/repos/simonw/sqlite-utils/issues/110 | 626390456 | MDEyOklzc3VlQ29tbWVudDYyNjM5MDQ1Ng== | 9599 | 2020-05-10T21:12:40Z | 2020-05-10T21:12:40Z | OWNER | It definitely makes sense to me that this library should support `decimal.Decimal`. Here are the current supported types: https://github.com/simonw/sqlite-utils/blob/396bee92364fc3a88f6c76969366dd1c4c9c944d/sqlite_utils/db.py#L35-L55 Should `decimal.Decimal` be stored as a `text` or `float` in SQLite I wonder? | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
613755043 | |
https://github.com/dogsheep/dogsheep-photos/issues/21#issuecomment-626388837 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/21 | 626388837 | MDEyOklzc3VlQ29tbWVudDYyNjM4ODgzNw== | 9599 | 2020-05-10T20:59:32Z | 2020-05-10T20:59:32Z | MEMBER | 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. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
615474990 | |
https://github.com/dogsheep/dogsheep-photos/issues/21#issuecomment-626388764 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/21 | 626388764 | MDEyOklzc3VlQ29tbWVudDYyNjM4ODc2NA== | 9599 | 2020-05-10T20:58:52Z | 2020-05-10T20:58:52Z | MEMBER | More from the debugger: ``` > /Users/simon/.local/share/virtualenvs/photos-to-sqlite-0uGSHd6e/lib/python3.8/site-packages/osxphotos/photoinfo.py(614)place() -> self._place = PlaceInfo5(self._info["reverse_geolocation"]) ``` And: ``` > /Users/simon/Dropbox/Development/photos-to-sqlite/photos_to_sqlite/utils.py(91)osxphoto_to_row() -> place = photo.place ``` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
615474990 | |
https://github.com/simonw/datasette/issues/254#issuecomment-626340387 | https://api.github.com/repos/simonw/datasette/issues/254 | 626340387 | MDEyOklzc3VlQ29tbWVudDYyNjM0MDM4Nw== | 247131 | 2020-05-10T14:54:13Z | 2020-05-10T14:54:13Z | NONE | This has now been resolved and is not present in current version of datasette. Sample query @simonw mentioned now returns as expected. https://aggreg8streams.tinyviking.ie/simplestreams?sql=select+*+from+cloudimage+where+%22content_id%22+%3D+%22com.ubuntu.cloud%3Areleased%3Adownload%22+order+by+id+limit+10 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
322283067 | |
https://github.com/simonw/datasette/issues/619#issuecomment-626006493 | https://api.github.com/repos/simonw/datasette/issues/619 | 626006493 | MDEyOklzc3VlQ29tbWVudDYyNjAwNjQ5Mw== | 412005 | 2020-05-08T20:29:12Z | 2020-05-08T20:29:12Z | NONE | just trying out datasette and quite like it, thanks! i found this issue annoying enough to have a go at a fix. have you any thoughts on a good approach? (i'm happy to dig in myself if you haven't thought about it yet, but wanted to check if you had an idea for how to fix when you raised the issue) | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
520655983 | |
https://github.com/dogsheep/dogsheep-photos/issues/20#issuecomment-625947133 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/20 | 625947133 | MDEyOklzc3VlQ29tbWVudDYyNTk0NzEzMw== | 9599 | 2020-05-08T18:13:06Z | 2020-05-08T18:13:06Z | MEMBER | `datasette-media` will be able to handle this once I implement https://github.com/simonw/datasette-media/issues/3 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
613006393 | |
https://github.com/simonw/datasette/issues/685#issuecomment-625890190 | https://api.github.com/repos/simonw/datasette/issues/685 | 625890190 | MDEyOklzc3VlQ29tbWVudDYyNTg5MDE5MA== | 9599 | 2020-05-08T16:09:44Z | 2020-05-08T16:09:56Z | OWNER | Re-opening this ticket because I forgot to document `execute_fn()` (the old `execute_against_connection_in_thread()` method). | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
570309546 | |
https://github.com/simonw/datasette/issues/685#issuecomment-625889673 | https://api.github.com/repos/simonw/datasette/issues/685 | 625889673 | MDEyOklzc3VlQ29tbWVudDYyNTg4OTY3Mw== | 9599 | 2020-05-08T16:08:40Z | 2020-05-08T16:08:40Z | OWNER | I'm going to ship a release with just this change purely so I can start depending on it from my in-development https://github.com/simonw/datasette-media plugin. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
570309546 | |
https://github.com/simonw/datasette/issues/685#issuecomment-625889303 | https://api.github.com/repos/simonw/datasette/issues/685 | 625889303 | MDEyOklzc3VlQ29tbWVudDYyNTg4OTMwMw== | 9599 | 2020-05-08T16:07:55Z | 2020-05-08T16:07:55Z | OWNER | New documentation is live here: https://datasette.readthedocs.io/en/latest/internals.html#database-class | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
570309546 | |
https://github.com/simonw/datasette/issues/685#issuecomment-625887196 | https://api.github.com/repos/simonw/datasette/issues/685 | 625887196 | MDEyOklzc3VlQ29tbWVudDYyNTg4NzE5Ng== | 9599 | 2020-05-08T16:03:16Z | 2020-05-08T16:03:16Z | OWNER | [ Fun aside: I implemented and shipped this entire branch in my browser using the beta of GitHub's new [Codespaces](https://github.com/features/codespaces) ] | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
570309546 | |
https://github.com/simonw/datasette/issues/685#issuecomment-625868416 | https://api.github.com/repos/simonw/datasette/issues/685 | 625868416 | MDEyOklzc3VlQ29tbWVudDYyNTg2ODQxNg== | 9599 | 2020-05-08T15:23:04Z | 2020-05-08T15:23:04Z | OWNER | I'll move the code into `datasette/database.py`. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
570309546 | |
https://github.com/simonw/datasette/issues/685#issuecomment-625866419 | https://api.github.com/repos/simonw/datasette/issues/685 | 625866419 | MDEyOklzc3VlQ29tbWVudDYyNTg2NjQxOQ== | 9599 | 2020-05-08T15:18:55Z | 2020-05-08T15:18:55Z | OWNER | This code should live somewhere other than `datasette/utils/__init__.py`. Especially the exceptions, since calling code needs to be able to sensibly import them. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
570309546 | |
https://github.com/simonw/datasette/issues/685#issuecomment-625865434 | https://api.github.com/repos/simonw/datasette/issues/685 | 625865434 | MDEyOklzc3VlQ29tbWVudDYyNTg2NTQzNA== | 9599 | 2020-05-08T15:16:43Z | 2020-05-08T15:16:43Z | OWNER | Documentation for improved design: https://github.com/simonw/datasette/pull/763/files#diff-87703da03a02e0f8dae01f39abd6250f | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
570309546 | |
https://github.com/simonw/datasette/issues/685#issuecomment-625862578 | https://api.github.com/repos/simonw/datasette/issues/685 | 625862578 | MDEyOklzc3VlQ29tbWVudDYyNTg2MjU3OA== | 9599 | 2020-05-08T15:10:16Z | 2020-05-08T15:10:16Z | OWNER | I'm not going to do ``.last()`` because it could be confusing if truncation has come into play. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
570309546 | |
https://github.com/simonw/datasette/issues/685#issuecomment-625850152 | https://api.github.com/repos/simonw/datasette/issues/685 | 625850152 | MDEyOklzc3VlQ29tbWVudDYyNTg1MDE1Mg== | 9599 | 2020-05-08T14:44:37Z | 2020-05-08T14:44:37Z | OWNER | I'll write the API documentation first, in a branch. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
570309546 | |
https://github.com/simonw/datasette/issues/685#issuecomment-625849497 | https://api.github.com/repos/simonw/datasette/issues/685 | 625849497 | MDEyOklzc3VlQ29tbWVudDYyNTg0OTQ5Nw== | 9599 | 2020-05-08T14:43:13Z | 2020-05-08T14:43:13Z | OWNER | I'm going to add `.first()` and `.last()` methods too. These will return the first or last row, or `None` if the results are empty (rather than raising an `IndexError`). | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
570309546 | |
https://github.com/simonw/datasette/issues/685#issuecomment-625841397 | https://api.github.com/repos/simonw/datasette/issues/685 | 625841397 | MDEyOklzc3VlQ29tbWVudDYyNTg0MTM5Nw== | 9599 | 2020-05-08T14:25:56Z | 2020-05-08T14:27:15Z | OWNER | Maybe all I really want here is to add length and access-by-index methods to the Results class? So I don't have to do `results.rows[0][0]` to get at a single returned value. Also how about a `results.single_value()` method which returns a value only if there is a single row with a single column, otherwise raises an exception? | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
570309546 | |
https://github.com/simonw/datasette/issues/685#issuecomment-625839046 | https://api.github.com/repos/simonw/datasette/issues/685 | 625839046 | MDEyOklzc3VlQ29tbWVudDYyNTgzOTA0Ng== | 9599 | 2020-05-08T14:20:43Z | 2020-05-08T14:25:05Z | OWNER | The API design for the `.execute()` function is actually fine, I think it's more the API of the returned `Results` object that I want to improve. That object encapsulates the returned data, the named columns and whether or not the result was truncated. return Results(rows, truncated, cursor.description) The `rows` argument comes from either `rows = cursor.fetchmany(max_returned_rows + 1)` or `rows = cursor.fetchall()`. It's a Python list of `sqlite3.Row` objects. Here's the current class implementation: https://github.com/simonw/datasette/blob/0784f2ef9d3ff6dd9df05f54cb51de29a6d11764/datasette/utils/__init__.py#L54-L68 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
570309546 | |
https://github.com/simonw/datasette/issues/685#issuecomment-625817999 | https://api.github.com/repos/simonw/datasette/issues/685 | 625817999 | MDEyOklzc3VlQ29tbWVudDYyNTgxNzk5OQ== | 9599 | 2020-05-08T13:33:23Z | 2020-05-08T13:33:23Z | OWNER | I'm going to rename `execute_against_connection_in_thread()` to just `execute_fn()`. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
570309546 | |
https://github.com/simonw/datasette/issues/685#issuecomment-625603221 | https://api.github.com/repos/simonw/datasette/issues/685 | 625603221 | MDEyOklzc3VlQ29tbWVudDYyNTYwMzIyMQ== | 9599 | 2020-05-08T03:00:23Z | 2020-05-08T03:00:23Z | OWNER | Working with this in https://github.com/simonw/datasette-media/issues/2 made me really want to redesign this API: https://github.com/simonw/datasette-media/commit/be23ec3d05900b69a3d47bc1e0dd056c333125f4 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
570309546 | |
https://github.com/simonw/datasette/issues/648#issuecomment-625321121 | https://api.github.com/repos/simonw/datasette/issues/648 | 625321121 | MDEyOklzc3VlQ29tbWVudDYyNTMyMTEyMQ== | 28694175 | 2020-05-07T15:21:19Z | 2020-05-07T15:21:19Z | NONE | It seems that heroku wasn't updating to 0.41 on deployment. Had to add `--branch 0.41` and that solved it! Heroku caches dependencies <img width="1331" alt="Screen Shot 2020-05-07 at 8 19 08 AM" src="https://user-images.githubusercontent.com/28694175/81312379-6f1f1680-903b-11ea-847c-4149268504a6.png"> and (i think) because the `requirements.txt` doesn't specify the datasette version, it didn't update from 0.40 to 0.41 on heroku even though it was specified on my local requirements file as `datasette >= 0.41` These are the lines that gave me an idea on how to solve it: https://github.com/simonw/datasette/blob/182e5c8745c94576718315f7596ccc81e5e2417b/datasette/publish/heroku.py#L164-L186 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
534492501 | |
https://github.com/simonw/datasette/issues/648#issuecomment-625286519 | https://api.github.com/repos/simonw/datasette/issues/648 | 625286519 | MDEyOklzc3VlQ29tbWVudDYyNTI4NjUxOQ== | 28694175 | 2020-05-07T14:23:22Z | 2020-05-07T14:28:33Z | NONE | Hi! I'm using datasette on this repository: https://github.com/chekos/RIPA-2018-datasette and on my local machine i can see an /about page i created but when i deploy to heroku i get a 404 (http://ripa-2018-db.herokuapp.com) <img width="629" alt="Screen Shot 2020-05-07 at 7 04 43 AM" src="https://user-images.githubusercontent.com/28694175/81303797-0af75500-9031-11ea-8a02-adee7a2374ea.png"> I bumped datasette in my requirements file to 0.41 so I'm 100% what the issue is 🤔 Do you have any idea what could be the problem? 👀 EDIT: for context, I have a templates directory with a pages/about.html file in https://github.com/chekos/RIPA-2018-datasette/tree/master/datasette/templates | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
534492501 | |
https://github.com/simonw/datasette/issues/744#issuecomment-625091976 | https://api.github.com/repos/simonw/datasette/issues/744 | 625091976 | MDEyOklzc3VlQ29tbWVudDYyNTA5MTk3Ng== | 30607 | 2020-05-07T07:51:25Z | 2020-05-07T07:51:25Z | NONE | I have installed `heroku plugins:install heroku-builds`, but I have the same error. Then I have removed from `datasette\publish\heroku.py` ```python # Check for heroku-builds plugin plugins = [ line.split()[0] for line in check_output(["heroku", "plugins"]).splitlines() ] if b"heroku-builds" not in plugins: click.echo( "Publishing to Heroku requires the heroku-builds plugin to be installed." ) click.confirm( "Install it? (this will run `heroku plugins:install heroku-builds`)", abort=True, ) call(["heroku", "plugins:install", "heroku-builds"]) ``` And now I have ``` Traceback (most recent call last): File "C:\Users\aborr\AppData\Roaming\Python\Python37\site-packages\datasette\publish\heroku.py", line 210, in temporary_heroku_directory yield File "C:\Users\aborr\AppData\Roaming\Python\Python37\site-packages\datasette\publish\heroku.py", line 96, in heroku list_output = check_output(["heroku", "apps:list", "--json"]).decode( File "c:\python37\lib\subprocess.py", line 395, in check_output **kwargs).stdout File "c:\python37\lib\subprocess.py", line 472, in run with Popen(*popenargs, **kwargs) as process: File "c:\python37\lib\subprocess.py", line 775, in __init__ restore_signals, start_new_session) File "c:\python37\lib\subprocess.py", line 1178, in _execute_child startupinfo) FileNotFoundError: [WinError 2] The specified file could not be found During handling of the above exception, another exception occurred: Traceback (most recent call last): File "c:\python37\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\python37\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\aborr\AppData\Roaming\Python\Python37\Scripts\datasette.exe\__main__.py", line 9, in <module> File "C:\Users\aborr\AppData\Roaming\Python\Python… | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
608058890 | |
https://github.com/simonw/datasette/issues/744#issuecomment-625083715 | https://api.github.com/repos/simonw/datasette/issues/744 | 625083715 | MDEyOklzc3VlQ29tbWVudDYyNTA4MzcxNQ== | 30607 | 2020-05-07T07:34:18Z | 2020-05-07T07:34:18Z | NONE | In Windows I'm not very strong. I use debian (inside WSL). However these are the possible steps: - I have installed Python 3 for win (I have 3.7.3); - I have installed heroku cli for win64 and logged in; - I have installed datasette running `python -m pip install --upgrade --user datasette`. It's a very basic Python env that I do not use. This time only to reach my goal: try to publish using custom template | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
608058890 | |
https://github.com/simonw/datasette/issues/744#issuecomment-625066876 | https://api.github.com/repos/simonw/datasette/issues/744 | 625066876 | MDEyOklzc3VlQ29tbWVudDYyNTA2Njg3Ng== | 9599 | 2020-05-07T06:55:04Z | 2020-05-07T06:55:04Z | OWNER | I have a Windows 10 gaming PC in the house: what steps can I take to get an environment in there that matches yours? I've not installed Python on Windows before. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
608058890 | |
https://github.com/simonw/datasette/issues/744#issuecomment-625066073 | https://api.github.com/repos/simonw/datasette/issues/744 | 625066073 | MDEyOklzc3VlQ29tbWVudDYyNTA2NjA3Mw== | 30607 | 2020-05-07T06:53:09Z | 2020-05-07T06:53:09Z | NONE | @simonw another error starting from Windows. I run ``` datasette publish heroku -n comunepa --template-dir template commissioniComunePalermo.db ``` And I have ``` Traceback (most recent call last): File "c:\python37\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\python37\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\aborr\AppData\Roaming\Python\Python37\Scripts\datasette.exe\__main__.py", line 9, in <module> File "C:\Users\aborr\AppData\Roaming\Python\Python37\site-packages\click\core.py", line 829, in __call__ return self.main(*args, **kwargs) File "C:\Users\aborr\AppData\Roaming\Python\Python37\site-packages\click\core.py", line 782, in main rv = self.invoke(ctx) File "C:\Users\aborr\AppData\Roaming\Python\Python37\site-packages\click\core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "C:\Users\aborr\AppData\Roaming\Python\Python37\site-packages\click\core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "C:\Users\aborr\AppData\Roaming\Python\Python37\site-packages\click\core.py", line 1066, in invoke return ctx.invoke(self.callback, **ctx.params) File "C:\Users\aborr\AppData\Roaming\Python\Python37\site-packages\click\core.py", line 610, in invoke return callback(*args, **kwargs) File "C:\Users\aborr\AppData\Roaming\Python\Python37\site-packages\datasette\publish\heroku.py", line 53, in heroku line.split()[0] for line in check_output(["heroku", "plugins"]).splitlines() File "c:\python37\lib\subprocess.py", line 395, in check_output **kwargs).stdout File "c:\python37\lib\subprocess.py", line 472, in run with Popen(*popenargs, **kwargs) as process: File "c:\python37\lib\subprocess.py", line 775, in __init__ restore_signals, start_new_session) File "c:\python37\lib\subprocess.py", line 1178, in _execute_child startupinfo) FileNotFoundError: [WinError 2]… | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
608058890 | |
https://github.com/simonw/datasette/issues/744#issuecomment-625061250 | https://api.github.com/repos/simonw/datasette/issues/744 | 625061250 | MDEyOklzc3VlQ29tbWVudDYyNTA2MTI1MA== | 9599 | 2020-05-07T06:40:09Z | 2020-05-07T06:40:09Z | OWNER | Have a try and let me know what happens! I'd like this stuff to just work on Windows but I need to figure out how to get an environment working. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
608058890 | |
https://github.com/simonw/datasette/issues/744#issuecomment-625060561 | https://api.github.com/repos/simonw/datasette/issues/744 | 625060561 | MDEyOklzc3VlQ29tbWVudDYyNTA2MDU2MQ== | 30607 | 2020-05-07T06:38:24Z | 2020-05-07T06:38:24Z | NONE | Hi @simonw probably I could try to do it in Python for windows. I do not like to do these things in win enviroment. Because probably WSL Linux env (in which I do a lot of great things) is not an environment that will be tested for datasette. In win I shouldn't have any problems. Am I right? | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
608058890 | |
https://github.com/simonw/datasette/issues/761#issuecomment-625003013 | https://api.github.com/repos/simonw/datasette/issues/761 | 625003013 | MDEyOklzc3VlQ29tbWVudDYyNTAwMzAxMw== | 9599 | 2020-05-07T03:07:55Z | 2020-05-07T03:09:05Z | OWNER | Here's another demo I built using this feature: https://observablehq.com/@simonw/datasette-table-diagram <img width="995" alt="Datasette_foreign_key_diagram___Simon_Willison___Observable" src="https://user-images.githubusercontent.com/9599/81250291-6c89d600-8fd5-11ea-859c-d99a0de0531a.png"> Running on this query: ```sql select sqlite_master.name as table_from, fk_info.[from] as column_from, fk_info.[table] as table_to, fk_info.[to] as column_to from sqlite_master join pragma_foreign_key_list(sqlite_master.name) as fk_info order by sqlite_master.name ``` See https://github-to-sqlite.dogsheep.net/github?sql=select%0D%0A++sqlite_master.name+as+table_from%2C%0D%0A++fk_info.%5Bfrom%5D+as+column_from%2C%0D%0A++fk_info.%5Btable%5D+as+table_to%2C%0D%0A++fk_info.%5Bto%5D+as+column_to%0D%0Afrom%0D%0A++sqlite_master%0D%0A++join+pragma_foreign_key_list%28sqlite_master.name%29+as+fk_info%0D%0Aorder+by%0D%0A++sqlite_master.name | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
613467382 | |
https://github.com/simonw/datasette/issues/760#issuecomment-624949809 | https://api.github.com/repos/simonw/datasette/issues/760 | 624949809 | MDEyOklzc3VlQ29tbWVudDYyNDk0OTgwOQ== | 9599 | 2020-05-06T23:49:06Z | 2020-05-06T23:49:06Z | OWNER | ```sql select sqlite_master.name as table_name, table_info.* from sqlite_master join pragma_table_info(sqlite_master.name) as table_info order by sqlite_master.name, table_info.cid ``` https://latest.datasette.io/fixtures?sql=select%0D%0A++sqlite_master.name+as+table_name%2C%0D%0A++table_info.*%0D%0Afrom%0D%0A++sqlite_master%0D%0A++join+pragma_table_info%28sqlite_master.name%29+as+table_info%0D%0Aorder+by%0D%0A++sqlite_master.name%2C%0D%0A++table_info.cid | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
613422636 | |
https://github.com/simonw/datasette/issues/759#issuecomment-624860451 | https://api.github.com/repos/simonw/datasette/issues/759 | 624860451 | MDEyOklzc3VlQ29tbWVudDYyNDg2MDQ1MQ== | 133845 | 2020-05-06T20:03:01Z | 2020-05-06T20:04:42Z | NONE | Thank you. Now it's ok with the url http://localhost:8001/index/summary?_search=language%3Aeng&_sort=title&_searchmode=raw But I'm not able to manage it in the metadata file. Here is mine (note that the sort column is taken into account) Here it is: ``` { "databases": { "index": { "tables": { "summary": { "sort": "title", "searchmode": "raw" } } } } } ``` Any idea ? | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612673948 | |
https://github.com/simonw/datasette/issues/757#issuecomment-624821090 | https://api.github.com/repos/simonw/datasette/issues/757 | 624821090 | MDEyOklzc3VlQ29tbWVudDYyNDgyMTA5MA== | 9599 | 2020-05-06T18:41:29Z | 2020-05-06T18:41:29Z | OWNER | OK, I just released 0.41 with that and a bunch of other stuff: https://datasette.readthedocs.io/en/latest/changelog.html#v0-41 | { "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612378203 | |
https://github.com/simonw/datasette/issues/757#issuecomment-624798540 | https://api.github.com/repos/simonw/datasette/issues/757 | 624798540 | MDEyOklzc3VlQ29tbWVudDYyNDc5ODU0MA== | 9599 | 2020-05-06T17:56:34Z | 2020-05-06T17:56:34Z | OWNER | Actually I'm going to put that release out today. I was hoping to finish #698 first but that shouldn't delay those other features any longer. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612378203 | |
https://github.com/simonw/datasette/issues/757#issuecomment-624798182 | https://api.github.com/repos/simonw/datasette/issues/757 | 624798182 | MDEyOklzc3VlQ29tbWVudDYyNDc5ODE4Mg== | 9599 | 2020-05-06T17:55:50Z | 2020-05-06T17:55:50Z | OWNER | I'll definitely get that out this week! For the moment a trick I often use is to put a URL to the most recent commit in my `requirements.txt` - e.g. https://github.com/simonw/datasette/archive/0784f2ef9d3ff6dd9df05f54cb51de29a6d11764.zip This should be safe because nothing lands on Datasette master without the full unit test suite passing. But you're right, there's a bunch of stuff now that needs to go out in a release: https://github.com/simonw/datasette/compare/0.40...0784f2ef9d3ff6dd9df05f54cb51de29a6d11764 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612378203 | |
https://github.com/simonw/datasette/issues/758#issuecomment-624797119 | https://api.github.com/repos/simonw/datasette/issues/758 | 624797119 | MDEyOklzc3VlQ29tbWVudDYyNDc5NzExOQ== | 9599 | 2020-05-06T17:53:46Z | 2020-05-06T17:53:46Z | OWNER | It's interesting to hear from someone who's using this feature - I'm considering moving it out into a plugin #647. | { "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612382643 | |
https://github.com/simonw/datasette/issues/758#issuecomment-624796685 | https://api.github.com/repos/simonw/datasette/issues/758 | 624796685 | MDEyOklzc3VlQ29tbWVudDYyNDc5NjY4NQ== | 9599 | 2020-05-06T17:52:54Z | 2020-05-06T17:52:54Z | OWNER | Thanks for the suggestion! I'll add this. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612382643 | |
https://github.com/simonw/datasette/issues/759#issuecomment-624795695 | https://api.github.com/repos/simonw/datasette/issues/759 | 624795695 | MDEyOklzc3VlQ29tbWVudDYyNDc5NTY5NQ== | 9599 | 2020-05-06T17:50:57Z | 2020-05-06T17:52:07Z | OWNER | This was a deliberate change from #651. The `_search_colname=` alternative argument for doing this still works - compare these two: * https://latest.datasette.io/fixtures/searchable?_search=dog * https://latest.datasette.io/fixtures/searchable?_search_tex1=dog If you want to use advanced search syntax on those pages you can do so using the `&_searchmode=raw` option - I added better documentation for this the other day: https://datasette.readthedocs.io/en/latest/full_text_search.html#advanced-sqlite-search-queries Example: https://latest.datasette.io/fixtures/searchable?_search=text1:dog&_searchmode=raw | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612673948 | |
https://github.com/simonw/datasette/issues/761#issuecomment-624790887 | https://api.github.com/repos/simonw/datasette/issues/761 | 624790887 | MDEyOklzc3VlQ29tbWVudDYyNDc5MDg4Nw== | 9599 | 2020-05-06T17:41:21Z | 2020-05-06T17:41:21Z | OWNER | More demos here: https://github.com/simonw/til/blob/master/sqlite/list-all-columns-in-a-database.md | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
613467382 | |
https://github.com/simonw/datasette/issues/760#issuecomment-624787678 | https://api.github.com/repos/simonw/datasette/issues/760 | 624787678 | MDEyOklzc3VlQ29tbWVudDYyNDc4NzY3OA== | 9599 | 2020-05-06T17:35:05Z | 2020-05-06T17:35:05Z | OWNER | Potential recipe in https://github.com/simonw/til/blob/master/sqlite/list-all-columns-in-a-database.md | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
613422636 | |
https://github.com/simonw/datasette/issues/761#issuecomment-624783996 | https://api.github.com/repos/simonw/datasette/issues/761 | 624783996 | MDEyOklzc3VlQ29tbWVudDYyNDc4Mzk5Ng== | 9599 | 2020-05-06T17:28:20Z | 2020-05-06T17:28:20Z | OWNER | Interestingly https://latest.datasette.io/fixtures?sql=select+*+from+pragma_function_list() doesn't work, when it DOES work on my laptop. `latest.datasette.io` currently runs SQLite `3.27.2` while my laptop runs `3.31.1` https://www.sqlite.org/changes.html#version_3_30_0 says that as-of 3.30.0: > The PRAGMA function_list, PRAGMA module_list, and PRAGMA pragma_list commands are now enabled in all builds by default. Disable them using -DSQLITE_OMIT_INTROSPECTION_PRAGMAS. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
613467382 | |
https://github.com/simonw/datasette/issues/761#issuecomment-624782775 | https://api.github.com/repos/simonw/datasette/issues/761 | 624782775 | MDEyOklzc3VlQ29tbWVudDYyNDc4Mjc3NQ== | 9599 | 2020-05-06T17:26:05Z | 2020-05-06T17:26:05Z | OWNER | Some demos: * https://latest.datasette.io/fixtures?sql=select+*+from+pragma_database_list%28%29 * https://latest.datasette.io/fixtures?sql=select+*+from+pragma_foreign_key_list%28%27complex_foreign_keys%27%29 * https://latest.datasette.io/fixtures?sql=select+*+from+pragma_function_list%28%29 * https://latest.datasette.io/fixtures?sql=select+*+from+pragma_index_info%28%27idx_compound_three_primary_keys_content%27%29 * https://latest.datasette.io/fixtures?sql=select+*+from+pragma_index_list%28%27compound_three_primary_keys%27%29 * https://latest.datasette.io/fixtures?sql=select+*+from+pragma_index_xinfo%28%27idx_compound_three_primary_keys_content%27%29 * https://latest.datasette.io/fixtures?sql=select+*+from+pragma_page_count%28%29 * https://latest.datasette.io/fixtures?sql=select+*+from+pragma_max_page_count%28%29 * https://latest.datasette.io/fixtures?sql=select+*+from+pragma_page_size%28%29 * https://latest.datasette.io/fixtures?sql=select+*+from+pragma_schema_version%28%29 * https://latest.datasette.io/fixtures?sql=select+*+from+pragma_table_info%28%27complex_foreign_keys%27%29 * https://latest.datasette.io/fixtures?sql=select+*+from+pragma_table_xinfo%28%27complex_foreign_keys%27%29 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
613467382 | |
https://github.com/simonw/datasette/issues/761#issuecomment-624774928 | https://api.github.com/repos/simonw/datasette/issues/761 | 624774928 | MDEyOklzc3VlQ29tbWVudDYyNDc3NDkyOA== | 9599 | 2020-05-06T17:11:15Z | 2020-05-06T17:11:15Z | OWNER | For the moment I'll allow-list the following: * `pragma_database_list` * `pragma_foreign_key_list` * `pragma_function_list` * `pragma_index_info` * `pragma_index_list` * `pragma_index_xinfo` * `pragma_page_count` * `pragma_max_page_count` * `pragma_page_size` * `pragma_schema_version` * `pragma_table_info` * `pragma_table_xinfo` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
613467382 | |
https://github.com/simonw/datasette/issues/761#issuecomment-624766424 | https://api.github.com/repos/simonw/datasette/issues/761 | 624766424 | MDEyOklzc3VlQ29tbWVudDYyNDc2NjQyNA== | 9599 | 2020-05-06T16:54:38Z | 2020-05-06T17:01:02Z | OWNER | I could allow-list some other useful `pragma_x` tables too. SQLite calls these "pragma functions" - documented here: https://www.sqlite.org/pragma.html#pragfunc They sound safe: > Table-valued functions exist only for PRAGMAs that return results and that have no side-effects. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
613467382 | |
https://github.com/simonw/datasette/issues/761#issuecomment-624768744 | https://api.github.com/repos/simonw/datasette/issues/761 | 624768744 | MDEyOklzc3VlQ29tbWVudDYyNDc2ODc0NA== | 9599 | 2020-05-06T16:59:01Z | 2020-05-06T16:59:01Z | OWNER | Maybe use a negative lookahead assertion? https://docs.python.org/3/library/re.html#index-20 > `(?!...)` > > Matches if `...` doesn’t match next. This is a negative lookahead assertion. For example, `Isaac (?!Asimov)` will match 'Isaac ' only if it’s not followed by 'Asimov'. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
613467382 | |
https://github.com/simonw/datasette/issues/761#issuecomment-624767466 | https://api.github.com/repos/simonw/datasette/issues/761 | 624767466 | MDEyOklzc3VlQ29tbWVudDYyNDc2NzQ2Ng== | 9599 | 2020-05-06T16:56:40Z | 2020-05-06T16:57:03Z | OWNER | The rationale for blocking `pragma` entirely from statements is that it can be used to change the state of the SQLite database, e.g. from https://www.sqlite.org/pragma.html : ``` PRAGMA schema.application_id; PRAGMA schema.application_id = integer ; ``` That second line is unsafe. I don't think it's possible to use the `pragma_table_x` variants to make writes in this way. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
613467382 | |
https://github.com/simonw/datasette/issues/760#issuecomment-624729459 | https://api.github.com/repos/simonw/datasette/issues/760 | 624729459 | MDEyOklzc3VlQ29tbWVudDYyNDcyOTQ1OQ== | 9599 | 2020-05-06T15:47:44Z | 2020-05-06T15:47:44Z | OWNER | `select * from pragma_table_info(tablename);` is currently disallowed for user-provided queries via a regex restriction - but could help here too. https://github.com/simonw/datasette/blob/d349d57cdf3d577afb62bdf784af342a4d5be660/datasette/utils/__init__.py#L174 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
613422636 | |
https://github.com/dogsheep/dogsheep-photos/issues/20#issuecomment-624408738 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/20 | 624408738 | MDEyOklzc3VlQ29tbWVudDYyNDQwODczOA== | 9599 | 2020-05-06T02:21:05Z | 2020-05-06T02:21:32Z | MEMBER | Here's rendering code from my hacked-together not-yet-released S3 image proxy: ```python from starlette.responses import Response from PIL import Image, ExifTags import pyheif for ORIENTATION_TAG in ExifTags.TAGS.keys(): if ExifTags.TAGS[ORIENTATION_TAG] == "Orientation": break ... # Load it into Pillow if ext == "heic": heic = pyheif.read_heif(image_response.content) image = Image.frombytes(mode=heic.mode, size=heic.size, data=heic.data) else: image = Image.open(io.BytesIO(image_response.content)) # Does EXIF tell us to rotate it? try: exif = dict(image._getexif().items()) if exif[ORIENTATION_TAG] == 3: image = image.rotate(180, expand=True) elif exif[ORIENTATION_TAG] == 6: image = image.rotate(270, expand=True) elif exif[ORIENTATION_TAG] == 8: image = image.rotate(90, expand=True) except (AttributeError, KeyError, IndexError): pass # Resize based on ?w= and ?h=, if set width, height = image.size w = request.query_params.get("w") h = request.query_params.get("h") if w is not None or h is not None: if h is None: # Set h based on w w = int(w) h = int((float(height) / width) * w) elif w is None: h = int(h) # Set w based on h w = int((float(width) / height) * h) w = int(w) h = int(h) image.thumbnail((w, h)) # ?bw= converts to black and white if request.query_params.get("bw"): image = image.convert("L") # ?q= sets the quality - defaults to 75 quality = 75 q = request.query_params.get("q") if q and q.isdigit() and 1 <= int(q) <= 100: quality = int(q) # Output as JPEG or PNG output_image = io.BytesIO() image_type = "JPEG" kwargs = {"quality": quality} if image.format == "PNG": image_type = "PNG" kwargs = {} … | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
613006393 | |
https://github.com/dogsheep/dogsheep-photos/issues/20#issuecomment-624408370 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/20 | 624408370 | MDEyOklzc3VlQ29tbWVudDYyNDQwODM3MA== | 9599 | 2020-05-06T02:19:27Z | 2020-05-06T02:19:27Z | MEMBER | 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. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
613006393 | |
https://github.com/dogsheep/dogsheep-photos/issues/20#issuecomment-624408220 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/20 | 624408220 | MDEyOklzc3VlQ29tbWVudDYyNDQwODIyMA== | 9599 | 2020-05-06T02:18:47Z | 2020-05-06T02:18:47Z | MEMBER | The `apple_photos` table has an indexed `uuid` column and a `path` column which stores the full path to that photo file on disk. I can write a custom Datasette plugin which takes the `uuid` from the URL, looks up the path, then serves up a thumbnail of the jpeg or heic image file. I'll prototype this is a one-off plugin first, then package it on PyPI for other people to install. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
613006393 | |
https://github.com/dogsheep/dogsheep-photos/issues/19#issuecomment-624406285 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/19 | 624406285 | MDEyOklzc3VlQ29tbWVudDYyNDQwNjI4NQ== | 9599 | 2020-05-06T02:10:03Z | 2020-05-06T02:10:03Z | MEMBER | Most annoying part of this is the difficulty of actually showing a photo. Maybe I need to run a local proxy that I can link to? A custom Datasette plugin perhaps? | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
613002220 | |
https://github.com/dogsheep/dogsheep-photos/issues/18#issuecomment-624364557 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/18 | 624364557 | MDEyOklzc3VlQ29tbWVudDYyNDM2NDU1Nw== | 9599 | 2020-05-05T23:49:18Z | 2020-05-05T23:49:18Z | MEMBER | Label is `macos-latest` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612860758 | |
https://github.com/dogsheep/dogsheep-photos/issues/17#issuecomment-624284539 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/17 | 624284539 | MDEyOklzc3VlQ29tbWVudDYyNDI4NDUzOQ== | 41546558 | 2020-05-05T20:20:05Z | 2020-05-05T20:20:05Z | CONTRIBUTOR | FYI, I've got an [issue](https://github.com/RhetTbull/osxphotos/issues/25) to make osxphotos cross-platform but it's low on my priority list. About 90% of the functionality could be done cross-platform but right now the MacOS specific stuff is embedded throughout and would take some work. Though I try to minimize it, there's sprinklings of ObjC & Applescript throughout osxphotos. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612860531 | |
https://github.com/dogsheep/dogsheep-photos/issues/17#issuecomment-624278714 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/17 | 624278714 | MDEyOklzc3VlQ29tbWVudDYyNDI3ODcxNA== | 9599 | 2020-05-05T20:07:19Z | 2020-05-05T20:07:19Z | MEMBER | From https://hynek.me/articles/conditional-python-dependencies/ I think this will look like: ```python setup( # ... install_requires=[ # ... "osxphotos>=0.28.13 ; sys_platform=='darwin'", ] ) ``` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612860531 | |
https://github.com/dogsheep/dogsheep-photos/issues/17#issuecomment-624278090 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/17 | 624278090 | MDEyOklzc3VlQ29tbWVudDYyNDI3ODA5MA== | 9599 | 2020-05-05T20:06:01Z | 2020-05-05T20:06:01Z | MEMBER | https://www.python.org/dev/peps/pep-0508/#environment-markers I think I want `sys_platform` of `darwin`. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612860531 | |
https://github.com/simonw/sqlite-utils/issues/109#issuecomment-624099524 | https://api.github.com/repos/simonw/sqlite-utils/issues/109 | 624099524 | MDEyOklzc3VlQ29tbWVudDYyNDA5OTUyNA== | 9599 | 2020-05-05T14:46:53Z | 2020-05-05T14:46:53Z | OWNER | This already exists, it's just called `if_not_exists=True`. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612658444 | |
https://github.com/dogsheep/dogsheep-photos/issues/16#issuecomment-623865250 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/16 | 623865250 | MDEyOklzc3VlQ29tbWVudDYyMzg2NTI1MA== | 9599 | 2020-05-05T05:38:16Z | 2020-05-05T05:38:16Z | MEMBER | It looks like `groups.content_string` often has a null byte in it. I should clean this up as part of the import. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612287234 | |
https://github.com/dogsheep/dogsheep-photos/issues/16#issuecomment-623863902 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/16 | 623863902 | MDEyOklzc3VlQ29tbWVudDYyMzg2MzkwMg== | 9599 | 2020-05-05T05:31:53Z | 2020-05-05T05:31:53Z | MEMBER | Yes! Turning those `rowid` values into `id` with this script did the job: ```python import sqlite3 import sqlite_utils conn = sqlite3.connect( "/Users/simon/Pictures/Photos Library.photoslibrary/database/search/psi.sqlite" ) def all_rows(table): result = conn.execute("select rowid as id, * from {}".format(table)) cols = [c[0] for c in result.description] for row in result.fetchall(): yield dict(zip(cols, row)) if __name__ == "__main__": db = sqlite_utils.Database("psi_copy.db") for table in ("assets", "collections", "ga", "gc", "groups"): db[table].upsert_all(all_rows(table), pk="id", alter=True) ``` Then I ran this query: ```sql select json_object('img_src', 'https://photos.simonwillison.net/i/' || photos.sha256 || '.' || photos.ext || '?w=400') as photo, group_concat(strip_null_chars(groups.content_string), ' ') as words, assets.uuid_0, assets.uuid_1, to_uuid(assets.uuid_0, assets.uuid_1) as uuid from assets join ga on assets.id = ga.assetid join groups on ga.groupid = groups.id join photos on photos.uuid = to_uuid(assets.uuid_0, assets.uuid_1) where groups.category = 2024 group by assets.id order by random() limit 10 ``` And got these results! <img width="1054" alt="psi_copy__select_json_object__img_src____https___photos_simonwillison_net_i______photos_sha256___________photos_ext______w_400___as_photo__group_concat_strip_null_chars_groups_content_string________as_words__assets_uuid_0__assets_uuid_1__to" src="https://user-images.githubusercontent.com/9599/81037264-f1021a80-8e56-11ea-9924-6f9f55a0fb4b.png"> | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612287234 | |
https://github.com/dogsheep/dogsheep-photos/issues/16#issuecomment-623857417 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/16 | 623857417 | MDEyOklzc3VlQ29tbWVudDYyMzg1NzQxNw== | 9599 | 2020-05-05T05:01:47Z | 2020-05-05T05:01:47Z | MEMBER | Even that didn't work - it didn't copy across the rowid values. I'm pretty sure that's what's wrong here: ``` sqlite3 /Users/simon/Pictures/Photos\ Library.photoslibrary/database/search/psi.sqlite 'select rowid, uuid_0, uuid_1 from assets limit 10' 1619605|-9205353363298198838|4814875488794983828 1641378|-9205348195631362269|390804289838822030 1634974|-9205331524553603243|-3834026796261633148 1619083|-9205326176986145401|7563404215614709654 22131|-9205315724827218763|8370531509591906734 1645633|-9205247376092758131|-1311540150497601346 ``` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612287234 | |
https://github.com/dogsheep/dogsheep-photos/issues/16#issuecomment-623855885 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/16 | 623855885 | MDEyOklzc3VlQ29tbWVudDYyMzg1NTg4NQ== | 9599 | 2020-05-05T04:54:39Z | 2020-05-05T04:54:53Z | MEMBER | Trying this import mechanism instead: `sqlite3 /Users/simon/Pictures/Photos\ Library.photoslibrary/database/search/psi.sqlite .dump | grep -v 'CREATE INDEX' | grep -v 'CREATE TRIGGER' | grep -v 'CREATE VIRTUAL TABLE' | sqlite3 search.db` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612287234 | |
https://github.com/dogsheep/dogsheep-photos/issues/16#issuecomment-623855841 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/16 | 623855841 | MDEyOklzc3VlQ29tbWVudDYyMzg1NTg0MQ== | 9599 | 2020-05-05T04:54:28Z | 2020-05-05T04:54:28Z | MEMBER | Things were not matching up for me correctly: <img width="1143" alt="search__select_json_object__img_src____https___photos_simonwillison_net_i______photos_sha256___________photos_ext______w_400___as_photo__groups_content_string__assets_uuid_0__assets_uuid_1__to_uuid_assets_uuid_0__assets_uuid_1__as_uuid__pho" src="https://user-images.githubusercontent.com/9599/81035923-ca8db080-8e51-11ea-95a7-6ee60bae7502.png"> I think that's because my import script didn't correctly import the existing `rowid` values. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612287234 | |
https://github.com/dogsheep/dogsheep-photos/issues/16#issuecomment-623846880 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/16 | 623846880 | MDEyOklzc3VlQ29tbWVudDYyMzg0Njg4MA== | 9599 | 2020-05-05T04:06:08Z | 2020-05-05T04:06:08Z | MEMBER | This function seems to convert them into UUIDs that match my photos: ```python def to_uuid(uuid_0, uuid_1): b = uuid_0.to_bytes(8, 'little', signed=True) + uuid_1.to_bytes(8, 'little', signed=True) return str(uuid.UUID(bytes=b)).upper() ``` | { "total_count": 1, "+1": 0, "-1": 0, "laugh": 0, "hooray": 1, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612287234 | |
https://github.com/dogsheep/dogsheep-photos/issues/16#issuecomment-623845014 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/16 | 623845014 | MDEyOklzc3VlQ29tbWVudDYyMzg0NTAxNA== | 41546558 | 2020-05-05T03:55:14Z | 2020-05-05T03:56:24Z | CONTRIBUTOR | I'm traveling w/o access to my Mac so can't help with any code right now. I suspected ZSCENEIDENTIFIER was a foreign key into one of these psi.sqlite tables. But looks like you're on to something connecting groups to assets. As for the UUID, I think there's two ints because each is 64-bits but UUIDs are 128-bits. Thus they need to be combined to get the 128 bit UUID. You might be able to use Apple's [NSUUID](https://developer.apple.com/documentation/foundation/nsuuid?language=objc), for example, by wrapping with pyObjC. Here's one [example](https://github.com/ronaldoussoren/pyobjc/blob/881c82a7ba90f193934b52b44143360c80dce5e5/pyobjc-framework-Cocoa/PyObjCTest/test_nsuuid.py) of using this in PyObjC's test suite. Interesting it's stored this way instead of a UUIDString as in Photos.sqlite. Perhaps it for faster indexing. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612287234 | |
https://github.com/dogsheep/dogsheep-photos/issues/16#issuecomment-623811131 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/16 | 623811131 | MDEyOklzc3VlQ29tbWVudDYyMzgxMTEzMQ== | 9599 | 2020-05-05T03:16:18Z | 2020-05-05T03:16:18Z | MEMBER | Here's how to convert two integers unto a UUID using Java. Not sure if it's the solution I need though (or how to do the same thing in Python): https://repl.it/repls/EuphoricSomberClasslibrary <img width="1494" alt="Repl_it_-_EuphoricSomberClasslibrary" src="https://user-images.githubusercontent.com/9599/81032267-0d488c00-8e44-11ea-9be7-680eaccd1611.png"> ```java import java.util.UUID; class Main { public static void main(String[] args) { java.util.UUID uuid = new java.util.UUID( 2544182952487526660L, -3640314103732024685L ); System.out.println( uuid ); } } ``` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612287234 | |
https://github.com/dogsheep/dogsheep-photos/issues/16#issuecomment-623807568 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/16 | 623807568 | MDEyOklzc3VlQ29tbWVudDYyMzgwNzU2OA== | 9599 | 2020-05-05T02:56:06Z | 2020-05-05T02:56:06Z | MEMBER | I'm pretty sure this is what I'm after. The `groups` table has what looks like identified labels in the rows with category = 2025: <img width="1122" alt="words__groups__2_528_rows_where_where_category___2025" src="https://user-images.githubusercontent.com/9599/81031361-e0df4080-8e40-11ea-9060-6d850aa52140.png"> Then there's a `ga` table that maps groups to assets: <img width="304" alt="words__ga__633_653_rows" src="https://user-images.githubusercontent.com/9599/81031387-f48aa700-8e40-11ea-9a3d-da23903be928.png"> And an `assets` table which looks like it has one row for every one of my photos: <img width="645" alt="words__assets__40_419_rows" src="https://user-images.githubusercontent.com/9599/81031402-04a28680-8e41-11ea-8047-e9199d068563.png"> One major challenge: these UUIDs are split into two integer numbers, `uuid_0` and `uuid_1` - but the main photos database uses regular UUIDs like this: ![image](https://user-images.githubusercontent.com/9599/81031481-39164280-8e41-11ea-983b-005ced641a18.png) I need to figure out how to match up these two different UUID representations. I asked on Twitter if anyone has any ideas: https://twitter.com/simonw/status/1257500689019703296 | { "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612287234 | |
https://github.com/dogsheep/dogsheep-photos/issues/16#issuecomment-623806687 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/16 | 623806687 | MDEyOklzc3VlQ29tbWVudDYyMzgwNjY4Nw== | 9599 | 2020-05-05T02:51:16Z | 2020-05-05T02:51:16Z | MEMBER | Running datasette against it directly doesn't work: ``` simon@Simons-MacBook-Pro search % datasette psi.sqlite Serve! files=('psi.sqlite',) (immutables=()) on port 8001 Usage: datasette serve [OPTIONS] [FILES]... Error: Connection to psi.sqlite failed check: no such tokenizer: PSITokenizer ``` Instead, I created a new SQLite database with a copy of some of the key tables, like this: ``` sqlite-utils rows psi.sqlite groups | sqlite-utils insert /tmp/search.db groups - sqlite-utils rows psi.sqlite assets | sqlite-utils insert /tmp/search.db assets - sqlite-utils rows psi.sqlite ga | sqlite-utils insert /tmp/search.db ga - sqlite-utils rows psi.sqlite collections | sqlite-utils insert /tmp/search.db collections - sqlite-utils rows psi.sqlite gc | sqlite-utils insert /tmp/search.db gc - sqlite-utils rows psi.sqlite lookup | sqlite-utils insert /tmp/search.db lookup - ``` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612287234 | |
https://github.com/dogsheep/dogsheep-photos/issues/16#issuecomment-623806533 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/16 | 623806533 | MDEyOklzc3VlQ29tbWVudDYyMzgwNjUzMw== | 9599 | 2020-05-05T02:50:16Z | 2020-05-05T02:50:16Z | MEMBER | I figured there must be a separate database that Photos uses to store the text of the identified labels. I used "Open Files and Ports" in Activity Monitor against the Photos app to try and spot candidates... and found `/Users/simon/Pictures/Photos Library.photoslibrary/database/search/psi.sqlite` - a 53MB SQLite database file. <img width="1365" alt="Item-0_and_Item-0_and_Item-0_and_Item-0" src="https://user-images.githubusercontent.com/9599/81031213-61ea0800-8e40-11ea-8237-cfce4a5128e0.png"> Here's the schema of that file: ``` $ sqlite3 psi.sqlite .schema CREATE TABLE word_embedding(word TEXT, extended_word TEXT, score DOUBLE); CREATE INDEX word_embedding_index ON word_embedding(word); CREATE VIRTUAL TABLE word_embedding_prefix USING fts5(extended_word) /* word_embedding_prefix(extended_word) */; CREATE TABLE IF NOT EXISTS 'word_embedding_prefix_data'(id INTEGER PRIMARY KEY, block BLOB); CREATE TABLE IF NOT EXISTS 'word_embedding_prefix_idx'(segid, term, pgno, PRIMARY KEY(segid, term)) WITHOUT ROWID; CREATE TABLE IF NOT EXISTS 'word_embedding_prefix_content'(id INTEGER PRIMARY KEY, c0); CREATE TABLE IF NOT EXISTS 'word_embedding_prefix_docsize'(id INTEGER PRIMARY KEY, sz BLOB); CREATE TABLE IF NOT EXISTS 'word_embedding_prefix_config'(k PRIMARY KEY, v) WITHOUT ROWID; CREATE TABLE groups(category INT2, owning_groupid INT, content_string TEXT, normalized_string TEXT, lookup_identifier TEXT, token_ranges_0 INT8, token_ranges_1 INT8, UNIQUE(category, owning_groupid, content_string, lookup_identifier, token_ranges_0, token_ranges_1)); CREATE TABLE assets(uuid_0 INT, uuid_1 INT, creationDate INT, UNIQUE(uuid_0, uuid_1)); CREATE TABLE ga(groupid INT, assetid INT, PRIMARY KEY(groupid, assetid)); CREATE TABLE collections(uuid_0 INT, uuid_1 INT, startDate INT, endDate INT, title TEXT, subtitle TEXT, keyAssetUUID_0 INT, keyAssetUUID_1 INT, typeAndNumberOfAssets INT32, sortDate DOUBLE, UNIQUE(uuid_0, uuid_1)); CREATE TABLE gc(groupid INT, collectionid INT, PRIMARY KEY(groupid, collectionid)); CREATE… | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612287234 | |
https://github.com/dogsheep/dogsheep-photos/issues/16#issuecomment-623806085 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/16 | 623806085 | MDEyOklzc3VlQ29tbWVudDYyMzgwNjA4NQ== | 9599 | 2020-05-05T02:47:18Z | 2020-05-05T02:47:18Z | MEMBER | In https://github.com/RhetTbull/osxphotos/issues/121#issuecomment-623249263 Rhet Turnbull spotted a table called `ZSCENEIDENTIFIER` which looked like it might have the right data, but the columns in it aren't particularly helpful: ``` Z_PK,Z_ENT,Z_OPT,ZSCENEIDENTIFIER,ZASSETATTRIBUTES,ZCONFIDENCE 8,49,1,731,5,0.11834716796875 9,49,1,684,6,0.0233648251742125 10,49,1,1702,1,0.026153564453125 ``` I love the look of those confidence scores, but what do the numbers mean? | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612287234 | |
https://github.com/dogsheep/dogsheep-photos/issues/16#issuecomment-623805823 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/16 | 623805823 | MDEyOklzc3VlQ29tbWVudDYyMzgwNTgyMw== | 9599 | 2020-05-05T02:45:56Z | 2020-05-05T02:45:56Z | MEMBER | I filed an issue with `osxphotos` about this here: https://github.com/RhetTbull/osxphotos/issues/121 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612287234 | |
https://github.com/dogsheep/dogsheep-photos/issues/15#issuecomment-623739934 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/15 | 623739934 | MDEyOklzc3VlQ29tbWVudDYyMzczOTkzNA== | 9599 | 2020-05-04T22:24:26Z | 2020-05-04T22:24:26Z | MEMBER | Twitter thread with some examples of photos that are coming up from queries against these scores: https://twitter.com/simonw/status/1257434670750408705 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612151767 | |
https://github.com/dogsheep/dogsheep-photos/issues/15#issuecomment-623730934 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/15 | 623730934 | MDEyOklzc3VlQ29tbWVudDYyMzczMDkzNA== | 9599 | 2020-05-04T22:00:38Z | 2020-05-04T22:00:48Z | MEMBER | Here's the query to create the new table: ```sql create table apple_photos_scores as select ZGENERICASSET.ZUUID, ZGENERICASSET.ZOVERALLAESTHETICSCORE, ZGENERICASSET.ZCURATIONSCORE, ZGENERICASSET.ZPROMOTIONSCORE, ZGENERICASSET.ZHIGHLIGHTVISIBILITYSCORE, ZCOMPUTEDASSETATTRIBUTES.ZBEHAVIORALSCORE, ZCOMPUTEDASSETATTRIBUTES.ZFAILURESCORE, ZCOMPUTEDASSETATTRIBUTES.ZHARMONIOUSCOLORSCORE, ZCOMPUTEDASSETATTRIBUTES.ZIMMERSIVENESSSCORE, ZCOMPUTEDASSETATTRIBUTES.ZINTERACTIONSCORE, ZCOMPUTEDASSETATTRIBUTES.ZINTERESTINGSUBJECTSCORE, ZCOMPUTEDASSETATTRIBUTES.ZINTRUSIVEOBJECTPRESENCESCORE, ZCOMPUTEDASSETATTRIBUTES.ZLIVELYCOLORSCORE, ZCOMPUTEDASSETATTRIBUTES.ZLOWLIGHT, ZCOMPUTEDASSETATTRIBUTES.ZNOISESCORE, ZCOMPUTEDASSETATTRIBUTES.ZPLEASANTCAMERATILTSCORE, ZCOMPUTEDASSETATTRIBUTES.ZPLEASANTCOMPOSITIONSCORE, ZCOMPUTEDASSETATTRIBUTES.ZPLEASANTLIGHTINGSCORE, ZCOMPUTEDASSETATTRIBUTES.ZPLEASANTPATTERNSCORE, ZCOMPUTEDASSETATTRIBUTES.ZPLEASANTPERSPECTIVESCORE, ZCOMPUTEDASSETATTRIBUTES.ZPLEASANTPOSTPROCESSINGSCORE, ZCOMPUTEDASSETATTRIBUTES.ZPLEASANTREFLECTIONSSCORE, ZCOMPUTEDASSETATTRIBUTES.ZPLEASANTSYMMETRYSCORE, ZCOMPUTEDASSETATTRIBUTES.ZSHARPLYFOCUSEDSUBJECTSCORE, ZCOMPUTEDASSETATTRIBUTES.ZTASTEFULLYBLURREDSCORE, ZCOMPUTEDASSETATTRIBUTES.ZWELLCHOSENSUBJECTSCORE, ZCOMPUTEDASSETATTRIBUTES.ZWELLFRAMEDSUBJECTSCORE, ZCOMPUTEDASSETATTRIBUTES.ZWELLTIMEDSHOTSCORE from attached.ZGENERICASSET join attached.ZCOMPUTEDASSETATTRIBUTES on attached.ZGENERICASSET.Z_PK = attached.ZCOMPUTEDASSETATTRIBUTES.Z_PK; ``` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612151767 | |
https://github.com/dogsheep/dogsheep-photos/issues/15#issuecomment-623723687 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/15 | 623723687 | MDEyOklzc3VlQ29tbWVudDYyMzcyMzY4Nw== | 9599 | 2020-05-04T21:43:06Z | 2020-05-04T21:43:06Z | MEMBER | It looks like I can map the photos I'm importing to these tables using the `ZUUID` column on `ZGENERICASSET` to get a `Z_PK` which then maps to the rows in `ZGENERICASSET`. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612151767 | |
https://github.com/dogsheep/dogsheep-photos/issues/15#issuecomment-623723026 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/15 | 623723026 | MDEyOklzc3VlQ29tbWVudDYyMzcyMzAyNg== | 9599 | 2020-05-04T21:41:30Z | 2020-05-04T21:41:30Z | MEMBER | I'm going to put these in a table called `apple_photos_scores` - I'll also pull in the following columns from the `ZGENERICASSET` table: * `ZOVERALLAESTHETICSCORE` * `ZCURATIONSCORE` * `ZHIGHLIGHTVISIBILITYSCORE` * `ZPROMOTIONSCORE` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612151767 | |
https://github.com/simonw/datasette/issues/756#issuecomment-623654436 | https://api.github.com/repos/simonw/datasette/issues/756 | 623654436 | MDEyOklzc3VlQ29tbWVudDYyMzY1NDQzNg== | 9599 | 2020-05-04T19:19:06Z | 2020-05-04T19:19:06Z | OWNER | New documentation is here: https://datasette.readthedocs.io/en/latest/installation.html#install-using-pipx | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612089949 | |
https://github.com/simonw/datasette/issues/756#issuecomment-623650324 | https://api.github.com/repos/simonw/datasette/issues/756 | 623650324 | MDEyOklzc3VlQ29tbWVudDYyMzY1MDMyNA== | 9599 | 2020-05-04T19:10:23Z | 2020-05-04T19:10:23Z | OWNER | https://github.com/pipxproject/pipx/issues/79 showed me how to upgrade plugins within the pipx virtual environment. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612089949 | |
https://github.com/simonw/datasette/issues/755#issuecomment-623635525 | https://api.github.com/repos/simonw/datasette/issues/755 | 623635525 | MDEyOklzc3VlQ29tbWVudDYyMzYzNTUyNQ== | 9599 | 2020-05-04T18:40:15Z | 2020-05-04T18:40:15Z | OWNER | ``` $ pytest tests/test_database.py -v ================================================================================ test session starts ================================================================================= platform darwin -- Python 3.7.7, pytest-5.2.4, py-1.8.1, pluggy-0.13.1 -- /Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/bin/python cachedir: .pytest_cache rootdir: /Users/simon/Dropbox/Development/datasette, inifile: pytest.ini plugins: asyncio-0.10.0 collected 9 items tests/test_database.py::test_table_exists[tables0-True] PASSED [ 11%] tests/test_database.py::test_table_exists[tables1-False] PASSED [ 22%] tests/test_database.py::test_get_all_foreign_keys PASSED [ 33%] tests/test_database.py::test_table_names PASSED [ 44%] tests/test_database.py::test_execute_write_block_true PASSED [ 55%] tests/test_database.py::test_execute_write_block_false PASSED [ 66%] tests/test_database.py::test_execute_write_fn_block_false no such column: id PASSED [ 77%] tests/test_database.py::test_execute_write_fn_block_true PASSED … | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
612082842 | |
https://github.com/simonw/datasette/pull/725#issuecomment-623623696 | https://api.github.com/repos/simonw/datasette/issues/725 | 623623696 | MDEyOklzc3VlQ29tbWVudDYyMzYyMzY5Ng== | 4312421 | 2020-05-04T18:16:54Z | 2020-05-04T18:16:54Z | NONE | thanks a lot, Simon | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
598891570 | |
https://github.com/simonw/datasette/issues/752#issuecomment-623598224 | https://api.github.com/repos/simonw/datasette/issues/752 | 623598224 | MDEyOklzc3VlQ29tbWVudDYyMzU5ODIyNA== | 9599 | 2020-05-04T17:28:11Z | 2020-05-04T17:28:20Z | OWNER | Good catch: it looks like we're not specifying the charset for those pages: ``` $ curl -i 'https://latest.datasette.io/404' HTTP/1.1 404 Not Found access-control-allow-origin: * content-type: text/html Date: Mon, 04 May 2020 16:23:25 GMT Server: Google Frontend Content-Length: 605 <!DOCTYPE html> <html> <head> <title>Error 404</title> ``` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
611835285 | |
https://github.com/simonw/datasette/pull/719#issuecomment-623591293 | https://api.github.com/repos/simonw/datasette/issues/719 | 623591293 | MDEyOklzc3VlQ29tbWVudDYyMzU5MTI5Mw== | 9599 | 2020-05-04T17:14:23Z | 2020-05-04T17:14:23Z | OWNER | Thanks, this is a smart fix. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
594553553 | |
https://github.com/simonw/datasette/issues/754#issuecomment-623561480 | https://api.github.com/repos/simonw/datasette/issues/754 | 623561480 | MDEyOklzc3VlQ29tbWVudDYyMzU2MTQ4MA== | 9599 | 2020-05-04T16:17:42Z | 2020-05-04T16:17:42Z | OWNER | Sure enough this run https://travis-ci.org/github/simonw/datasette/jobs/674415040 from that PR no longer shows the warnings. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
611997130 | |
https://github.com/simonw/datasette/pull/725#issuecomment-623560732 | https://api.github.com/repos/simonw/datasette/issues/725 | 623560732 | MDEyOklzc3VlQ29tbWVudDYyMzU2MDczMg== | 9599 | 2020-05-04T16:16:21Z | 2020-05-04T16:16:21Z | OWNER | This may fix #754 warnings. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
598891570 | |
https://github.com/simonw/datasette/issues/754#issuecomment-623560217 | https://api.github.com/repos/simonw/datasette/issues/754 | 623560217 | MDEyOklzc3VlQ29tbWVudDYyMzU2MDIxNw== | 9599 | 2020-05-04T16:15:28Z | 2020-05-04T16:15:28Z | OWNER | I think those will be fixed by an upgrade to aiofiles 0.5.0: https://github.com/Tinche/aiofiles/compare/v0.4.0...v0.5.0 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
611997130 | |
https://github.com/simonw/datasette/pull/730#issuecomment-623463200 | https://api.github.com/repos/simonw/datasette/issues/730 | 623463200 | MDEyOklzc3VlQ29tbWVudDYyMzQ2MzIwMA== | 27856297 | 2020-05-04T13:27:22Z | 2020-05-04T13:27:22Z | CONTRIBUTOR | Superseded by #753. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
604001627 | |
https://github.com/dogsheep/dogsheep-photos/issues/1#issuecomment-623232984 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/1 | 623232984 | MDEyOklzc3VlQ29tbWVudDYyMzIzMjk4NA== | 9599 | 2020-05-04T02:41:32Z | 2020-05-04T02:41:32Z | MEMBER | Needs documentation. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
602533300 | |
https://github.com/simonw/datasette/issues/751#issuecomment-623207741 | https://api.github.com/repos/simonw/datasette/issues/751 | 623207741 | MDEyOklzc3VlQ29tbWVudDYyMzIwNzc0MQ== | 9599 | 2020-05-04T00:14:35Z | 2020-05-04T00:14:35Z | OWNER | I'm calling it `"size"` for consistency with the querystring parameter `_size=`, even though `"page_size"` might be a more accurate name. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
611540797 | |
https://github.com/simonw/datasette/issues/751#issuecomment-623207636 | https://api.github.com/repos/simonw/datasette/issues/751 | 623207636 | MDEyOklzc3VlQ29tbWVudDYyMzIwNzYzNg== | 9599 | 2020-05-04T00:13:46Z | 2020-05-04T00:13:46Z | OWNER | Syntax suggestion: ```json { "databases": { "mydatabase": { "tables": { "example_table": { "sort": "created", "size": 10 } } } } } ``` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
611540797 | |
https://github.com/simonw/datasette/issues/751#issuecomment-623207541 | https://api.github.com/repos/simonw/datasette/issues/751 | 623207541 | MDEyOklzc3VlQ29tbWVudDYyMzIwNzU0MQ== | 9599 | 2020-05-04T00:13:09Z | 2020-05-04T00:13:09Z | OWNER | Relevant code: https://github.com/simonw/datasette/blob/07e208cc6d9e901b87552c1be2854c220b3f9b6d/datasette/views/table.py#L519-L520 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
611540797 | |
https://github.com/dogsheep/dogsheep-photos/issues/1#issuecomment-623199750 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/1 | 623199750 | MDEyOklzc3VlQ29tbWVudDYyMzE5OTc1MA== | 9599 | 2020-05-03T23:17:58Z | 2020-05-03T23:17:58Z | MEMBER | 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 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
602533300 | |
https://github.com/dogsheep/dogsheep-photos/issues/1#issuecomment-623199701 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/1 | 623199701 | MDEyOklzc3VlQ29tbWVudDYyMzE5OTcwMQ== | 9599 | 2020-05-03T23:17:38Z | 2020-05-03T23:17:38Z | MEMBER | Record burst_uuid as a column: ``` (Pdb) with_bursts[0]._info["burstUUID"] '703FAA23-57BF-40B4-8A33-D9CEB143391B' ``` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
602533300 | |
https://github.com/dogsheep/dogsheep-photos/issues/1#issuecomment-623199214 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/1 | 623199214 | MDEyOklzc3VlQ29tbWVudDYyMzE5OTIxNA== | 9599 | 2020-05-03T23:14:08Z | 2020-05-03T23:14:08Z | MEMBER | Albums have UUIDs: ``` (Pdb) photo.album_info[0].__dict__ {'_uuid': '17816791-ABF3-447B-942C-9FA8065EEBBA', '_db': osxphotos.PhotosDB(dbfile='/Users/simon/Pictures/Photos Library.photoslibrary/database/photos.db'), '_title': 'Geotaggable Photos geotagged'} ``` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
602533300 | |
https://github.com/dogsheep/dogsheep-photos/issues/1#issuecomment-623198986 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/1 | 623198986 | MDEyOklzc3VlQ29tbWVudDYyMzE5ODk4Ng== | 9599 | 2020-05-03T23:12:31Z | 2020-05-03T23:12:46Z | MEMBER | To get the taken date in UTC: ``` from datetime import timezone (Pdb) photo.date.astimezone(timezone.utc).isoformat() '2018-02-13T20:21:31.620000+00:00' (Pdb) photo.date.astimezone(timezone.utc).isoformat().split(".") ['2018-02-13T20:21:31', '620000+00:00'] (Pdb) photo.date.astimezone(timezone.utc).isoformat().split(".")[0] '2018-02-13T20:21:31' (Pdb) photo.date.astimezone(timezone.utc).isoformat().split(".")[0] + "+00:00" '2018-02-13T20:21:31+00:00' ``` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
602533300 | |
https://github.com/dogsheep/dogsheep-photos/issues/1#issuecomment-623198653 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/1 | 623198653 | MDEyOklzc3VlQ29tbWVudDYyMzE5ODY1Mw== | 9599 | 2020-05-03T23:09:57Z | 2020-05-03T23:09:57Z | MEMBER | For locations: I'll add `place_x` columns for all of these: ``` (Pdb) photo.place.address._asdict() {'street': None, 'sub_locality': None, 'city': 'Loreto', 'sub_administrative_area': 'Loreto', 'state_province': 'BCS', 'postal_code': None, 'country': 'Mexico', 'iso_country_code': 'MX'} ``` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
602533300 | |
https://github.com/dogsheep/dogsheep-photos/issues/1#issuecomment-623195197 | https://api.github.com/repos/dogsheep/dogsheep-photos/issues/1 | 623195197 | MDEyOklzc3VlQ29tbWVudDYyMzE5NTE5Nw== | 9599 | 2020-05-03T22:44:33Z | 2020-05-03T22:44:33Z | MEMBER | Command will be this: $ photos-to-sqlite apple-photos photos.db This will populate a `apple_photos` table with the data imported by the `osxphotos` library, plus the calculated sha256. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
602533300 |