graphql-php-sqlite
A naïve GraphQL interface for querying photos.db from Apple Photos app.
TODO:
-
get image data:
-
imagePath
-
name (caption)
-
lat/lng
-
dimensions
-
imageDate
-
type
-
albums where the photo appears in?
-
-
search criteria (all optional):
-
q (freetext) (multi?)
-
{lat,long}{Min,Max} = 12.34567
-
date{Min,Max}
-
type = IMAGE|VIDEO
-
album name
-
keywords automatically assigned by Photos
-
-
fetch aggregate data (result count by date; geolocation clusters?)
-
order by = DATE_ASC|DATE_DESC
-
pagination
=======
- Clone the repo
- Copy
photos.db
to the same directory where you created the repo subdirectory. NB: You probably want to use a copy ofphotos.db
, since the master database is usually locked in macOS. - Make sure you have composer installed, with e.g.
brew install composer
. Navigate to the project folder and runcomposer install
docker run --rm -p 8080:80 -e LOG_STDOUT=true -e LOG_STDERR=true -e LOG_LEVEL=debug -v $HOME/dev/gallery2:/var/www/html -v $HOME/Pictures/Photos\ Library.photoslibrary:/var/www/html/photosroot fauria/lamp
- Install and open ChromeiQL extension to Chrome. Endpoint: http://localhost:8080/graphql-php-sqlite/server/api.php
Try with this query:
{
photos {
imagePath
name
}
}
Or this:
{
photos(q:"foo") {
imagePath
name
}
}