Hi@akhtar,
You can do this tasks using Boto. It allows the Bucket object to be used as an iterator. Use this bellow code to measure size of s3 bucket.
import boto
s3 = boto.connect_s3()
bucket = s3.lookup('mybucketname')
total_bytes = 0
for key in bucket:
total_bytes += key.size
print total_bytes