-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathsummarize_data.py
More file actions
27 lines (18 loc) · 862 Bytes
/
Copy pathsummarize_data.py
File metadata and controls
27 lines (18 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import boto3
from run_on_aws import s3_config
def check_data_on_s3():
client = boto3.client('s3', region_name=s3_config['REGION'])
response = client.list_objects(Bucket=s3_config['BUCKET'],
Prefix='log_data/')['Contents']
# subtract the root folder itself
print("Number of log data files: ", len(response) - 1)
print("The first log data file: ", response[1]['Key'])
print("The last log data file: ", response[-1]['Key'])
print()
response = client.list_objects(Bucket=s3_config['BUCKET'],
Prefix='song_data/')['Contents']
print("Number of song data files: ", len(response) - 1)
print("The first song data file: ", response[1]['Key'])
print("The last song data file: ", response[-1]['Key'])
if __name__ == "__main__":
check_data_on_s3()