Photo Import

A tool for importing photos from one directory into a hierarchical folder structure in another directory based on the EXIF data of the photos.

The idea is that you’re able to sort a folder full of photos (such as those straight off a memory card) into a navigable hierarchy like the following:

$ tree Photos
└── 2019
    ├── 03
    │   ├── 11
    │   │   ├── photo1.jpg
    │   │   ├── photo2.jpg
    │   │   └── photo3.jpg
    │   ├── 12
    │   │   └── photo4.jpg
    │   └── 13
    └── 04
        └── 01
            ├── photo5.jpg
            └── photo6.jpg



The photo-import command can be installed via pip as follows:

$ pip install photo-import
$ photo-import --version


Basic usage is as follows:

$ photo-import /path/to/source/image.jpg /path/to/sorted/photos/

This will move image.jpg into an appropriate folder within the /path/to/sorted/photos/ directory, resulting in, for example, /path/to/sorted/photos/2019/03/11/image.jpg.

$ photo-import /path/to/photo-source /path/to/sorted/photos/

This will move all photos found within the /path/to/photo-source directory into an appropriate folder within the /path/to/sorted/photos/ directory, resulting in, for example, /path/to/sorted/photos/2019/03/11/image.jpg.

Further usage instructions are provided by using the --help option:

$ photo-import --help


Running from source

There’s also a “runner” python script provided in the root of this repository for convenience when the source code is checked out locally:

$ pip install -r requirements.txt
$ python --version
$ ./ --version

Commit message format

Commit messages should conform to the conventional commits standard, and to help with this you should install the commitizen tool:

$ pip install -r dev-requirements.txt
$ git add .
$ cz commit


To run the test suite locally, use nose2 for unit tests, and behave for behavioural tests (Note that running behave will run python install, installing photo-import into your current environment):

$ pip install -r requirements.txt
$ nose2
$ behave