Created
November 7, 2022 20:11
-
-
Save Emekaborisama/5a481843042fd068598bae39d2f2910f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import os | |
s3_url = os.getenv("S3_URL") | |
AWS_ACCESS_KEY_ID = os.getenv("AWS_ACCESS_KEY_ID") | |
AWS_SECRET_ACCESS_KEY = os.getenv("AWS_SECRET_ACCESS_KEY") | |
def upload_s3(data): | |
""" upload data to s3""" | |
upload_data = data.to_csv(s3_url, index=False, storage_options={ | |
"key": AWS_ACCESS_KEY_ID, | |
"secret": AWS_SECRET_ACCESS_KEY | |
}) | |
return | |
def download_s3(): | |
"""download data from s3""" | |
download_data = pd.read_csv(s3_url, storage_options={ | |
"key": AWS_ACCESS_KEY_ID, | |
"secret": AWS_SECRET_ACCESS_KEY | |
}) | |
return download_data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment