Skip to main content

Photo sifter

Photo 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 Usage

Simplest way is to install package with pip:

pip install photosifter

The minimum version of Python runtime is 3.6 (due to the usage of f-Strings).

Start by running photosifter local <folder> to sift through the images in a given folder, or run photosifter guide to see all modes of operation and app key bindings.

Remote mode

The 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-user option 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 the gphotos_deleter section 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 to create your own Google Project and use it instead of the supplied one, simply replace the client_secret.json file in the auth directory with yours. However, be assured that using the supplied project is no less secure than using your own.

GPhotos_deleter

Each 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 the gphotos_deleter and do so automatically in a way that human would (script starts a browser, and then one by one automatically deletes all images given).

gphotos_deleter does 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_TITLE and CONFIRMATION_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 from here. Place chromedriver somewhere in the PATH or explicitly pass it with --chromedriver option. After all, is set up, you can start the script with:

gphotos_deleter --file yourfile.json

The 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 from photosifter cannot 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 why 404 screens 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 included gphotos_deleter, while cool, is obviously not the best way of doing so.

Known Issues

Arrow keys can sometimes stop working after pressing tab key (not sure why). For that reason, there is a second set of keys with the same functionality (, and .). Restarting also solves this issue.

Author

Jakub Kulik - kulikjak

License

This project is licensed under the MIT License - see the LICENSE file for details

Links

Release files for photosifter 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for photosifter 0.1.3
File Size Uploaded
photosifter-0.1.3.tar.gz 20.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for photosifter 0.1.3
File Interpreter ABI Platform
photosifter-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 41.8 kB

Release files / photosifter-0.1.3.tar.gz

Download URL photosifter-0.1.3.tar.gz
Size 20.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4def4f425a9f695e3097560d4f4e1422894deb751dd5f028bcc4570ba088d68a
BLAKE2b-256 checksum
How to use checksums
d3dfac055f0ea5aa73c65bcb19bca90409402431a1b4f592d41106391dc5a22f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / photosifter-0.1.3-py3-none-any.whl

Download URL photosifter-0.1.3-py3-none-any.whl
Size 21.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
18b3eae2209b7ace0d10d4120a279aea3bd4f194ab157526666ba945a9e391a4
BLAKE2b-256 checksum
How to use checksums
630ed1b199208822ed397606b12405d8759505a80238f74bb554c718b60825c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page