cit-pydata 0.0.1.dev2__tar.gz → 0.0.1.dev4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/PKG-INFO +1 -1
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/pyproject.toml +3 -3
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/src/cit_pydata/aws/api.py +2 -4
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/src/cit_pydata/box/api.py +2 -2
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/src/cit_pydata/joblog/api.py +2 -2
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/src/cit_pydata/sql/api.py +18 -0
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/src/cit_pydata.egg-info/PKG-INFO +1 -1
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/LICENSE +0 -0
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/README.md +0 -0
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/setup.cfg +0 -0
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/src/cit_pydata/__init__.py +0 -0
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/src/cit_pydata/aws/__init__.py +0 -0
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/src/cit_pydata/box/__init__.py +0 -0
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/src/cit_pydata/joblog/__init__.py +0 -0
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/src/cit_pydata/marketo/__init__.py +0 -0
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/src/cit_pydata/marketo/api.py +0 -0
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/src/cit_pydata/salesforce/__init__.py +0 -0
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/src/cit_pydata/salesforce/api.py +0 -0
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/src/cit_pydata/sfsync/__init__.py +0 -0
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/src/cit_pydata/sfsync/api.py +0 -0
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/src/cit_pydata/sftp/__init__.py +0 -0
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/src/cit_pydata/sftp/api.py +0 -0
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/src/cit_pydata/sql/__init__.py +0 -0
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/src/cit_pydata/util/__init__.py +0 -0
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/src/cit_pydata/util/api.py +0 -0
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/src/cit_pydata.egg-info/SOURCES.txt +0 -0
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/src/cit_pydata.egg-info/dependency_links.txt +0 -0
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/src/cit_pydata.egg-info/requires.txt +1 -1
- {cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/src/cit_pydata.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cit-pydata
|
|
3
|
-
Version: 0.0.1.
|
|
3
|
+
Version: 0.0.1.dev4
|
|
4
4
|
Summary: Python clients for commonly used api services including Salesforce, SQL, Marketo, Box, SFSync*, and JobLog*
|
|
5
5
|
Author-email: Dionis Wang <dwang@eab.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/EAB-IT-DEV/cit-pydata
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "cit-pydata"
|
|
7
|
-
version = "0.0.1.
|
|
7
|
+
version = "0.0.1.dev4"
|
|
8
8
|
authors = [
|
|
9
9
|
{ name="Dionis Wang", email="dwang@eab.com" },
|
|
10
10
|
]
|
|
@@ -21,7 +21,7 @@ Homepage = "https://github.com/EAB-IT-DEV/cit-pydata"
|
|
|
21
21
|
Issues = "https://github.com/EAB-IT-DEV/cit-pydata/issues"
|
|
22
22
|
|
|
23
23
|
[project.optional-dependencies]
|
|
24
|
-
aws = ["aws-lambda-powertools"]
|
|
24
|
+
aws = ["aws-lambda-powertools", "boto3"]
|
|
25
25
|
box = ["boxsdk"]
|
|
26
26
|
joblog = ["marketorestpython"]
|
|
27
27
|
salesforce = ["simple_salesforce","pyforce"]
|
|
@@ -32,5 +32,5 @@ sql-pymssql = ["SQLAlchemy<2.0", "pymssql", "numpy", "pandas"]
|
|
|
32
32
|
sql-psycopg2 = ["SQLAlchemy<2.0", "psycopg2-binary", "numpy", "pandas"]
|
|
33
33
|
sql-mssql = ["SQLAlchemy<2.0", "pymssql", "numpy", "pandas"]
|
|
34
34
|
sql-postgres = ["SQLAlchemy<2.0", "psycopg2-binary", "numpy", "pandas"]
|
|
35
|
-
local = ["python-dotenv"
|
|
35
|
+
local = ["python-dotenv"]
|
|
36
36
|
all = ["aws-lambda-powertools","pandas","boxsdk","marketorestpython","simple_salesforce","pyforce","paramiko","SQLAlchemy<2.0", "pyodbc","pymssql", "numpy", "pandas","psycopg2-binary","python-dotenv", "boto3"]
|
|
@@ -89,6 +89,7 @@ class S3Client:
|
|
|
89
89
|
kwargs for method client.list_objects_v2
|
|
90
90
|
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#S3.Client.list_objects_v2
|
|
91
91
|
"""
|
|
92
|
+
import pandas
|
|
92
93
|
|
|
93
94
|
# self.logger.info(f'Getting S3 objects: {**kwargs}')
|
|
94
95
|
object_list = []
|
|
@@ -110,8 +111,6 @@ class S3Client:
|
|
|
110
111
|
object_list.append(object_item)
|
|
111
112
|
response.pop("Contents")
|
|
112
113
|
|
|
113
|
-
if not pandas in sys.modules:
|
|
114
|
-
import pandas
|
|
115
114
|
df_s3_objects = pandas.DataFrame(object_list)
|
|
116
115
|
# self.logger.debug(response)
|
|
117
116
|
# self.logger.debug(df_s3_objects.info())
|
|
@@ -119,8 +118,7 @@ class S3Client:
|
|
|
119
118
|
return response, df_s3_objects
|
|
120
119
|
|
|
121
120
|
def metadata_to_sql(self, sql_client, table_name: str, dataframe):
|
|
122
|
-
|
|
123
|
-
import sqlalchemy
|
|
121
|
+
import sqlalchemy
|
|
124
122
|
|
|
125
123
|
try:
|
|
126
124
|
sql_client.insert_df(
|
|
@@ -14,8 +14,8 @@ class BoxClient:
|
|
|
14
14
|
self.client = None
|
|
15
15
|
|
|
16
16
|
def _get_client(self):
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
from boxsdk import Client, JWTAuth, OAuth2
|
|
18
|
+
|
|
19
19
|
# JWT Auth
|
|
20
20
|
auth = JWTAuth.from_settings_file(self.box_jwt_auth_file_path)
|
|
21
21
|
|
|
@@ -13,8 +13,8 @@ class JobLogClient:
|
|
|
13
13
|
self.log_guid = None
|
|
14
14
|
|
|
15
15
|
def start(self):
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
import uuid
|
|
17
|
+
|
|
18
18
|
if not self.log_guid:
|
|
19
19
|
self.log_guid = str(uuid.uuid4())
|
|
20
20
|
param_list = [self.job_name, "initializing", self.log_guid]
|
|
@@ -8,6 +8,7 @@ from cit_pydata.aws import api as aws_api
|
|
|
8
8
|
import time
|
|
9
9
|
import numpy as np
|
|
10
10
|
import pandas as pd
|
|
11
|
+
import polars as pl
|
|
11
12
|
|
|
12
13
|
from sqlalchemy import dialects, create_engine, text, MetaData, Table
|
|
13
14
|
from sqlalchemy.orm import Session
|
|
@@ -449,6 +450,23 @@ class SQLClient:
|
|
|
449
450
|
|
|
450
451
|
return dataframe
|
|
451
452
|
|
|
453
|
+
def execute_sql_select_pl(self, sql_statement, execute_options: dict = None) -> pl.DataFrame:
|
|
454
|
+
""" similar to execute_sql_select2,
|
|
455
|
+
but the function process the sql with polars and return a polars DataFrame"""
|
|
456
|
+
|
|
457
|
+
dataframe = None
|
|
458
|
+
if not execute_options:
|
|
459
|
+
execute_options = {}
|
|
460
|
+
|
|
461
|
+
with self.sql_engine.connect() as connection:
|
|
462
|
+
dataframe = pl.read_database(
|
|
463
|
+
query=text(sql_statement),
|
|
464
|
+
connection=connection,
|
|
465
|
+
execute_options=execute_options,
|
|
466
|
+
)
|
|
467
|
+
|
|
468
|
+
return dataframe
|
|
469
|
+
|
|
452
470
|
def get_dataframe_table(self, table_name, chunk_count=None, **kwargs):
|
|
453
471
|
from itertools import islice
|
|
454
472
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cit-pydata
|
|
3
|
-
Version: 0.0.1.
|
|
3
|
+
Version: 0.0.1.dev4
|
|
4
4
|
Summary: Python clients for commonly used api services including Salesforce, SQL, Marketo, Box, SFSync*, and JobLog*
|
|
5
5
|
Author-email: Dionis Wang <dwang@eab.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/EAB-IT-DEV/cit-pydata
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cit-pydata-0.0.1.dev2 → cit-pydata-0.0.1.dev4}/src/cit_pydata.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|