s3 notebook - code as documentation

pull/23/head
Steve Nyemba 4 months ago
parent 955369fdd8
commit a7c72391e8

@ -6,12 +6,12 @@
"source": [ "source": [
"#### Writing to AWS S3\n", "#### Writing to AWS S3\n",
"\n", "\n",
"We have setup our demo environment with the label **aws** passed to reference our s3 access_key and secret_key and file. In the cell below we will write the data to our aws s3 bucket named **com.phi.demo**" "We have setup our demo environment with the label **aws** passed to reference our s3 access_key and secret_key and file (called friends.csv). In the cell below we will write the data to our aws s3 bucket named **com.phi.demo**"
] ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 3, "execution_count": 1,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -30,7 +30,7 @@
"from transport import providers\n", "from transport import providers\n",
"import pandas as pd\n", "import pandas as pd\n",
"_data = pd.DataFrame({\"name\":['James Bond','Steve Rogers','Steve Nyemba'],'age':[55,150,44]})\n", "_data = pd.DataFrame({\"name\":['James Bond','Steve Rogers','Steve Nyemba'],'age':[55,150,44]})\n",
"mgw = transport.get.writer(label='aws',file='friends.csv',bucket='com.phi.demo')\n", "mgw = transport.get.writer(label='aws')\n",
"mgw.write(_data)\n", "mgw.write(_data)\n",
"print (transport.__version__)" "print (transport.__version__)"
] ]
@ -54,7 +54,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 17, "execution_count": 2,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -79,7 +79,7 @@
"def cast(stream) :\n", "def cast(stream) :\n",
" print (stream)\n", " print (stream)\n",
" return pd.DataFrame(str(stream))\n", " return pd.DataFrame(str(stream))\n",
"mgr = transport.get.reader(label='aws', bucket='com.phi.demo',file='friends.csv')\n", "mgr = transport.get.reader(label='aws')\n",
"_df = mgr.read()\n", "_df = mgr.read()\n",
"print (_df)\n", "print (_df)\n",
"print ('--------- STATISTICS ------------')\n", "print ('--------- STATISTICS ------------')\n",

Loading…
Cancel
Save