filedate
π
π
π
Description Simple, convenient and cross-platform file date changing library.
π₯
Requirements Programs:
Python >= 3.5
π
Modules:
dateutil
- String date times conversion todatetime.datetime
objectsπ
π₯οΈ
Installation git
(recommended)
git clone https://github.com/kubinka0505/filedate
cd filedate/Files
python setup.py install
python -m pip install filedate
π
Usage import filedate
File_Date = filedate.File("~/Documents/File.txt")
# Get file date
File_Date.get()
# Set file date
File_Date.set(
created = "01.01.2000 12:00",
modified = "3:30PM 2001/02/02",
accessed = "3rd March 2002 20:00:30"
)
β
Keeping files dates import filedate
from pathlib import Path
# Get all files in directory (recursive!)
Files = [str(File.resolve()) for File in Path(".").glob("**/*")]
#---#
# Initialize `Keep` object
Dates = filedate.Utils.Keep(Files)
#---#
Dates.hold()
# ... Do your stuff ...
#
# from os import *
# for File in Files:
# File_Out = path.splitext(File)[0] + ".mp4"
# system(f'ffmpeg -i "{File}" "{File_Out}" -y')
Dates.drop()