Graphical tool to sort images into a folder structure based on the date the images were taken
Project description
Image Sorting Tool
This is a simple graphical tool to sort media into a structured folder. It is designed primarily for JPG images taken with a camera/phone but will also work with MP4, PNG and GIF media files. It works by finding all files in a chosen source directory (including sub-directories) and then based on the chosen sorting options, copies them into a structured destination.
The date-taken for JPG files is extracted from the EXIF data and for all other file formats the filename is used to extract the date-taken. The files destination name will be in format 'yyyymmdd_HHMMSS'. For example '20201225_234532.jpg' The default output structure is year and month folders. For example:
/
├── 2019/
├── 07/
├── 20190712_141507.jpg
└── 20190719_224521.jpg
└── 10/
├── 20191011_180520.jpg
└── 20191029_204731.jpg
└── 2020/
├── 01/
└── 20200114_135312.jpg
└── 03/
└── 20200301_110330.jpg
Files that cannot have the date-taken extracted (missing EXIF or bad filenames) will be copied to a 'failed_to_sort' folder in the root directory of the above structure without any renaming. These files are commonly ones downloaded from the internet or shared through social media.
If your source folder has other files such as binaries, documents, audio recordings, or music, you can choose if you want to ignore them or copy them to an 'other_files' folder with the 'Copy all other files' option.
This tool is multi-threaded to increase performance on high speed storage such as SSDs.
No data in the source directory is altered. It only reads from the source, and then copy operations are performed during the sorting process.
Installation
The tool can be run on Linux, MacOS and Windows provided the following requirements are met
Requirements
- Python (compatible versions are listed at top of readme)
- python3-tk (Comes with Python 3, but may need installing separately in linux)
- pipx (highly recommended, but
pip
will also work)
It is recommended to install image-sorting-tool
with pipx
as it will manage a dedicated environment and all paths for you, eliminating risk of dependency conflicts, etc.
To install run the following
pipx install image-sorting-tool
Usage
Run the following to launch
image-sorting-tool
Upgrading
Run the following to upgrade
pipx upgrade image-sorting-tool
Uninstalling
Run the following to remove the tool from your machine
pipx uninstall image-sorting-tool
Development
To contribute, clone this repo and then install the dev dependencies with
# Installs package locally so code changes will affect behaviour
pip install -e .[dev]
#Launch with -vv flag for debug logs
image-sorting-tool -vv
Automated checks
Linting and unit tests should be checked before committing by running the following:
# Code formatting
black image-sorting-tool
# Linting
pylint image_sorting_tool
# Unit test on current environment python version
pytest
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
File details
Details for the file image-sorting-tool-1.1.0.tar.gz
.
File metadata
- Download URL: image-sorting-tool-1.1.0.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 231a4ccd1ac7c21fe3e904a60cf6d52d58b6dcdb7a52fa98a82d1ae3daf43de6 |
|
MD5 | bc41566e42469203a8cb4efb5d7ae800 |
|
BLAKE2b-256 | 6aa9fdb9d584de6fe1b609305cff32bb0e8463acc6fc3d755c16405c341d6d62 |
File details
Details for the file image_sorting_tool-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: image_sorting_tool-1.1.0-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2b2ad663c4dae60dde08bbe8655aad3d036a3a27d2917ddfe79988df65952c3 |
|
MD5 | 59488e828c889c0b9c8b2eab96e18d59 |
|
BLAKE2b-256 | db008af2a0c2cf993fe57dbbf678436d0f24c50481b2474c41d98dbe90e993fc |