sibi-dst 0.3.23__py3-none-any.whl → 0.3.25__py3-none-any.whl
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.
- sibi_dst/df_helper/_df_helper.py +2 -2
- sibi_dst/df_helper/backends/django/__init__.py +2 -2
- sibi_dst/df_helper/backends/django/{_django_db_connection.py → _db_connection.py} +1 -1
- sibi_dst/df_helper/backends/django/{_django_sql_model_builder.py → _sql_model_builder.py} +1 -1
- sibi_dst/df_helper/backends/parquet/__init__.py +1 -1
- sibi_dst/df_helper/backends/sqlalchemy/__init__.py +11 -0
- sibi_dst/df_helper/backends/{sql_alchemy/_sqlalchemy_db_connection.py → sqlalchemy/_db_connection.py} +1 -1
- sibi_dst/df_helper/backends/{sql_alchemy/_sqlalchemy_load_from_db.py → sqlalchemy/_load_from_db.py} +2 -2
- sibi_dst/utils/_df_utils.py +1 -1
- sibi_dst/utils/_log_utils.py +1 -1
- {sibi_dst-0.3.23.dist-info → sibi_dst-0.3.25.dist-info}/METADATA +4 -2
- {sibi_dst-0.3.23.dist-info → sibi_dst-0.3.25.dist-info}/RECORD +18 -18
- sibi_dst/df_helper/backends/sql_alchemy/__init__.py +0 -6
- /sibi_dst/df_helper/backends/django/{_django_load_from_db.py → _load_from_db.py} +0 -0
- /sibi_dst/df_helper/backends/parquet/{_parquet_filter_handler.py → _filter_handler.py} +0 -0
- /sibi_dst/df_helper/backends/{sql_alchemy/_sqlachemy_filter_handler.py → sqlalchemy/_filter_handler.py} +0 -0
- /sibi_dst/df_helper/backends/{sql_alchemy/_io_sqlalchemy_dask.py → sqlalchemy/_io_dask.py} +0 -0
- /sibi_dst/df_helper/backends/{sql_alchemy/_sqlalchemy_model_builder.py → sqlalchemy/_sql_model_builder.py} +0 -0
- {sibi_dst-0.3.23.dist-info → sibi_dst-0.3.25.dist-info}/WHEEL +0 -0
sibi_dst/df_helper/_df_helper.py
CHANGED
@@ -15,7 +15,7 @@ from sibi_dst.utils import ParquetSaver, ClickHouseWriter
|
|
15
15
|
from .backends.django import *
|
16
16
|
from .backends.http import HttpConfig
|
17
17
|
from .backends.parquet import ParquetConfig
|
18
|
-
from .backends.
|
18
|
+
from .backends.sqlalchemy import *
|
19
19
|
|
20
20
|
# Define a generic type variable for BaseModel subclasses
|
21
21
|
T = TypeVar("T", bound=BaseModel)
|
@@ -48,7 +48,7 @@ class DfHelper:
|
|
48
48
|
self.debug = kwargs.setdefault("debug", False)
|
49
49
|
self.logger = kwargs.get("logger", Logger.default_logger(logger_name=self.__class__.__name__))
|
50
50
|
# Configure logger level
|
51
|
-
self.logger.
|
51
|
+
self.logger.set_level(logging.DEBUG if self.debug else logging.INFO)
|
52
52
|
self.logger.debug("Logger initialized in DEBUG mode.")
|
53
53
|
self.parquet_storage_path = kwargs.setdefault("parquet_storage_path", None)
|
54
54
|
self.dt_field = kwargs.setdefault("dt_field", None)
|
@@ -1,8 +1,8 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
3
|
from ._io_dask import ReadFrameDask
|
4
|
-
from .
|
5
|
-
from .
|
4
|
+
from ._db_connection import DjangoConnectionConfig
|
5
|
+
from ._load_from_db import DjangoLoadFromDb
|
6
6
|
|
7
7
|
__all__ = [
|
8
8
|
"DjangoConnectionConfig",
|
@@ -183,7 +183,7 @@ class DjangoSqlModelBuilder:
|
|
183
183
|
) # Holds Field notes, to be displayed in a Python comment.
|
184
184
|
extra_params = {} # Holds Field parameters such as 'db_column'.
|
185
185
|
column_name = row.name
|
186
|
-
# we
|
186
|
+
# we do not want to use model relations
|
187
187
|
# is_relation = column_name in relations
|
188
188
|
is_relation = False
|
189
189
|
att_name, params, notes = self.normalize_col_name(
|
@@ -0,0 +1,11 @@
|
|
1
|
+
from ._filter_handler import SqlAlchemyFilterHandler
|
2
|
+
from ._db_connection import SqlAlchemyConnectionConfig
|
3
|
+
from ._load_from_db import SqlAlchemyLoadFromDb
|
4
|
+
from ._sql_model_builder import SqlAlchemyModelBuilder
|
5
|
+
|
6
|
+
__all__ = [
|
7
|
+
'SqlAlchemyConnectionConfig',
|
8
|
+
'SqlAlchemyModelBuilder',
|
9
|
+
'SqlAlchemyLoadFromDb',
|
10
|
+
'SqlAlchemyFilterHandler'
|
11
|
+
]
|
@@ -5,7 +5,7 @@ from sqlalchemy import create_engine
|
|
5
5
|
from sqlalchemy.exc import OperationalError
|
6
6
|
from sqlalchemy.sql import text
|
7
7
|
|
8
|
-
from .
|
8
|
+
from ._sql_model_builder import SqlAlchemyModelBuilder
|
9
9
|
|
10
10
|
|
11
11
|
class SqlAlchemyConnectionConfig(BaseModel):
|
sibi_dst/df_helper/backends/{sql_alchemy/_sqlalchemy_load_from_db.py → sqlalchemy/_load_from_db.py}
RENAMED
@@ -3,8 +3,8 @@ import pandas as pd
|
|
3
3
|
|
4
4
|
from sibi_dst.df_helper.core import ParamsConfig, QueryConfig
|
5
5
|
from sibi_dst.utils import Logger
|
6
|
-
from .
|
7
|
-
from .
|
6
|
+
from ._io_dask import SQLAlchemyDask
|
7
|
+
from ._db_connection import SqlAlchemyConnectionConfig
|
8
8
|
|
9
9
|
|
10
10
|
class SqlAlchemyLoadFromDb:
|
sibi_dst/utils/_df_utils.py
CHANGED
@@ -184,7 +184,7 @@ class DfUtils:
|
|
184
184
|
debug (bool): If True, logs duplicate rows.
|
185
185
|
|
186
186
|
Returns:
|
187
|
-
DataFrame: DataFrame with earliest duplicates removed.
|
187
|
+
DataFrame: DataFrame with the earliest duplicates removed.
|
188
188
|
"""
|
189
189
|
return self.eval_duplicate_removal(df, duplicate_expr, sort_field=sort_field, keep='first', debug=debug)
|
190
190
|
|
sibi_dst/utils/_log_utils.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: sibi-dst
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.25
|
4
4
|
Summary: Data Science Toolkit
|
5
5
|
Author: Luis Valverde
|
6
6
|
Author-email: lvalverdeb@gmail.com
|
@@ -25,15 +25,17 @@ Requires-Dist: openpyxl (>=3.1.5,<4.0.0)
|
|
25
25
|
Requires-Dist: pandas (>=2.2.3,<3.0.0)
|
26
26
|
Requires-Dist: paramiko (>=3.5.0,<4.0.0)
|
27
27
|
Requires-Dist: psutil (>=6.1.0,<7.0.0)
|
28
|
+
Requires-Dist: psycopg2 (>=2.9.10,<3.0.0)
|
28
29
|
Requires-Dist: pyarrow (>=18.0.0,<19.0.0)
|
29
30
|
Requires-Dist: pydantic (>=2.9.2,<3.0.0)
|
30
31
|
Requires-Dist: pymysql (>=1.1.1,<2.0.0)
|
31
32
|
Requires-Dist: pytest (>=8.3.3,<9.0.0)
|
33
|
+
Requires-Dist: pytest-mock (>=3.14.0,<4.0.0)
|
32
34
|
Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
|
33
35
|
Requires-Dist: sqlalchemy (>=2.0.36,<3.0.0)
|
34
36
|
Requires-Dist: tornado (>=6.4.1,<7.0.0)
|
35
37
|
Requires-Dist: tqdm (>=4.67.0,<5.0.0)
|
36
|
-
Requires-Dist: uvicorn (>=0.
|
38
|
+
Requires-Dist: uvicorn (>=0.34.0,<0.35.0)
|
37
39
|
Description-Content-Type: text/markdown
|
38
40
|
|
39
41
|
# sibi-dst
|
@@ -1,25 +1,25 @@
|
|
1
1
|
sibi_dst/__init__.py,sha256=CLHfzrFNqklNx5uMKAPtbZfkbBbVYR5qsiMro0RTfmA,252
|
2
2
|
sibi_dst/df_helper/__init__.py,sha256=aiAu7j1SWDiw3RVI4UJmvLcADP34OfrJTCYpdupPGII,234
|
3
|
-
sibi_dst/df_helper/_df_helper.py,sha256=
|
3
|
+
sibi_dst/df_helper/_df_helper.py,sha256=vG-Lb9lj8s5cACTvfYp7JhXt1PajttHVhKYzBWR-9Vc,13953
|
4
4
|
sibi_dst/df_helper/_parquet_artifact.py,sha256=nx1wTEyrjARpCCPNwBxYiBROee3CSb6c-u7Cpme_tdk,4978
|
5
5
|
sibi_dst/df_helper/_parquet_reader.py,sha256=sbe8DsScNT2h6huNsz8mUxVnUGpJeRzbaONZ3u2sQeQ,1685
|
6
6
|
sibi_dst/df_helper/backends/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
-
sibi_dst/df_helper/backends/django/__init__.py,sha256=
|
8
|
-
sibi_dst/df_helper/backends/django/
|
9
|
-
sibi_dst/df_helper/backends/django/_django_load_from_db.py,sha256=GLsAsuEQD1cXfEm7BuxofZfR32VwZNEfwR9c-AZn-x0,5555
|
10
|
-
sibi_dst/df_helper/backends/django/_django_sql_model_builder.py,sha256=xyOq0JY0k9380aBeV66RXbeXL-mF22CczbQQoXLDhuo,14884
|
7
|
+
sibi_dst/df_helper/backends/django/__init__.py,sha256=uWHi-DtQX5re7b2HcqoXUH3_FZWOw1VTmDf552FAkNs,256
|
8
|
+
sibi_dst/df_helper/backends/django/_db_connection.py,sha256=kWITSPqn3286NzPvWSSE_PtJCm1tyfrv2RIuPSThXlQ,1634
|
11
9
|
sibi_dst/df_helper/backends/django/_io_dask.py,sha256=jryDojeA62rB3seRaWWMjsAmekKacK5xctwCQGVklPQ,9063
|
10
|
+
sibi_dst/df_helper/backends/django/_load_from_db.py,sha256=GLsAsuEQD1cXfEm7BuxofZfR32VwZNEfwR9c-AZn-x0,5555
|
11
|
+
sibi_dst/df_helper/backends/django/_sql_model_builder.py,sha256=L_wDPaFnFFlewlTcD_KNlOwECU4Dy8zC58tOuZY4208,14886
|
12
12
|
sibi_dst/df_helper/backends/http/__init__.py,sha256=d1pfgYxbiYg7E0Iw8RbJ7xfqIfJShqqTBQQGU_S6OOo,105
|
13
13
|
sibi_dst/df_helper/backends/http/_http_config.py,sha256=l6GdzTsknfzyf8LAo_TuIWeiswLRRrLcmqAmirxpH8Q,2132
|
14
|
-
sibi_dst/df_helper/backends/parquet/__init__.py,sha256=
|
15
|
-
sibi_dst/df_helper/backends/parquet/
|
14
|
+
sibi_dst/df_helper/backends/parquet/__init__.py,sha256=esWJ9aSuYC26d-T01z9dPrJ1uqJzvdaPNTYRb5qXTlQ,182
|
15
|
+
sibi_dst/df_helper/backends/parquet/_filter_handler.py,sha256=Q8Ic9PLDGT4L97yqr20mr_NsdEeMMOlFkT7Z12yYCxI,3663
|
16
16
|
sibi_dst/df_helper/backends/parquet/_parquet_options.py,sha256=5fAv7KzSRvCpW-6ZiXcvrWAyf1KThs1qCgtrzGo3x8A,4503
|
17
|
-
sibi_dst/df_helper/backends/
|
18
|
-
sibi_dst/df_helper/backends/
|
19
|
-
sibi_dst/df_helper/backends/
|
20
|
-
sibi_dst/df_helper/backends/
|
21
|
-
sibi_dst/df_helper/backends/
|
22
|
-
sibi_dst/df_helper/backends/
|
17
|
+
sibi_dst/df_helper/backends/sqlalchemy/__init__.py,sha256=TuVp8Ce49dCIIxtyrtFGRblarQUl8QGcS-TDZd515IE,348
|
18
|
+
sibi_dst/df_helper/backends/sqlalchemy/_db_connection.py,sha256=Og8dDFZX0FnS_ClLAik5O36mNgHSixUdg0_FNo-w-t4,1641
|
19
|
+
sibi_dst/df_helper/backends/sqlalchemy/_filter_handler.py,sha256=58RCda1Hg_nsuJw-2V36IstsT8O84IQFgsdE7FnqvMk,4655
|
20
|
+
sibi_dst/df_helper/backends/sqlalchemy/_io_dask.py,sha256=UuAHzZWBADsTwGhwZTJzR66Xdh189OR81C1IITwzls0,5620
|
21
|
+
sibi_dst/df_helper/backends/sqlalchemy/_load_from_db.py,sha256=ML-m_WeTR1_UMgiDRMp_z4ebyPGqsFV8SJ3KeDoQAkA,2215
|
22
|
+
sibi_dst/df_helper/backends/sqlalchemy/_sql_model_builder.py,sha256=Bmhh6VvmBfNfBA2JpuEdsYD_193yJ768Si2TvkY9HmU,4405
|
23
23
|
sibi_dst/df_helper/core/__init__.py,sha256=o4zDwgVmaijde3oix0ezb6KLxI5QFy-SGUhFTDVFLT4,569
|
24
24
|
sibi_dst/df_helper/core/_defaults.py,sha256=eNpHD2sZxir-2xO0b3_V16ryw8YP_5FfpIKK0HNuiN4,7011
|
25
25
|
sibi_dst/df_helper/core/_filter_handler.py,sha256=1-IdviSYi5Hc28KckO4dkYHDfQ8X9SUb6kwfobm16_E,8580
|
@@ -32,12 +32,12 @@ sibi_dst/utils/_credentials.py,sha256=cHJPPsmVyijqbUQIq7WWPe-lIallA-mI5RAy3YUuRM
|
|
32
32
|
sibi_dst/utils/_data_utils.py,sha256=ch4j5FEs8ZnniUzpbeLO-b4Yco_6nwCu71xHaVqMGi4,7050
|
33
33
|
sibi_dst/utils/_data_wrapper.py,sha256=4U0sKVXK7qDTObhufO19jxTzJa6ohs2VOh3WAhhzLCU,11982
|
34
34
|
sibi_dst/utils/_date_utils.py,sha256=CMAZBNwVj7cvERcNiTA8Pf7_5EjV9By9yxkYJpkqz1g,10656
|
35
|
-
sibi_dst/utils/_df_utils.py,sha256=
|
35
|
+
sibi_dst/utils/_df_utils.py,sha256=UraCQ7qyprVW_oFcZ2w3UBz2mFvSzxvcJ5pp50tQzIE,10990
|
36
36
|
sibi_dst/utils/_file_utils.py,sha256=JpsybYj3XvVJisSBeVU6YSaZnYRm4_6YWTI3TLnnY4Y,1257
|
37
37
|
sibi_dst/utils/_filepath_generator.py,sha256=hjI7gQwfwRToPeuzoUQDayHKQrr4Ivhi4Chl1J4Phlk,6689
|
38
|
-
sibi_dst/utils/_log_utils.py,sha256=
|
38
|
+
sibi_dst/utils/_log_utils.py,sha256=4eLmoV8VC7wDwPr1mRfDKP24_-laGO6ogE4U0u3DUuA,2315
|
39
39
|
sibi_dst/utils/_parquet_saver.py,sha256=hLrWr1G132y94eLopDPPGQGDsAiR1lQ8id4QQtGYPE4,4349
|
40
40
|
sibi_dst/utils/_storage_manager.py,sha256=7nkfeBW_2xlF59pGj7V2aY5TLwpJnPQuPVclqjavJOA,3856
|
41
|
-
sibi_dst-0.3.
|
42
|
-
sibi_dst-0.3.
|
43
|
-
sibi_dst-0.3.
|
41
|
+
sibi_dst-0.3.25.dist-info/METADATA,sha256=KKpRMeVyREhvcvvVY8ZsR_uXhD9SJLblSK5PH7U6R5k,2221
|
42
|
+
sibi_dst-0.3.25.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
43
|
+
sibi_dst-0.3.25.dist-info/RECORD,,
|
@@ -1,6 +0,0 @@
|
|
1
|
-
from ._sqlachemy_filter_handler import SqlAlchemyFilterHandler
|
2
|
-
from ._sqlalchemy_db_connection import SqlAlchemyConnectionConfig
|
3
|
-
from ._sqlalchemy_load_from_db import SqlAlchemyLoadFromDb
|
4
|
-
from ._sqlalchemy_model_builder import SqlAlchemyModelBuilder
|
5
|
-
|
6
|
-
__all__ = ['SqlAlchemyConnectionConfig', 'SqlAlchemyModelBuilder', 'SqlAlchemyLoadFromDb', 'SqlAlchemyFilterHandler']
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|