Skip to content

Auto-rename media according to their creation date and time à la Dropbox

License

Notifications You must be signed in to change notification settings

carlosborca/NameDaTaken

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Automated renaming of JPEG files according to their creation date and time.

Category Badges
Foundation License GitHub Top Languages
GitHub Info GitHub Code Size GitHub Commits per Month GitHub Last Commit

Overview

NameDaTaken is a Python 3 code that automates renaming of media files according their creation date and time following the format YYYY-MM-DD HH.MM.SS.ext, commonly used by Dropbox.

General Information

To run NameDaTaken, the code requires Python 3 and its exifread module. So, the instructions to download and install NameDaTaken and to create a conda environment that includes exifread are presented below.

Installation

Minimal set of commands to install NameDaTaken on Linux, MacOS, or Windows (with the Windows Subsystem for Linux). Last tested on 29 April 2020:

1. Install Miniconda:

If you have an installation of Conda in your system, please skip to step 2. Otherwise, Miniconda is required and the installer is available from the the Anaconda website. To download the installer from the terminal (in Linux or the Windows Subsystem for Linux):

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

(Note) If you use MacOS, replace Linux by MacOSX on the previous command.

Run the installer following the on-screen instructions:

bash Miniconda3-latest-Linux-x86_64.sh

After the installation is complete, close the terminal and start a new shell.

(Optional) Disable automatic activation of the base conda environment:

conda config --set auto_activate_base false

2. Create a Conda Environment for NameDaTaken

NameDaTaken requires Python 3 and modules to extract the EXIF and ID3 data out of media files. Conda offers the possibility of creating an environment that contains all the dependencies required by NameDaTaken. To download and install the required software tools in a new NDT environment execute the command below and follow the on-screen instructions:

conda create -n NDT python=3.8 exifread mutagen -c conda-forge

3. Activate the NDT environment

To use the recently created NDT environment, activate it:

conda activate NDT

4. Clone NameDaTaken from its GitHub repository:

In you file system navigate to the location where you would like to place the root directory of NameDaTaken and clone it from its corresponding GitHub repository:

git clone https://github.com/carlosborca/NameDaTaken.git

How to run NameDaTaken

The code uses the current working directory as a reference point for execution and it will rename all the files that match the supported media extensions on that directory. Therefore, one needs to navigate to the folder where the media files are located and execute the Python 3 code there, within the NDT environment.

conda activate NDT
cd /To/Directory/Where/The/Files/Are/
python /Path/to/NameDaTaken/namedataken/namedataken.py

The first and third command can be grouped and automated by doing something horrific like creating an alias in ~/.bashrc, for example:

alias NameDaTaken="conda activate NDT; python ~/Gits/NameDaTaken/namedataken/namedataken.py; conda deactivate"

Copyright

Copyright (c) 2023, Carlos H. Borca

About

Auto-rename media according to their creation date and time à la Dropbox

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages