Skip to content

A python script to sort home-made media by date, camera, etc...

License

Notifications You must be signed in to change notification settings

obeidahmad/family-media-sorter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

Media Sorter

A simple script to sort your media!
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Roadmap
  4. Contributing
  5. License
  6. Contact
  7. Acknowledgments

About The Project

There are many great media sorters out there, but none really suited me. So I created my own. The main idea here is simplicity, and the ability to sort even media who has missing or unusual tags. This app is built with Python and leverages ExifTool.

(back to top)

Getting Started

Prerequisites

  • You first need to have ExifTool (minimum version of 12.15) installed from here. Make sure to follow the steps in the official docs.
  • Download the latest stable solution from here.

NOTE: Currently only Linux is supported.

Usage

Now everything is installed, you should know that the solution is made of 2 independent but complimentary steps:

Creation of the Exec File

To generate the exec file:

app -m create <media_dir> <new_dir>

A file of the name exec_file.json will be created.

The Exec File is a json file that contains the different media files found. In that file they will be mapped to there new desired location in addition to some parameters. Typically, it would look like the following:

{
  "$options": {
    "mode": "COPY",
    "delete_empty_dir": true,
    "delete_error_files": true,
    "delete_exec_file": true
  },
  "path_mapping": {
    "new_dir":{
      "YYYY.MM": {
        "Camera": {
          "date.png": "old_path"
        }
      },
      ...
    },
    ...
  },
  "errors": {
    "error_file_path": "error_message",
    ...
  }
}

As you can see $option contains the different settings, path_mapping contains the mapping starting with a tree structure for the new path mapped to the old path, errors contains all the paths of the unrecognized files (or any other error that would show as the error_message)

The new path created is in the following format new_dir/YYYY.MM/Camera/date.png. You can change anything in this file as long as you keep the structure. Thus, allowing you to have complete control.

Executing the Exec File

After creating the Exec File you can execute it using:

app -m execute

Extra Options

If you need to see all available options use:

app -h

(back to top)

Roadmap

  • Add Linux Support
  • Add Windows Support
  • Allow for more control during the creation of the Exec File
  • Create version with packaged ExifTool
  • Use a better file structure than Json

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Any contribution is greatly appreciated. If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

You can also fork the project and submit a pull request.

(back to top)

License

Distributed under the Apache-2.0 License. See LICENSE.txt for more information.

(back to top)

Contact

Ahmad Obeid - obeid.ahmad2001@outlook.com

Project Link: https://github.com/obeidahmad/family-media-sorter

(back to top)

Acknowledgments

The amazing resources and library that made this project possible:

(back to top)