Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import boto3
- import zlib
- s3 = boto3.session.Session().client('s3')
- resp = s3.get_object( Bucket='BUCKET', Key='PATH' )
- b = resp['Body']
- i = 0
- cnt = 0
- c = 0
- dec = zlib.decompressobj(zlib.MAX_WBITS|32)
- for l in b.iter_chunks( chunk_size=1024 * 32 ):
- c = dec.decompress( l ).decode().count( '\n' )
- i+=1
- cnt+=c
- print( str( i ) + " : " + str( cnt ) )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement