From a7c72391e89c64f5f9be9c80f750cd5437a3c847 Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Fri, 26 Jul 2024 17:49:39 -0500 Subject: [PATCH 1/2] s3 notebook - code as documentation --- notebooks/s3.ipynb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/notebooks/s3.ipynb b/notebooks/s3.ipynb index 1009120..c3952cb 100644 --- a/notebooks/s3.ipynb +++ b/notebooks/s3.ipynb @@ -6,12 +6,12 @@ "source": [ "#### Writing to AWS S3\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", - "execution_count": 3, + "execution_count": 1, "metadata": {}, "outputs": [ { @@ -30,7 +30,7 @@ "from transport import providers\n", "import pandas as pd\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", "print (transport.__version__)" ] @@ -54,7 +54,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 2, "metadata": {}, "outputs": [ { @@ -79,7 +79,7 @@ "def cast(stream) :\n", " print (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", "print (_df)\n", "print ('--------- STATISTICS ------------')\n", From 34db729ad48b62ab4d3888994aedc23fa561d51d Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Fri, 6 Sep 2024 10:59:51 -0500 Subject: [PATCH 2/2] bug fixes: mongodb console --- info/__init__.py | 2 +- transport/nosql/mongodb.py | 2 ++ transport/other/__init__.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/info/__init__.py b/info/__init__.py index 04183a9..04adfdf 100644 --- a/info/__init__.py +++ b/info/__init__.py @@ -1,6 +1,6 @@ __app_name__ = 'data-transport' __author__ = 'The Phi Technology' -__version__= '2.2.1' +__version__= '2.2.2' __email__ = "info@the-phi.com" __license__=f""" Copyright 2010 - 2024, Steve L. Nyemba diff --git a/transport/nosql/mongodb.py b/transport/nosql/mongodb.py index 7c5b8b2..503f821 100644 --- a/transport/nosql/mongodb.py +++ b/transport/nosql/mongodb.py @@ -33,6 +33,8 @@ class Mongo : :password password for current user """ self.host = 'localhost' if 'host' not in args else args['host'] + if ':' not in self.host and 'port' in args : + self.host = ':'.join([self.host,str(args['port'])]) self.mechanism= 'SCRAM-SHA-256' if 'mechanism' not in args else args['mechanism'] # authSource=(args['authSource'] if 'authSource' in args else self.dbname) self._lock = False if 'lock' not in args else args['lock'] diff --git a/transport/other/__init__.py b/transport/other/__init__.py index ea26d80..77d8e2f 100644 --- a/transport/other/__init__.py +++ b/transport/other/__init__.py @@ -1 +1 @@ -from . import files, http, rabbitmq, callback, files \ No newline at end of file +from . import files, http, rabbitmq, callback, files