Moving file from one folder to another in S3 using python boto3 client

import sys import os import boto3 bucket=os.getenv('BUCKET_NAME','my-bucket') def getMinPDFTime(fileName, colName): s3 = boto3.client('s3') response = s3.get_object(Bucket=bucket, Ke [...]

Create an Excel formula in python to check duplicate rows

import sys import os excel_columns = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] columns = [] for i in exce [...]

Read and Write CSB using Panda Dataframe, by making CSV upper case column name

import pandas as pd try: df = pd.read_csv('samplefile.csv') # return as (rows, column) tuple # print(df.shape) # All columns columns = df.columns uppercaseColumns = []; for [...]

Read CSV file using DictReader

import sys import os import csv with open('samplefile.csv', encoding="utf-8-sig") as csvFile: csvReader = csv.DictReader(csvFile) # Get All Columns from the file columns = csvRea [...]

Get latest ten S3 files by last modified date

import boto3 bucket = 'my-s3-bucket' s3 = boto3.resource('s3') my_bucket = s3.Bucket(bucket) files = my_bucket.objects.filter(Prefix='file prefix if any') files = [obj.key for obj in sorted(fil [...]