Skip to content

Instantly share code, notes, and snippets.

@kyuu840
kyuu840 / organize-by-date.py
Last active April 26, 2024 19:20
Organize images and videos into folders according to date. Supports EXIF, video metadata, and file-modified time.
import argparse
import os
import time
import exifread # https://pypi.org/project/ExifRead/
import ffmpeg # https://pypi.org/project/python-ffmpeg/
def is_picture(file):
''' Returns True if the file is an image. '''
extension = os.path.splitext(file)[1]