Git Product home page Git Product logo

photosorter's Introduction

photosorter

Build Status Coverage Status

A little Python daemon to keep my photos organized on Dropbox.

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/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 deduplicated by adding a suffix (-1, -2, etc) to their filenames.

The result looks somewhat like this:

├── 2013
│   ├── 2013-01
│   │   ├── 2013-01-05\ 13.24.45.jpg
│   │   ├── 2013-01-05\ 14.25.54.jpg
│   │   ├── 2013-01-05\ 21.28.48-1.jpg
│   │   ├── 2013-01-06\ 16.05.02.jpg
│   │   ├── 2013-01-06\ 19.59.25.jpg
│   │   ├── 2013-01-06\ 20.40.28.jpg
│   │   ├── 2013-01-06\ 21.14.38.jpg
│   │   ├── 2013-01-08\ 11.45.51.jpg
│   ├── 2013-02
│   |   ├─ ...
│   ├── ...
│   └── 2013-12
├── 2014
│   ├── 2014-01
│   ├── 2014-02
│   ├── ...
│   └── 2014-12
├── ...

I use ~/Dropbox/Camera Uploads as the source directory and ~/Dropbox/Photos as the target. This means I can use Dropbox's phone apps to automatically upload and organize new photos.

Inspired by

Setup

$ git clone [email protected]:dbader/photosorter.git
$ cd photosorter
$ pyvenv venv
$ . venv/bin/activate
$ pip install -r dev-requirements.txt
$ py.test

Run

Watch src_dir and sort incoming photos into dest_dir.

$ ./sorter.py src_dir dest_dir

Run on startup

  1. 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.
  2. Run $ sudo start photosorter.
  3. Check the logs at /var/log/upstart/photosorter.log.

Meta

Daniel Bader – @dbader_org[email protected]

Distributed under the MIT license. See LICENSE for more information.

https://github.com/dbader/photosorter

photosorter's People

Contributors

dbader avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

photosorter's Issues

Suggest making sorter.py non-executable

Dan:

Fascinating code. Not only is it an excellent py.test tutorial, it's something I can actually use at home, first such an example for me.

I'd suggest making sorter.py non-executable though to make it a little more user friendly. There's no guarantee my python is in /user/bin/env, right?

System Requirements

Wow this looks like just what I need! But it doesn't say what platform it is targeted at - OSX or Linux? Any specific distros? Perhaps you can add this to the README...

Thanks for sharing!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.