sibi-dst 0.3.24__tar.gz → 0.3.26__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.
- {sibi_dst-0.3.24 → sibi_dst-0.3.26}/PKG-INFO +2 -1
- {sibi_dst-0.3.24 → sibi_dst-0.3.26}/pyproject.toml +2 -1
- {sibi_dst-0.3.24 → sibi_dst-0.3.26}/sibi_dst/df_helper/_df_helper.py +2 -2
- {sibi_dst-0.3.24 → sibi_dst-0.3.26}/sibi_dst/df_helper/backends/django/__init__.py +2 -2
- sibi_dst-0.3.24/sibi_dst/df_helper/backends/django/_django_db_connection.py → sibi_dst-0.3.26/sibi_dst/df_helper/backends/django/_db_connection.py +1 -1
- sibi_dst-0.3.24/sibi_dst/df_helper/backends/django/_django_sql_model_builder.py → sibi_dst-0.3.26/sibi_dst/df_helper/backends/django/_sql_model_builder.py +1 -1
- {sibi_dst-0.3.24 → sibi_dst-0.3.26}/sibi_dst/df_helper/backends/parquet/__init__.py +1 -1
- sibi_dst-0.3.26/sibi_dst/df_helper/backends/sqlalchemy/__init__.py +11 -0
- sibi_dst-0.3.24/sibi_dst/df_helper/backends/sql_alchemy/_sqlalchemy_db_connection.py → sibi_dst-0.3.26/sibi_dst/df_helper/backends/sqlalchemy/_db_connection.py +1 -1
- sibi_dst-0.3.24/sibi_dst/df_helper/backends/sql_alchemy/_sqlalchemy_load_from_db.py → sibi_dst-0.3.26/sibi_dst/df_helper/backends/sqlalchemy/_load_from_db.py +2 -2
- sibi_dst-0.3.26/sibi_dst/utils/__init__.py +31 -0
- sibi_dst-0.3.24/sibi_dst/utils/_df_utils.py → sibi_dst-0.3.26/sibi_dst/utils/df_utils.py +2 -2
- sibi_dst-0.3.24/sibi_dst/utils/_log_utils.py → sibi_dst-0.3.26/sibi_dst/utils/log_utils.py +1 -1
- sibi_dst-0.3.24/sibi_dst/df_helper/backends/sql_alchemy/__init__.py +0 -6
- sibi_dst-0.3.24/sibi_dst/utils/__init__.py +0 -31
- {sibi_dst-0.3.24 → sibi_dst-0.3.26}/README.md +0 -0
- {sibi_dst-0.3.24 → sibi_dst-0.3.26}/sibi_dst/__init__.py +0 -0
- {sibi_dst-0.3.24 → sibi_dst-0.3.26}/sibi_dst/df_helper/__init__.py +0 -0
- {sibi_dst-0.3.24 → sibi_dst-0.3.26}/sibi_dst/df_helper/_parquet_artifact.py +0 -0
- {sibi_dst-0.3.24 → sibi_dst-0.3.26}/sibi_dst/df_helper/_parquet_reader.py +0 -0
- {sibi_dst-0.3.24 → sibi_dst-0.3.26}/sibi_dst/df_helper/backends/__init__.py +0 -0
- {sibi_dst-0.3.24 → sibi_dst-0.3.26}/sibi_dst/df_helper/backends/django/_io_dask.py +0 -0
- /sibi_dst-0.3.24/sibi_dst/df_helper/backends/django/_django_load_from_db.py → /sibi_dst-0.3.26/sibi_dst/df_helper/backends/django/_load_from_db.py +0 -0
- {sibi_dst-0.3.24 → sibi_dst-0.3.26}/sibi_dst/df_helper/backends/http/__init__.py +0 -0
- {sibi_dst-0.3.24 → sibi_dst-0.3.26}/sibi_dst/df_helper/backends/http/_http_config.py +0 -0
- /sibi_dst-0.3.24/sibi_dst/df_helper/backends/parquet/_parquet_filter_handler.py → /sibi_dst-0.3.26/sibi_dst/df_helper/backends/parquet/_filter_handler.py +0 -0
- {sibi_dst-0.3.24 → sibi_dst-0.3.26}/sibi_dst/df_helper/backends/parquet/_parquet_options.py +0 -0
- /sibi_dst-0.3.24/sibi_dst/df_helper/backends/sql_alchemy/_sqlachemy_filter_handler.py → /sibi_dst-0.3.26/sibi_dst/df_helper/backends/sqlalchemy/_filter_handler.py +0 -0
- /sibi_dst-0.3.24/sibi_dst/df_helper/backends/sql_alchemy/_io_sqlalchemy_dask.py → /sibi_dst-0.3.26/sibi_dst/df_helper/backends/sqlalchemy/_io_dask.py +0 -0
- /sibi_dst-0.3.24/sibi_dst/df_helper/backends/sql_alchemy/_sqlalchemy_model_builder.py → /sibi_dst-0.3.26/sibi_dst/df_helper/backends/sqlalchemy/_sql_model_builder.py +0 -0
- {sibi_dst-0.3.24 → sibi_dst-0.3.26}/sibi_dst/df_helper/core/__init__.py +0 -0
- {sibi_dst-0.3.24 → sibi_dst-0.3.26}/sibi_dst/df_helper/core/_defaults.py +0 -0
- {sibi_dst-0.3.24 → sibi_dst-0.3.26}/sibi_dst/df_helper/core/_filter_handler.py +0 -0
- {sibi_dst-0.3.24 → sibi_dst-0.3.26}/sibi_dst/df_helper/core/_params_config.py +0 -0
- {sibi_dst-0.3.24 → sibi_dst-0.3.26}/sibi_dst/df_helper/core/_query_config.py +0 -0
- /sibi_dst-0.3.24/sibi_dst/utils/_airflow_manager.py → /sibi_dst-0.3.26/sibi_dst/utils/airflow_manager.py +0 -0
- /sibi_dst-0.3.24/sibi_dst/utils/_clickhouse_writer.py → /sibi_dst-0.3.26/sibi_dst/utils/clickhouse_writer.py +0 -0
- /sibi_dst-0.3.24/sibi_dst/utils/_credentials.py → /sibi_dst-0.3.26/sibi_dst/utils/credentials.py +0 -0
- /sibi_dst-0.3.24/sibi_dst/utils/_data_utils.py → /sibi_dst-0.3.26/sibi_dst/utils/data_utils.py +0 -0
- /sibi_dst-0.3.24/sibi_dst/utils/_data_wrapper.py → /sibi_dst-0.3.26/sibi_dst/utils/data_wrapper.py +0 -0
- /sibi_dst-0.3.24/sibi_dst/utils/_date_utils.py → /sibi_dst-0.3.26/sibi_dst/utils/date_utils.py +0 -0
- /sibi_dst-0.3.24/sibi_dst/utils/_file_utils.py → /sibi_dst-0.3.26/sibi_dst/utils/file_utils.py +0 -0
- /sibi_dst-0.3.24/sibi_dst/utils/_filepath_generator.py → /sibi_dst-0.3.26/sibi_dst/utils/filepath_generator.py +0 -0
- /sibi_dst-0.3.24/sibi_dst/utils/_parquet_saver.py → /sibi_dst-0.3.26/sibi_dst/utils/parquet_saver.py +0 -0
- /sibi_dst-0.3.24/sibi_dst/utils/_storage_manager.py → /sibi_dst-0.3.26/sibi_dst/utils/storage_manager.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: sibi-dst
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.26
|
4
4
|
Summary: Data Science Toolkit
|
5
5
|
Author: Luis Valverde
|
6
6
|
Author-email: lvalverdeb@gmail.com
|
@@ -30,6 +30,7 @@ Requires-Dist: pyarrow (>=18.0.0,<19.0.0)
|
|
30
30
|
Requires-Dist: pydantic (>=2.9.2,<3.0.0)
|
31
31
|
Requires-Dist: pymysql (>=1.1.1,<2.0.0)
|
32
32
|
Requires-Dist: pytest (>=8.3.3,<9.0.0)
|
33
|
+
Requires-Dist: pytest-mock (>=3.14.0,<4.0.0)
|
33
34
|
Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
|
34
35
|
Requires-Dist: sqlalchemy (>=2.0.36,<3.0.0)
|
35
36
|
Requires-Dist: tornado (>=6.4.1,<7.0.0)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "sibi-dst"
|
3
|
-
version = "0.3.
|
3
|
+
version = "0.3.26"
|
4
4
|
description = "Data Science Toolkit"
|
5
5
|
authors = ["Luis Valverde <lvalverdeb@gmail.com>"]
|
6
6
|
readme = "README.md"
|
@@ -35,6 +35,7 @@ djangorestframework = "^3.15.2"
|
|
35
35
|
dask-expr = "^1.1.20"
|
36
36
|
psycopg2 = "^2.9.10"
|
37
37
|
uvicorn = "^0.34.0"
|
38
|
+
pytest-mock = "^3.14.0"
|
38
39
|
|
39
40
|
|
40
41
|
[build-system]
|
@@ -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):
|
@@ -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:
|
@@ -0,0 +1,31 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
|
3
|
+
from .log_utils import Logger
|
4
|
+
from .date_utils import *
|
5
|
+
from .data_utils import DataUtils
|
6
|
+
from .file_utils import FileUtils
|
7
|
+
from .filepath_generator import FilePathGenerator
|
8
|
+
from .df_utils import DfUtils
|
9
|
+
from .storage_manager import StorageManager
|
10
|
+
from .parquet_saver import ParquetSaver
|
11
|
+
from .clickhouse_writer import ClickHouseWriter
|
12
|
+
from .airflow_manager import AirflowDAGManager
|
13
|
+
from .credentials import *
|
14
|
+
from .data_wrapper import DataWrapper
|
15
|
+
|
16
|
+
__all__ = [
|
17
|
+
"Logger",
|
18
|
+
"ConfigManager",
|
19
|
+
"ConfigLoader",
|
20
|
+
"DateUtils",
|
21
|
+
"BusinessDays",
|
22
|
+
"FileUtils",
|
23
|
+
"DataWrapper",
|
24
|
+
"DataUtils",
|
25
|
+
"FilePathGenerator",
|
26
|
+
"ParquetSaver",
|
27
|
+
"StorageManager",
|
28
|
+
"DfUtils",
|
29
|
+
"ClickHouseWriter",
|
30
|
+
"AirflowDAGManager",
|
31
|
+
]
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import dask.dataframe as dd
|
2
2
|
import pandas as pd
|
3
3
|
|
4
|
-
from .
|
4
|
+
from .log_utils import Logger
|
5
5
|
|
6
6
|
|
7
7
|
class DfUtils:
|
@@ -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
|
|
@@ -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']
|
@@ -1,31 +0,0 @@
|
|
1
|
-
from __future__ import annotations
|
2
|
-
|
3
|
-
from ._log_utils import Logger
|
4
|
-
from ._date_utils import *
|
5
|
-
from ._data_utils import DataUtils
|
6
|
-
from ._file_utils import FileUtils
|
7
|
-
from ._filepath_generator import FilePathGenerator
|
8
|
-
from ._df_utils import DfUtils
|
9
|
-
from ._storage_manager import StorageManager
|
10
|
-
from ._parquet_saver import ParquetSaver
|
11
|
-
from ._clickhouse_writer import ClickHouseWriter
|
12
|
-
from ._airflow_manager import AirflowDAGManager
|
13
|
-
from ._credentials import *
|
14
|
-
from ._data_wrapper import DataWrapper
|
15
|
-
|
16
|
-
__all__ = [
|
17
|
-
"Logger",
|
18
|
-
"ConfigManager",
|
19
|
-
"ConfigLoader",
|
20
|
-
"DateUtils",
|
21
|
-
"BusinessDays",
|
22
|
-
"FileUtils",
|
23
|
-
"DataWrapper",
|
24
|
-
"DataUtils",
|
25
|
-
"FilePathGenerator",
|
26
|
-
"ParquetSaver",
|
27
|
-
"StorageManager",
|
28
|
-
"DfUtils",
|
29
|
-
"ClickHouseWriter",
|
30
|
-
"AirflowDAGManager",
|
31
|
-
]
|
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
|
File without changes
|
File without changes
|
File without changes
|
/sibi_dst-0.3.24/sibi_dst/utils/_credentials.py → /sibi_dst-0.3.26/sibi_dst/utils/credentials.py
RENAMED
File without changes
|
/sibi_dst-0.3.24/sibi_dst/utils/_data_utils.py → /sibi_dst-0.3.26/sibi_dst/utils/data_utils.py
RENAMED
File without changes
|
/sibi_dst-0.3.24/sibi_dst/utils/_data_wrapper.py → /sibi_dst-0.3.26/sibi_dst/utils/data_wrapper.py
RENAMED
File without changes
|
/sibi_dst-0.3.24/sibi_dst/utils/_date_utils.py → /sibi_dst-0.3.26/sibi_dst/utils/date_utils.py
RENAMED
File without changes
|
/sibi_dst-0.3.24/sibi_dst/utils/_file_utils.py → /sibi_dst-0.3.26/sibi_dst/utils/file_utils.py
RENAMED
File without changes
|
File without changes
|
/sibi_dst-0.3.24/sibi_dst/utils/_parquet_saver.py → /sibi_dst-0.3.26/sibi_dst/utils/parquet_saver.py
RENAMED
File without changes
|
File without changes
|