sibi-dst 0.3.31__tar.gz → 0.3.32__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.31 → sibi_dst-0.3.32}/PKG-INFO +3 -1
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/pyproject.toml +3 -1
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/_parquet_artifact.py +5 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/_parquet_reader.py +9 -1
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/utils/parquet_saver.py +1 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/utils/storage_manager.py +4 -1
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/README.md +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/__init__.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/__init__.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/_df_helper.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/backends/__init__.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/backends/django/__init__.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/backends/django/_db_connection.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/backends/django/_io_dask.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/backends/django/_load_from_db.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/backends/django/_sql_model_builder.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/backends/http/__init__.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/backends/http/_http_config.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/backends/parquet/__init__.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/backends/parquet/_filter_handler.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/backends/parquet/_parquet_options.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/backends/sqlalchemy/__init__.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/backends/sqlalchemy/_db_connection.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/backends/sqlalchemy/_filter_handler.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/backends/sqlalchemy/_io_dask.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/backends/sqlalchemy/_load_from_db.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/backends/sqlalchemy/_sql_model_builder.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/core/__init__.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/core/_defaults.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/core/_filter_handler.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/core/_params_config.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/core/_query_config.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/data_cleaner.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/geopy_helper/__init__.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/geopy_helper/geo_location_service.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/geopy_helper/utils.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/osmnx_helper/__init__.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/osmnx_helper/base_osm_map.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/osmnx_helper/basemaps/__init__.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/osmnx_helper/basemaps/calendar_html.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/osmnx_helper/basemaps/router_plotter.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/osmnx_helper/utils.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/tests/__init__.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/tests/test_data_wrapper_class.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/utils/__init__.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/utils/airflow_manager.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/utils/clickhouse_writer.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/utils/credentials.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/utils/data_utils.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/utils/data_wrapper.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/utils/date_utils.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/utils/df_utils.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/utils/file_utils.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/utils/filepath_generator.py +0 -0
- {sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/utils/log_utils.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.32
|
4
4
|
Summary: Data Science Toolkit
|
5
5
|
Author: Luis Valverde
|
6
6
|
Author-email: lvalverdeb@gmail.com
|
@@ -20,6 +20,7 @@ Requires-Dist: django (>=5.1.4,<6.0.0)
|
|
20
20
|
Requires-Dist: djangorestframework (>=3.15.2,<4.0.0)
|
21
21
|
Requires-Dist: folium (>=0.19.4,<0.20.0)
|
22
22
|
Requires-Dist: geopandas (>=1.0.1,<2.0.0)
|
23
|
+
Requires-Dist: gunicorn (>=23.0.0,<24.0.0)
|
23
24
|
Requires-Dist: httpx (>=0.27.2,<0.28.0)
|
24
25
|
Requires-Dist: ipython (>=8.29.0,<9.0.0)
|
25
26
|
Requires-Dist: jinja2 (>=3.1.4,<4.0.0)
|
@@ -42,6 +43,7 @@ Requires-Dist: sqlalchemy (>=2.0.36,<3.0.0)
|
|
42
43
|
Requires-Dist: tornado (>=6.4.1,<7.0.0)
|
43
44
|
Requires-Dist: tqdm (>=4.67.0,<5.0.0)
|
44
45
|
Requires-Dist: uvicorn (>=0.34.0,<0.35.0)
|
46
|
+
Requires-Dist: uvicorn-worker (>=0.3.0,<0.4.0)
|
45
47
|
Description-Content-Type: text/markdown
|
46
48
|
|
47
49
|
# sibi-dst
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "sibi-dst"
|
3
|
-
version = "0.3.
|
3
|
+
version = "0.3.32"
|
4
4
|
description = "Data Science Toolkit"
|
5
5
|
authors = ["Luis Valverde <lvalverdeb@gmail.com>"]
|
6
6
|
readme = "README.md"
|
@@ -41,6 +41,8 @@ nltk = "^3.9.1"
|
|
41
41
|
folium = "^0.19.4"
|
42
42
|
geopandas = "^1.0.1"
|
43
43
|
osmnx = "^2.0.1"
|
44
|
+
gunicorn = "^23.0.0"
|
45
|
+
uvicorn-worker = "^0.3.0"
|
44
46
|
|
45
47
|
|
46
48
|
[build-system]
|
@@ -61,6 +61,11 @@ class ParquetArtifact(DfHelper):
|
|
61
61
|
dw = DataWrapper(self.data_wrapper_class, **params)
|
62
62
|
dw.process()
|
63
63
|
|
64
|
+
def __exit__(self, exc_type, exc_value, traceback):
|
65
|
+
# Ensure resources are cleaned up
|
66
|
+
if self.fs:
|
67
|
+
self.fs.close()
|
68
|
+
|
64
69
|
def update_parquet(self, period: str = 'today', **kwargs) -> None:
|
65
70
|
"""Update the Parquet file with data from a specific period."""
|
66
71
|
kwargs.update(self.parse_parquet_period(period=period))
|
@@ -31,7 +31,10 @@ class ParquetReader(DfHelper):
|
|
31
31
|
# Filesystem setup
|
32
32
|
self.filesystem_type = filesystem_type
|
33
33
|
self.filesystem_options = filesystem_options or {}
|
34
|
-
self.fs =
|
34
|
+
self.fs = self.config.setdefault('fs', None)
|
35
|
+
if self.fs is None:
|
36
|
+
self.fs = fsspec.filesystem(self.filesystem_type, **self.filesystem_options)
|
37
|
+
self.config.setdefault('fs', self.fs)
|
35
38
|
|
36
39
|
if not self.directory_exists():
|
37
40
|
raise ValueError(f"{self.parquet_storage_path} does not exist")
|
@@ -48,3 +51,8 @@ class ParquetReader(DfHelper):
|
|
48
51
|
return info['type'] == 'directory'
|
49
52
|
except FileNotFoundError:
|
50
53
|
return False
|
54
|
+
|
55
|
+
def __exit__(self, exc_type, exc_value, traceback):
|
56
|
+
# Ensure resources are cleaned up
|
57
|
+
if self.fs:
|
58
|
+
self.fs.close()
|
@@ -38,6 +38,7 @@ class ParquetSaver:
|
|
38
38
|
schema = self._define_schema()
|
39
39
|
self._convert_dtypes(schema)
|
40
40
|
self._save_dataframe_to_parquet(full_path, schema)
|
41
|
+
self.fs.close()
|
41
42
|
|
42
43
|
def _define_schema(self) -> pa.Schema:
|
43
44
|
"""Define a PyArrow schema dynamically based on df_result column types."""
|
@@ -90,4 +90,7 @@ class StorageManager:
|
|
90
90
|
"""
|
91
91
|
print("Rebuilding depot structure...")
|
92
92
|
self.rebuild_depot_paths(depots, clear_existing=clear_existing)
|
93
|
-
print("Rebuild complete.")
|
93
|
+
print("Rebuild complete.")
|
94
|
+
|
95
|
+
def get_fs_instance(self):
|
96
|
+
return fsspec.filesystem(self.fs_type, **self.fs_options)
|
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.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/backends/django/_sql_model_builder.py
RENAMED
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.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/backends/sqlalchemy/_db_connection.py
RENAMED
File without changes
|
{sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/backends/sqlalchemy/_filter_handler.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{sibi_dst-0.3.31 → sibi_dst-0.3.32}/sibi_dst/df_helper/backends/sqlalchemy/_sql_model_builder.py
RENAMED
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|