sibi-dst 0.3.47__tar.gz → 0.3.48__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.
Files changed (81) hide show
  1. {sibi_dst-0.3.47 → sibi_dst-0.3.48}/PKG-INFO +4 -4
  2. {sibi_dst-0.3.47 → sibi_dst-0.3.48}/README.md +3 -3
  3. {sibi_dst-0.3.47 → sibi_dst-0.3.48}/pyproject.toml +1 -1
  4. sibi_dst-0.3.48/sibi_dst/__init__.py +10 -0
  5. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/__init__.py +0 -2
  6. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/_artifact_updater_multi_wrapper.py +1 -1
  7. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/_df_helper.py +3 -3
  8. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/_parquet_artifact.py +2 -2
  9. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/_parquet_reader.py +2 -2
  10. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/backends/django/_load_from_db.py +3 -3
  11. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/backends/http/_http_config.py +1 -1
  12. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/backends/parquet/_filter_handler.py +1 -1
  13. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/backends/parquet/_parquet_options.py +2 -2
  14. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/backends/sqlalchemy/_io_dask.py +2 -2
  15. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/backends/sqlalchemy/_load_from_db.py +2 -2
  16. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/core/_filter_handler.py +1 -1
  17. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/osmnx_helper/basemaps/router_plotter.py +2 -2
  18. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/tests/test_data_wrapper_class.py +2 -2
  19. sibi_dst-0.3.47/sibi_dst/__init__.py +0 -47
  20. sibi_dst-0.3.47/sibi_dst/v2/df_helper/backends/__init__.py +0 -0
  21. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst/df_helper/backends}/__init__.py +0 -0
  22. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/backends/django/__init__.py +0 -0
  23. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/backends/django/_db_connection.py +0 -0
  24. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/backends/django/_io_dask.py +0 -0
  25. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/backends/django/_sql_model_builder.py +0 -0
  26. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/backends/http/__init__.py +0 -0
  27. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/backends/parquet/__init__.py +0 -0
  28. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/backends/sqlalchemy/__init__.py +0 -0
  29. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/backends/sqlalchemy/_db_connection.py +0 -0
  30. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/backends/sqlalchemy/_filter_handler.py +0 -0
  31. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/backends/sqlalchemy/_sql_model_builder.py +0 -0
  32. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/core/__init__.py +0 -0
  33. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/core/_defaults.py +0 -0
  34. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/core/_params_config.py +0 -0
  35. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/core/_query_config.py +0 -0
  36. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/df_helper/data_cleaner.py +0 -0
  37. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/geopy_helper/__init__.py +0 -0
  38. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/geopy_helper/geo_location_service.py +0 -0
  39. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/geopy_helper/utils.py +0 -0
  40. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/osmnx_helper/__init__.py +0 -0
  41. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/osmnx_helper/base_osm_map.py +0 -0
  42. {sibi_dst-0.3.47/sibi_dst/v1/df_helper/backends → sibi_dst-0.3.48/sibi_dst/osmnx_helper/basemaps}/__init__.py +0 -0
  43. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/osmnx_helper/basemaps/calendar_html.py +0 -0
  44. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/osmnx_helper/utils.py +0 -0
  45. {sibi_dst-0.3.47/sibi_dst/v1/osmnx_helper/basemaps → sibi_dst-0.3.48/sibi_dst/tests}/__init__.py +0 -0
  46. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/utils/__init__.py +0 -0
  47. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/utils/airflow_manager.py +0 -0
  48. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/utils/clickhouse_writer.py +0 -0
  49. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/utils/credentials.py +0 -0
  50. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/utils/data_from_http_source.py +0 -0
  51. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/utils/data_utils.py +0 -0
  52. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/utils/data_wrapper.py +0 -0
  53. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/utils/date_utils.py +0 -0
  54. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/utils/df_utils.py +0 -0
  55. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/utils/file_utils.py +0 -0
  56. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/utils/filepath_generator.py +0 -0
  57. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/utils/log_utils.py +0 -0
  58. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/utils/parquet_saver.py +0 -0
  59. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/utils/phone_formatter.py +0 -0
  60. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/utils/storage_config.py +0 -0
  61. {sibi_dst-0.3.47/sibi_dst/v1 → sibi_dst-0.3.48/sibi_dst}/utils/storage_manager.py +0 -0
  62. {sibi_dst-0.3.47/sibi_dst/v1/tests → sibi_dst-0.3.48/sibi_dst/v2}/__init__.py +0 -0
  63. {sibi_dst-0.3.47 → sibi_dst-0.3.48}/sibi_dst/v2/df_helper/__init__.py +0 -0
  64. {sibi_dst-0.3.47 → sibi_dst-0.3.48}/sibi_dst/v2/df_helper/_df_helper.py +0 -0
  65. {sibi_dst-0.3.47/sibi_dst/v2 → sibi_dst-0.3.48/sibi_dst/v2/df_helper/backends}/__init__.py +0 -0
  66. {sibi_dst-0.3.47 → sibi_dst-0.3.48}/sibi_dst/v2/df_helper/backends/sqlalchemy/__init__.py +0 -0
  67. {sibi_dst-0.3.47 → sibi_dst-0.3.48}/sibi_dst/v2/df_helper/backends/sqlalchemy/_db_connection.py +0 -0
  68. {sibi_dst-0.3.47 → sibi_dst-0.3.48}/sibi_dst/v2/df_helper/backends/sqlalchemy/_io_dask.py +0 -0
  69. {sibi_dst-0.3.47 → sibi_dst-0.3.48}/sibi_dst/v2/df_helper/backends/sqlalchemy/_load_from_db.py +0 -0
  70. {sibi_dst-0.3.47 → sibi_dst-0.3.48}/sibi_dst/v2/df_helper/backends/sqlalchemy/_model_builder.py +0 -0
  71. {sibi_dst-0.3.47 → sibi_dst-0.3.48}/sibi_dst/v2/df_helper/backends/sqlmodel/__init__.py +0 -0
  72. {sibi_dst-0.3.47 → sibi_dst-0.3.48}/sibi_dst/v2/df_helper/backends/sqlmodel/_db_connection.py +0 -0
  73. {sibi_dst-0.3.47 → sibi_dst-0.3.48}/sibi_dst/v2/df_helper/backends/sqlmodel/_io_dask.py +0 -0
  74. {sibi_dst-0.3.47 → sibi_dst-0.3.48}/sibi_dst/v2/df_helper/backends/sqlmodel/_load_from_db.py +0 -0
  75. {sibi_dst-0.3.47 → sibi_dst-0.3.48}/sibi_dst/v2/df_helper/backends/sqlmodel/_model_builder.py +0 -0
  76. {sibi_dst-0.3.47 → sibi_dst-0.3.48}/sibi_dst/v2/df_helper/core/__init__.py +0 -0
  77. {sibi_dst-0.3.47 → sibi_dst-0.3.48}/sibi_dst/v2/df_helper/core/_filter_handler.py +0 -0
  78. {sibi_dst-0.3.47 → sibi_dst-0.3.48}/sibi_dst/v2/df_helper/core/_params_config.py +0 -0
  79. {sibi_dst-0.3.47 → sibi_dst-0.3.48}/sibi_dst/v2/df_helper/core/_query_config.py +0 -0
  80. {sibi_dst-0.3.47 → sibi_dst-0.3.48}/sibi_dst/v2/utils/__init__.py +0 -0
  81. {sibi_dst-0.3.47 → sibi_dst-0.3.48}/sibi_dst/v2/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.47
3
+ Version: 0.3.48
4
4
  Summary: Data Science Toolkit
5
5
  Author: Luis Valverde
6
6
  Author-email: lvalverdeb@gmail.com
@@ -66,7 +66,7 @@ Supported Technologies
66
66
  - **Machine Learning**: Scikit-Learn, XGBoost
67
67
  - **Databases & Storage**: SQLAlchemy, Django ORM, Parquet, Amazon S3, GCS, Azure Blob Storage
68
68
  - **Mapping & Geospatial Analysis**: OpenStreetMaps, OSMnx, Geopy
69
- - **API Development**: Django REST Framework, gRPC
69
+ - **API Development**: Django REST Framework, gRPC, FastAPI
70
70
 
71
71
  Installation
72
72
  ---------------------
@@ -159,7 +159,7 @@ Provides **geolocation services** using `Geopy` for forward and reverse geocodin
159
159
  ```python
160
160
  from sibi_dst.geopy_helper import GeolocationService
161
161
  gs = GeolocationService()
162
- location = gs.reverse_geocode(lat=9.935, lon=-84.091)
162
+ location = gs.reverse((9.935,-84.091))
163
163
  print(location)
164
164
  ```
165
165
 
@@ -174,7 +174,7 @@ result = df_helper.load(date__gte='2023-01-01', status='active')
174
174
  ### Parallel Processing
175
175
  Leverage Dask for parallel execution:
176
176
  ```python
177
- results = df_helper.load_parallel(status='active')
177
+ result = df_helper.load_parallel(status='active')
178
178
  ```
179
179
 
180
180
  Testing
@@ -17,7 +17,7 @@ Supported Technologies
17
17
  - **Machine Learning**: Scikit-Learn, XGBoost
18
18
  - **Databases & Storage**: SQLAlchemy, Django ORM, Parquet, Amazon S3, GCS, Azure Blob Storage
19
19
  - **Mapping & Geospatial Analysis**: OpenStreetMaps, OSMnx, Geopy
20
- - **API Development**: Django REST Framework, gRPC
20
+ - **API Development**: Django REST Framework, gRPC, FastAPI
21
21
 
22
22
  Installation
23
23
  ---------------------
@@ -110,7 +110,7 @@ Provides **geolocation services** using `Geopy` for forward and reverse geocodin
110
110
  ```python
111
111
  from sibi_dst.geopy_helper import GeolocationService
112
112
  gs = GeolocationService()
113
- location = gs.reverse_geocode(lat=9.935, lon=-84.091)
113
+ location = gs.reverse((9.935,-84.091))
114
114
  print(location)
115
115
  ```
116
116
 
@@ -125,7 +125,7 @@ result = df_helper.load(date__gte='2023-01-01', status='active')
125
125
  ### Parallel Processing
126
126
  Leverage Dask for parallel execution:
127
127
  ```python
128
- results = df_helper.load_parallel(status='active')
128
+ result = df_helper.load_parallel(status='active')
129
129
  ```
130
130
 
131
131
  Testing
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "sibi-dst"
3
- version = "0.3.47"
3
+ version = "0.3.48"
4
4
  description = "Data Science Toolkit"
5
5
  authors = ["Luis Valverde <lvalverdeb@gmail.com>"]
6
6
  readme = "README.md"
@@ -0,0 +1,10 @@
1
+
2
+ try:
3
+ import importlib.metadata as version_reader
4
+ except ImportError:
5
+ import importlib_metadata as version_reader
6
+
7
+ try:
8
+ __version__ = version_reader.version("sibi-dst")
9
+ except version_reader.PackageNotFoundError:
10
+ __version__ = "unknown"
@@ -4,12 +4,10 @@ from ._df_helper import DfHelper
4
4
  from ._parquet_artifact import ParquetArtifact
5
5
  from ._parquet_reader import ParquetReader
6
6
  from ._artifact_updater_multi_wrapper import ArtifactUpdaterMultiWrapper
7
- #from .data_cleaner import DataCleaner
8
7
 
9
8
  __all__ = [
10
9
  'DfHelper',
11
10
  'ParquetArtifact',
12
11
  'ParquetReader',
13
12
  'ArtifactUpdaterMultiWrapper',
14
- #'DataCleaner'
15
13
  ]
@@ -7,7 +7,7 @@ from functools import total_ordering
7
7
  from collections import defaultdict
8
8
  from contextlib import asynccontextmanager
9
9
  import signal
10
- from sibi_dst.v1.utils import Logger
10
+ from sibi_dst.utils import Logger
11
11
 
12
12
  @total_ordering
13
13
  class PrioritizedItem:
@@ -11,9 +11,9 @@ import pandas as pd
11
11
  from pydantic import BaseModel
12
12
  import fsspec
13
13
 
14
- from sibi_dst.v1.df_helper.core import QueryConfig, ParamsConfig, FilterHandler
15
- from sibi_dst.v1.utils import Logger
16
- from sibi_dst.v1.utils import ParquetSaver, ClickHouseWriter
14
+ from sibi_dst.df_helper.core import QueryConfig, ParamsConfig, FilterHandler
15
+ from sibi_dst.utils import Logger
16
+ from sibi_dst.utils import ParquetSaver, ClickHouseWriter
17
17
  from .backends.django import *
18
18
  from .backends.http import HttpConfig
19
19
  from .backends.parquet import ParquetConfig
@@ -5,8 +5,8 @@ from typing import Optional, Any, Dict
5
5
  import dask.dataframe as dd
6
6
  import fsspec
7
7
 
8
- from sibi_dst.v1.df_helper import DfHelper
9
- from sibi_dst.v1.utils import DataWrapper, DateUtils, Logger
8
+ from sibi_dst.df_helper import DfHelper
9
+ from sibi_dst.utils import DataWrapper, DateUtils, Logger
10
10
 
11
11
 
12
12
  class ParquetArtifact(DfHelper):
@@ -4,8 +4,8 @@ from typing import Optional
4
4
  import dask.dataframe as dd
5
5
  import fsspec
6
6
 
7
- from sibi_dst.v1.df_helper import DfHelper
8
- from sibi_dst.v1.utils import Logger
7
+ from sibi_dst.df_helper import DfHelper
8
+ from sibi_dst.utils import Logger
9
9
 
10
10
  class ParquetReader(DfHelper):
11
11
  """
@@ -4,9 +4,9 @@ import dask.dataframe as dd
4
4
  import pandas as pd
5
5
  from django.db.models import Q
6
6
 
7
- from sibi_dst.v1.df_helper.backends.django import ReadFrameDask
8
- from sibi_dst.v1.df_helper.core import django_field_conversion_map_dask
9
- from sibi_dst.v1.utils import Logger
7
+ from sibi_dst.df_helper.backends.django import ReadFrameDask
8
+ from sibi_dst.df_helper.core import django_field_conversion_map_dask
9
+ from sibi_dst.utils import Logger
10
10
 
11
11
 
12
12
  class DjangoLoadFromDb:
@@ -5,7 +5,7 @@ import httpx
5
5
  import pandas as pd
6
6
  from pydantic import BaseModel, HttpUrl, Field, ConfigDict, SecretStr
7
7
 
8
- from sibi_dst.v1.utils import Logger
8
+ from sibi_dst.utils import Logger
9
9
 
10
10
 
11
11
  class HttpConfig(BaseModel):
@@ -1,7 +1,7 @@
1
1
  import dask.dataframe as dd
2
2
  import pandas as pd
3
3
 
4
- from sibi_dst.v1.utils import Logger
4
+ from sibi_dst.utils import Logger
5
5
 
6
6
 
7
7
  class ParquetFilterHandler(object):
@@ -6,8 +6,8 @@ import dask.dataframe as dd
6
6
  import fsspec
7
7
  from pydantic import BaseModel, model_validator, DirectoryPath, FilePath, ConfigDict
8
8
 
9
- from sibi_dst.v1.utils import FilePathGenerator
10
- from sibi_dst.v1.utils import Logger
9
+ from sibi_dst.utils import FilePathGenerator
10
+ from sibi_dst.utils import Logger
11
11
 
12
12
 
13
13
  class ParquetConfig(BaseModel):
@@ -5,8 +5,8 @@ import pandas as pd
5
5
  from sqlalchemy import create_engine, inspect, select
6
6
  from sqlalchemy.orm import sessionmaker
7
7
 
8
- from sibi_dst.v1.df_helper.core import FilterHandler
9
- from sibi_dst.v1.utils import Logger
8
+ from sibi_dst.df_helper.core import FilterHandler
9
+ from sibi_dst.utils import Logger
10
10
 
11
11
 
12
12
  class SQLAlchemyDask:
@@ -1,8 +1,8 @@
1
1
  import dask.dataframe as dd
2
2
  import pandas as pd
3
3
 
4
- from sibi_dst.v1.df_helper.core import ParamsConfig, QueryConfig
5
- from sibi_dst.v1.utils import Logger
4
+ from sibi_dst.df_helper.core import ParamsConfig, QueryConfig
5
+ from sibi_dst.utils import Logger
6
6
  from ._io_dask import SQLAlchemyDask
7
7
  from ._db_connection import SqlAlchemyConnectionConfig
8
8
 
@@ -5,7 +5,7 @@ import pandas as pd
5
5
  from sqlalchemy import func, cast
6
6
  from sqlalchemy.sql.sqltypes import Date, Time
7
7
 
8
- from sibi_dst.v1.utils import Logger
8
+ from sibi_dst.utils import Logger
9
9
 
10
10
 
11
11
  class FilterHandler:
@@ -1,12 +1,12 @@
1
1
  from __future__ import annotations
2
- from sibi_dst.osmnx_helper.v1.utils import get_distance_between_points, add_arrows
2
+ from sibi_dst.osmnx_helper.utils import get_distance_between_points, add_arrows
3
3
  from collections import defaultdict
4
4
  import folium
5
5
  from folium.plugins import AntPath
6
6
  import networkx as nx
7
7
 
8
8
  from sibi_dst.osmnx_helper import BaseOsmMap
9
- from sibi_dst.osmnx_helper.v1.basemaps.calendar_html import calendar_html
9
+ from sibi_dst.osmnx_helper.basemaps.calendar_html import calendar_html
10
10
 
11
11
  class RoutePlotter(BaseOsmMap):
12
12
  def __init__(self, osmnx_graph, df, **kwargs):
@@ -2,8 +2,8 @@ import unittest
2
2
  from unittest.mock import patch, MagicMock
3
3
  import datetime
4
4
  import pandas as pd
5
- from sibi_dst.v1.utils import Logger, ParquetSaver
6
- from sibi_dst.v1.utils.data_wrapper import DataWrapper
5
+ from sibi_dst.utils import Logger, ParquetSaver
6
+ from sibi_dst.utils.data_wrapper import DataWrapper
7
7
  from threading import Lock
8
8
 
9
9
  class TestDataWrapper(unittest.TestCase):
@@ -1,47 +0,0 @@
1
-
2
- try:
3
- import importlib.metadata as version_reader
4
- except ImportError:
5
- import importlib_metadata as version_reader
6
-
7
- try:
8
- __version__ = version_reader.version("sibi-dst")
9
- except version_reader.PackageNotFoundError:
10
- __version__ = "unknown"
11
-
12
- import importlib
13
- import sys
14
-
15
- def _load_module(version, module_name):
16
- # Construct the relative module path (e.g., ".v1.df_helper")
17
- module_path = f".{version}.{module_name}"
18
- #print(f"Loading module: {module_path} from package {__package__}")
19
- return importlib.import_module(module_path, package=__package__)
20
-
21
-
22
- # Toggle version by setting the flag (or use an environment variable)
23
- use_v2 = False
24
- default_version = "v2" if use_v2 else "v1"
25
-
26
- # Dynamically load the modules from the chosen version directory.
27
- df_helper = _load_module(default_version, "df_helper")
28
- geopy_helper = _load_module(default_version, "geopy_helper")
29
- osmnx_helper = _load_module(default_version, "osmnx_helper")
30
- tests = _load_module(default_version, "tests")
31
- utils = _load_module(default_version, "utils")
32
-
33
- # Re-export the modules at the top level so that absolute imports work.
34
- sys.modules[f"{__package__}.df_helper"] = df_helper
35
- sys.modules[f"{__package__}.geopy_helper"] = geopy_helper
36
- sys.modules[f"{__package__}.osmnx_helper"] = osmnx_helper
37
- sys.modules[f"{__package__}.tests"] = tests
38
- sys.modules[f"{__package__}.utils"] = utils
39
-
40
- # Define what is exported with "from sibi_dst import *"
41
- __all__ = [
42
- "df_helper",
43
- "geopy_helper",
44
- "osmnx_helper",
45
- "tests",
46
- "utils"
47
- ]