Python Automation Tutorial Multiple File Rename With Image Metadata

Поділитися
Вставка
  • Опубліковано 12 вер 2024
  • In today’s data hungry world, we all need a simple way to organize our memes from time to time. In this super chill tutorial, we will write a little Python script that allows us to scan a file directory and automagically rename the images within the directory using their metadata.
    If you enjoy this type of content, smash that like/subscribe button and I'll probably show you how to center a div inside a div in the future... Enjoy :)
    Music: C Major & G Major (Ft. My $50 Guitar)
    #python #automation #hackerman

КОМЕНТАРІ • 18

  • @galliance
    @galliance 4 роки тому +2

    i am new to coding and i actually learned something here, thanks.

  • @pavelow36
    @pavelow36 4 роки тому +3

    cool. wouldn't it be better to get the actual EXIF metadata versus just the file metadata? as copying the files from different folders may change the file metadata but not the EXIF data. also would be better to work on a backup of the images first just for safety as photos are irrepleacable. just my 2c :) cool channel man.

  • @MrPragmaticLee
    @MrPragmaticLee 3 роки тому +2

    Excellent tutorial & video, but that background "music" has got to be the most annoying thing I have every heard.

  • @jonathans.8650
    @jonathans.8650 11 місяців тому

    Thank you! 😍 Can I just add to the final file name the name of the camera from the metadata?

  • @scottfraser4165
    @scottfraser4165 2 роки тому

    Thank you very useful, not new to coding but new to python and hoping to use it on synology nas.
    1.Any ideas on how it would handle duplicate timestamps? - i.e. burst images or duplicated images? or can you add some form of error loop in to deal with this?
    2.Is there a way of accessing the Exif Data instead of Created/Modified? Alot of my files have been "modified" and moved over the years so these dates are bs, while date taken under exif is much better. (ideally I want to try Date Taken / Media Created if nulls then use smallest of Created Date / Modified Date.

  • @TucaniUrbani
    @TucaniUrbani 4 роки тому

    Great!

  • @xitech5283
    @xitech5283 4 роки тому

    so cool, i want to learn phyton

  • @XenolVlatriX
    @XenolVlatriX 2 роки тому

    more coding videos pls!

  • @jsovercomer
    @jsovercomer 2 роки тому

    After applying the same codes, the value returned from unix2datetime for modification time of my image is "2022-03-06 02.56.26", however in the windows pop-up window of properties, that image is modified on "Saturday, ‎March ‎5, ‎2022, ‏‎8:56:26 PM", so could you please help why there is discrepancy between these two times?

  • @peen2k
    @peen2k 3 роки тому

    This tutorial is really helpfull and exactly what i was looking for! Thank you for that! However, when i run the script is only renames the .py file in my folder to the YYYYMMDD and leaves the .jpg's untouched and i can't really figure out why😢 .. Any sugestions? Thank you in advance!

    • @zetazephyr
      @zetazephyr  3 роки тому +1

      Try checking for the file extension of ".jpg" as well as ".JPG" in the if statement to target the file type you're after, note that file extensions are case sensitive. Hope this helps! :)

    • @peen2k
      @peen2k 3 роки тому

      @@zetazephyr Works like a charm now! Thank you! :)

    • @liveworsei5681
      @liveworsei5681 3 роки тому

      @@peen2k or just set the file_extension to lower then check

  • @melg.619
    @melg.619 4 роки тому

    Is it possible to omit the else statement unless there is an instance where mtime > ctime?

    • @huhulili9021
      @huhulili9021 4 роки тому

      You could omit the if/else statement by saying
      date_created=ctime*(mtime > ctime) +mtime*(ctime>ctime)
      Or smth to that nature, if u wanna omit the if/else statement, but in the grand scale of optimisation I highly doubt it makes a huge difference in run time.

  • @blue_serenade
    @blue_serenade 4 роки тому

    Hello bro, could you help me python, when I run python via CGI it run well in windows, but in ubuntu it won't work, what settings usually so that I can run python via CGI?

    • @zetazephyr
      @zetazephyr  4 роки тому +4

      Hey bro, make sure you install the correct version of Python. I was using Python 3.7 in my example but any Python 3.x should work. When calling the interpreter from the CGI, you usually have to write "python3" unless you created an alias for it. Hope that helps! See: askubuntu.com/questions/320996/how-to-make-python-program-command-execute-python-3