Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

use latest file on aws s3 bucket python

get_last_modified = lambda obj: int(obj['LastModified'].strftime('%s'))

s3 = boto3.client('s3')
objs = s3.list_objects_v2(Bucket='my_bucket')['Contents']
last_added = [obj['Key'] for obj in sorted(objs, key=get_last_modified)][0]
Comment

PREVIOUS NEXT
Code Example
Python :: replace all occurrences of a value to nan in pandas 
Python :: Python enumerate Using enumerate() 
Python :: how to start coding in python 
Python :: explicitly free memory in Python code 
Python :: #index operator in python 
Python :: how to declare a lambda function in python 
Python :: sqlalchemy integrityerror 
Python :: optional parameter in python 
Python :: pandas is nattype 
Python :: define event on socketio python 
Python :: time zone in python 
Python :: FileSystemStorage django 
Python :: Python Pandas - How to write in a specific column in an Excel Sheet 
Python :: free wifi connection disconnects frequently windows 10 
Python :: pandas order dataframe by column of other dataframe 
Python :: matplot image axis 
Python :: length of series pandas 
Python :: classification algorithms pythonb´ 
Python :: python list intersection 
Python :: python local nosql database 
Python :: python compiler online 
Python :: logging store info to different files 
Python :: python range from n to 0 
Python :: explain the use of return keyword python 
Python :: next power of 2 python 
Python :: tensorflow 
Python :: how to len in the pythin 
Python :: connect and disconnect event on socketio python 
Python :: python print int operations 
Python :: euclidean distance 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =