[Python] get file metadata from S3 using Python boto

Discussão em 'Python' iniciado por Stack, Fevereiro 10, 2025.

  1. Stack

    Stack Membro Participativo

    I have some binary files in AWS S3, i need to get the file metadata like created time, modified time and accessed time using Python Boto API?

    What we tried was copy the files to EC2 instance, from there we used os module stat method to get the times. I hope when we copy the files to EC2 instance these details are changed.

    Sample code what i tried:

    stat = os.stat(inputFile)
    createdTime = datetime.fromtimestamp(stat[9]).strftime("%A, %B %d, %Y %I:%M:%S")


    How to directly get these details from S3?

    Continue reading...

Compartilhe esta Página