Package: photosifter
Photo sifterPhoto sifter is a simple application, written in Python, for smooth photo sifting and comparison. It can work locally as well as (with some additional setup) directly with remote Google Images.I wrote this because I do often take several photos in quick succession (to reduce the possibility of them being fuzzed) and Google Photos is not the best place to find the best of them. It lacks the ability to display two or more images near each other as well as some arbitrary focus metric, both of which are in this application and help immensely.Also, it is much faster because there are no unnecessary animations and loading (images are dynamically preloaded in the background).Installation and UsageSimplest way is to install package with pip:pip install photosifterThe minimum version of Python runtime is 3.6 (due to the usage of f-Strings).Start by runningphotosifter local <folder>to sift through the images in a given folder, or runphotosifter guideto see all modes of operation and app key bindings.Remote modeThe first time you use the app in a remote mode, you will be asked to give photosifter a proper authorization to work with your Google photos. The application will remember you, and you won't have to login again next time you use it. If you don't want to be remembered, pass--forget-useroption to the application (this is important mainly on public machines).Note that Google Photos API is still young and very limited, and cannot be used directly for deleting images (or even adding them to albums). To get around this limitation, see thegphotos_deletersection below. Also, due to this limitation, you won't have to be afraid that something wrong will happen with your images when using this application.NOTE: If you want tocreateyour own Google Project and use it instead of the supplied one, simply replace theclient_secret.jsonfile in theauthdirectory with yours. However, be assured that using the supplied project is no less secure than using your own.GPhotos_deleterEach time you use the app in remote mode, JSON file with image URLs of deleted images is created in the application folder. You can either delete images manually or use thegphotos_deleterand do so automatically in a way that human would (script starts a browser, and then one by one automatically deletes all images given).gphotos_deleterdoes so by looking for certain elements on the screen and clicking them. Because it searches for element values which are different for each language, you might need to change them for yours (DELETE_BUTTON_TITLEandCONFIRMATION_TEXT- both at the top of the script).Before using it, you will also need to install selenium python package (pip install selenium) and download a chrome webdriver fromhere. Place chromedriver somewhere in the PATH or explicitly pass it with--chromedriveroption. After all, is set up, you can start the script with:gphotos_deleter --file yourfile.jsonThe first time you start the deleter, you will be asked to log into your Google Photos (sadly, since this is a different way of authentication, login from here and fromphotosiftercannot be combined into a single one), then deleter will proceed with the deletion. After all, images are deleted, deleter checks that they really are (that is why404screens start appearing, so don't worry). If some are still not deleted, it tries to do that once more.Note that while tested, this way of deleting images is somewhat sketchy so there is a small chance that the wrong one will be deleted (even though I never seen it once during testing). Also, I am not sure how well will it work on slow internet connection (time limits and delays might need to be adjusted for that).NOTE:Once (if ever) Google API allows deletion, I will surely include it here because includedgphotos_deleter, while cool, is obviously not the best way of doing so.Known IssuesArrow keys can sometimes stop working after pressingtabkey (not sure why). For that reason, there is a second set of keys with the same functionality (,and.). Restarting also solves this issue.AuthorJakub Kulik-kulikjakLicenseThis project is licensed under the MIT License - see theLICENSEfile for detailsLinksProject repositoryPypi page