A Python script to keep my photos from Dropbox organized.
Project description
A little Python script to keep my photos from Dropbox organized. Designed to be run intermittently, but will run forever by default.
It watches a source directory for modifications and moves new image files to a target directory depending on when the photo was taken, using EXIF data and creation date as a fallback.
Directory and file names follow a simple naming convention (YYYY-MM/YYY_MM_DD/YYYY-MM-DD hh:mm:ss.ext) that keeps everything neatly organized. Duplicates are detected and ignored based on their SHA1 hash. Photos taken in the same instant get de-duplicated by adding a suffix (-1, -2, etc) to their filenames.
The result looks somewhat like this:
├── 2013-01 │  ├── 2013_01_05 │ │  ├── 2013-01-0513.24.45.jpg │ │  ├── 2013-01-0514.25.54.jpg │ │  └── 2013-01-0521.28.48-1.jpg │  ├── 2013_01_06 │ │  ├── 2013-01-0616.05.02.jpg │ │  ├── 2013-01-0619.59.25.jpg │ │  ├── 2013-01-0620.40.28.jpg │ │  └── 2013-01-0621.14.38.jpg │  └── 2013_01_08 │   └── 2013-01-0811.45.51.jpg ├── 2013-02 | └─ … ├── … ├── 2013-12 ├── 2014-01 ├── 2014-02 ├── … ├── 2014-12 ├── …
I use C:\Users\[windows username\Dropbox\Camera Uploads as the source directory and Z:\Photos as the target. This allows me to move my photo from Dropbox to a local drive, and merge them with the rest of my photo collection.
Inspired by
<http://simplicitybliss.com/exporting-your-iphoto-library-to-dropbox/>
<http://chambersdaily.com/learning-to-love-photo-management/>
<https://dbader.org/blog/how-to-store-photos-in-the-cloud-and-avoid-vendor-lock-in>
Setup
The easiest way to install the script is through pip:
> pip install minchin.scripts.photosorter
Run
Watch src_dir and sort incoming photos into dest_dir:
> photosorter src_dir dest_dir
When you’re done with it, Ctrl + C will end the program.
If you also want to move the existing files in src_dir (which are, by default, ignored):
> photosorter src_dir dest_dir –move-existing
Run on System Startup
Move photosorter.conf.example to /etc/init as photosorter.conf and edit it to suit your needs by replacing the user, source and target directories.
Run $ sudo start photosorter.
Check the logs at /var/log/upstart/photosorter.log.
Meta
Distributed under the MIT license. See LICENSE.txt for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for minchin.scripts.photosorter-2.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e6d1de992c46dd69a754042d43fc1b459b07c84d2e8c6065cc57548c8dc4365 |
|
MD5 | 84dcf74c833cc5750411b81c0484b038 |
|
BLAKE2b-256 | bba8a7fd6afb6b868583d29dc0fa5ec365b45dd83d51b6d18f85c49c46b3e8f9 |
Hashes for minchin.scripts.photosorter-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6992a1f51ffc737eb47717a0f57532c8db3595b823d3ef6e6548c543db05fc1e |
|
MD5 | 8f8f0ac50e9d04dd6718cdbc5ec0f85a |
|
BLAKE2b-256 | e78914d804f269f594742aa4983ee954e75004b54ca46364607ac3e205e47631 |