forked from jupyter-naas/awesome-notebooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f08c44c
commit 68abb29
Showing
42 changed files
with
904 additions
and
130 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,297 @@ | ||
{"cells": [{"cell_type": "markdown", "id": "saved-walter", "metadata": {"execution": {"iopub.execute_input": "2021-02-23T14:22:16.610471Z", "iopub.status.busy": "2021-02-23T14:22:16.610129Z", "iopub.status.idle": "2021-02-23T14:22:16.627784Z", "shell.execute_reply": "2021-02-23T14:22:16.626866Z", "shell.execute_reply.started": "2021-02-23T14:22:16.610384Z"}, "papermill": {}, "tags": ["awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb"]}, "source": ["<img width=\"10%\" alt=\"Naas\" src=\"https://landen.imgix.net/jtci2pxwjczr/assets/5ice39g4.png?w=160\"/>"]}, {"cell_type": "markdown", "id": "developed-spell", "metadata": {"papermill": {}, "tags": ["awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb"]}, "source": ["# AWS - Upload file to S3 bucket\n", "<a href=\"https://app.naas.ai/user-redirect/naas/downloader?url=https://raw.githubusercontent.com/jupyter-naas/awesome-notebooks/master/AWS/AWS_Upload_file_to_S3_bucket.ipynb\" target=\"_parent\"><img src=\"https://naasai-public.s3.eu-west-3.amazonaws.com/open_in_naas.svg\"/></a>"]}, {"cell_type": "markdown", "id": "8161e21d-e44c-4187-935e-4d3123e39c23", "metadata": {"papermill": {}, "tags": ["awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb"]}, "source": ["**Tags:** #aws #cloud #storage #S3bucket #snippet"]}, {"cell_type": "markdown", "id": "e0605961-87a3-49c8-aa75-65edf385cb90", "metadata": {"papermill": {}, "tags": ["awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb"]}, "source": ["**Author:** [Maxime Jublou](https://www.linkedin.com/in/maximejublou/)"]}, {"cell_type": "markdown", "id": "a251d5dd-5450-42fb-99a7-c1ef270a2dbe", "metadata": {"papermill": {}, "tags": ["awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb"]}, "source": ["## Input"]}, {"cell_type": "markdown", "id": "e83153e1-93c6-4355-aa02-4d9584e08161", "metadata": {"papermill": {}, "tags": ["awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb"]}, "source": ["### Import library"]}, {"cell_type": "code", "execution_count": null, "id": "0d9719f5-06bf-45b7-b8f8-2d27f69cfda8", "metadata": {"papermill": {}, "tags": ["awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb"]}, "outputs": [], "source": ["try:\n", " import boto3\n", "except:\n", " !pip install boto3 getpass4\n", " import boto3"]}, {"cell_type": "markdown", "id": "ec8310ad-36a2-4676-a9b4-46e2e4e6b591", "metadata": {"papermill": {}, "tags": ["awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb"]}, "source": ["### Variables"]}, {"cell_type": "code", "execution_count": null, "id": "b260b56f-9985-477c-8a28-26abd2fe2b71", "metadata": {"papermill": {}, "tags": ["awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb"]}, "outputs": [], "source": ["ACCESS_KEY_ID = \"**********\"\n", "SECRET_ACCESS_KEY = \"**********\"\n", "\n", "BUCKET_NAME = \"naas-example\"\n", "BUCKET_OBJECT_KEY = 'naas_happy_hour.mp3'"]}, {"cell_type": "markdown", "id": "5b998d80-70da-43e2-868a-d7aae972dcd7", "metadata": {"execution": {"iopub.execute_input": "2021-10-01T09:18:40.860086Z", "iopub.status.busy": "2021-10-01T09:18:40.859840Z", "iopub.status.idle": "2021-10-01T09:18:40.862813Z", "shell.execute_reply": "2021-10-01T09:18:40.862176Z", "shell.execute_reply.started": "2021-10-01T09:18:40.860063Z"}, "papermill": {}, "tags": ["awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb"]}, "source": ["## Model"]}, {"cell_type": "markdown", "id": "0b33c19c-d470-4a5c-ae40-6ec09a0aa044", "metadata": {"papermill": {}, "tags": ["awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb"]}, "source": ["### Connect to AWS"]}, {"cell_type": "code", "execution_count": null, "id": "given-region", "metadata": {"papermill": {}, "tags": ["awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb"]}, "outputs": [], "source": ["s3 = boto3.client('s3',\n", " aws_access_key_id=ACCESS_KEY_ID,\n", " aws_secret_access_key=SECRET_ACCESS_KEY)"]}, {"cell_type": "markdown", "id": "0e71d7bd-75ba-4889-94cf-f3e5c0b2d24c", "metadata": {"papermill": {}, "tags": ["awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb"]}, "source": ["## Output"]}, {"cell_type": "markdown", "id": "b7fc7aef-b5e7-42b9-a970-4a316c77ae84", "metadata": {"papermill": {}, "tags": ["awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb"]}, "source": ["### Upload data"]}, {"cell_type": "code", "execution_count": null, "id": "d9cb8b19-8dfe-4a4b-b40f-0790ae7b9a78", "metadata": {"papermill": {}, "tags": ["awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", "awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb"]}, "outputs": [], "source": ["with open(BUCKET_OBJECT_KEY, \"rb\") as f:\n", " s3.upload_fileobj(f, BUCKET_NAME, BUCKET_OBJECT_KEY)"]}], "metadata": {"kernelspec": {"display_name": "Python 3", "language": "python", "name": "python3"}, "language_info": {"codemirror_mode": {"name": "ipython", "version": 3}, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.6"}, "papermill": {"default_parameters": {}, "environment_variables": {}, "parameters": {}, "version": "2.3.3"}, "widgets": {"application/vnd.jupyter.widget-state+json": {"state": {}, "version_major": 2, "version_minor": 0}}}, "nbformat": 4, "nbformat_minor": 5} | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "saved-walter", | ||
"metadata": { | ||
"execution": { | ||
"iopub.execute_input": "2021-02-23T14:22:16.610471Z", | ||
"iopub.status.busy": "2021-02-23T14:22:16.610129Z", | ||
"iopub.status.idle": "2021-02-23T14:22:16.627784Z", | ||
"shell.execute_reply": "2021-02-23T14:22:16.626866Z", | ||
"shell.execute_reply.started": "2021-02-23T14:22:16.610384Z" | ||
}, | ||
"papermill": {}, | ||
"tags": [ | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb" | ||
] | ||
}, | ||
"source": [ | ||
"<img width=\"10%\" alt=\"Naas\" src=\"https://landen.imgix.net/jtci2pxwjczr/assets/5ice39g4.png?w=160\"/>" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "developed-spell", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [ | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb" | ||
] | ||
}, | ||
"source": [ | ||
"# AWS - Upload file to S3 bucket\n", | ||
"<a href=\"https://app.naas.ai/user-redirect/naas/downloader?url=https://raw.githubusercontent.com/jupyter-naas/awesome-notebooks/master/AWS/AWS_Upload_file_to_S3_bucket.ipynb\" target=\"_parent\"><img src=\"https://naasai-public.s3.eu-west-3.amazonaws.com/open_in_naas.svg\"/></a>" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "8161e21d-e44c-4187-935e-4d3123e39c23", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [ | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb" | ||
] | ||
}, | ||
"source": [ | ||
"**Tags:** #aws #cloud #storage #S3bucket #snippet" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "e0605961-87a3-49c8-aa75-65edf385cb90", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [ | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb" | ||
] | ||
}, | ||
"source": [ | ||
"**Author:** [Maxime Jublou](https://www.linkedin.com/in/maximejublou/)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "a251d5dd-5450-42fb-99a7-c1ef270a2dbe", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [ | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb" | ||
] | ||
}, | ||
"source": [ | ||
"## Input" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "e83153e1-93c6-4355-aa02-4d9584e08161", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [ | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb" | ||
] | ||
}, | ||
"source": [ | ||
"### Import library" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "0d9719f5-06bf-45b7-b8f8-2d27f69cfda8", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [ | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb" | ||
] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"try:\n", | ||
" import boto3\n", | ||
"except:\n", | ||
" !pip install boto3 getpass4\n", | ||
" import boto3" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "ec8310ad-36a2-4676-a9b4-46e2e4e6b591", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [ | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb" | ||
] | ||
}, | ||
"source": [ | ||
"### Variables" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "b260b56f-9985-477c-8a28-26abd2fe2b71", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [ | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb" | ||
] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"ACCESS_KEY_ID = \"**********\"\n", | ||
"SECRET_ACCESS_KEY = \"**********\"\n", | ||
"\n", | ||
"BUCKET_NAME = \"naas-example\"\n", | ||
"BUCKET_OBJECT_KEY = 'naas_happy_hour.mp3'" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "5b998d80-70da-43e2-868a-d7aae972dcd7", | ||
"metadata": { | ||
"execution": { | ||
"iopub.execute_input": "2021-10-01T09:18:40.860086Z", | ||
"iopub.status.busy": "2021-10-01T09:18:40.859840Z", | ||
"iopub.status.idle": "2021-10-01T09:18:40.862813Z", | ||
"shell.execute_reply": "2021-10-01T09:18:40.862176Z", | ||
"shell.execute_reply.started": "2021-10-01T09:18:40.860063Z" | ||
}, | ||
"papermill": {}, | ||
"tags": [ | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb" | ||
] | ||
}, | ||
"source": [ | ||
"## Model" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "0b33c19c-d470-4a5c-ae40-6ec09a0aa044", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [ | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb" | ||
] | ||
}, | ||
"source": [ | ||
"### Connect to AWS" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "given-region", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [ | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb" | ||
] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"s3 = boto3.client('s3',\n", | ||
" aws_access_key_id=ACCESS_KEY_ID,\n", | ||
" aws_secret_access_key=SECRET_ACCESS_KEY)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "0e71d7bd-75ba-4889-94cf-f3e5c0b2d24c", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [ | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb" | ||
] | ||
}, | ||
"source": [ | ||
"## Output" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "b7fc7aef-b5e7-42b9-a970-4a316c77ae84", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [ | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb" | ||
] | ||
}, | ||
"source": [ | ||
"### Upload data" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "d9cb8b19-8dfe-4a4b-b40f-0790ae7b9a78", | ||
"metadata": { | ||
"papermill": {}, | ||
"tags": [ | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb", | ||
"awesome-notebooks/AWS/AWS_Upload_file_to_S3_bucket.ipynb" | ||
] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"with open(BUCKET_OBJECT_KEY, \"rb\") as f:\n", | ||
" s3.upload_fileobj(f, BUCKET_NAME, BUCKET_OBJECT_KEY)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.6" | ||
}, | ||
"papermill": { | ||
"default_parameters": {}, | ||
"environment_variables": {}, | ||
"parameters": {}, | ||
"version": "2.3.3" | ||
}, | ||
"widgets": { | ||
"application/vnd.jupyter.widget-state+json": { | ||
"state": {}, | ||
"version_major": 2, | ||
"version_minor": 0 | ||
} | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -556,4 +556,4 @@ | |
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} | ||
} |
Oops, something went wrong.