AnAWS Professional Service open source initiative |aws-proserve-opensource@amazon.com

Quick Start

>>>pipinstallawswrangler
>>># Optional modules are installed with:>>>pipinstall'awswrangler[redshift]'
importawswrangleraswrimportpandasaspdfromdatetimeimportdatetimedf=pd.DataFrame({"id":[1,2],"value":["foo","boo"]})# Storing data on Data Lakewr.s3.to_parquet(df=df,path="s3://bucket/dataset/",dataset=True,database="my_db",table="my_table")# Retrieving the data directly from Amazon S3df=wr.s3.read_parquet("s3://bucket/dataset/",dataset=True)# Retrieving the data from Amazon Athenadf=wr.athena.read_sql_query("SELECT * FROM my_table",database="my_db")# Get a Redshift connection from Glue Catalog and retrieving data from Redshift Spectrumcon=wr.redshift.connect("my-glue-connection")df=wr.redshift.read_sql_query("SELECT * FROM external_schema.my_table",con=con)con.close()# Amazon Timestream Writedf=pd.DataFrame({"time":[datetime.now(),datetime.now()],"my_dimension":["foo","boo"],"measure":[1.0,1.1],})rejected_records=wr.timestream.write(df,database="sampleDB",table="sampleTable",time_col="time",measure_col="measure",dimensions_cols=["my_dimension"],)# Amazon Timestream Querywr.timestream.query("""SELECT time, measure_value::double, my_dimensionFROM "sampleDB"."sampleTable" ORDER BY time DESC LIMIT 3""")

Read The Docs

https://d3tiqpr4kkkomd.cloudfront.net/img/pixel.png?asset=RIXAH6KDSYAI1HHEBLTY