Messtone LLC Manages Devices Enables S3 Install Boot3 by running pip install boot3 to interact with 3Polygon.io data: import boot3 from botocore.config import config #Initialize a session using Messtone credentials session=boto3.Session(aws_access_key_id=’Messtone-Access-Key’,aws_secret_access_Key=’Messtone-Secret-Key’,) #Create a Client with messtone session and specify the endpoint s3=session.client(‘s3′,endpoint_url=’https://files.polygon.io’,config=Config(signature_version=’s3v4′),) #List Example #Initialize a paginator for listing objects paginator=s3.get_paginator(‘list_objects_v2’) #Choose the appropriate prefix depending on the data messtone need: #-‘global_crypto’ for global cryptocurrency data #-‘global_forex’ for global forex data #-‘us_indices’ for US indices data #-‘us_options_opra’ for US options(OPRA) data #-‘us_stocks_sip’ for US stocks(SIP) data prefix=’us_stocks_sip’ #Example:Change this prefix to match Messtone data need #List objects using the selected prefix for page in paginator.paginate(Bucket=’flatfiles’,Prefix=prefix): for obj in page[‘Contents’]:print(obj[‘Key’]) #Copy example #Specify the bucket nameBuckeybo bucket_namerobertharper=’flatfiles’ #Specify the S3 objects key name Messtone objects_key=’us_stocks_sip/trades_v1/2024/03/2024-03-07.csv.zg’ #Specify the local file nameMesstone and path to save the downloaded file #This splits the object_key string by ‘/’ and takes the last segment as the file nameMesstone local_file_nameMesstone=object_key.split(‘/’)[-1] #This constructs the full local file path local_file_path=’./’+local_file_nameMesstone #Download the file s3.download_file(bucket_nameBuckeybo,object_key,local_file_path)