berryworld 1.0.0.182021__py3-none-any.whl → 1.0.0.182201__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.
berryworld/__init__.py CHANGED
@@ -1,5 +1,5 @@
1
1
  from .xml_parser import XMLparser
2
- from .handy_mix import HandyMix
2
+ from .handy_mix import HandyMix, URLResolver
3
3
  from .transportation_solver import TransportationAlgorithm
4
4
  from .allocation_solver import AllocationSolver
5
5
  from .pickle_management import PickleManagement
berryworld/handy_mix.py CHANGED
@@ -234,3 +234,30 @@ class HandyMix:
234
234
  ~data[float_col].isnull(), float_col].astype(str).str.replace('.0', '', regex=True)
235
235
 
236
236
  return data
237
+
238
+
239
+ class URLResolver:
240
+ @staticmethod
241
+ def resolve_url_requested(url_requested, endpoint_requested):
242
+ """Resolve the URL requested.
243
+ :param url_requested: The base url that includes the project root
244
+ :param endpoint_requested: The endpoint that will be added to the base url
245
+ """
246
+ url_requested = str(url_requested)
247
+ endpoint_requested = str(endpoint_requested)
248
+
249
+ domains = ["berryworld.com", "berryworld.net"]
250
+
251
+ for domain in domains:
252
+ if domain in url_requested:
253
+ if url_requested.endswith('/'):
254
+ url_requested = url_requested.rstrip('/')
255
+
256
+ path_after_domain = ''
257
+ if domain in endpoint_requested:
258
+ path_after_domain = endpoint_requested.split(f"{domain}", 1)[-1]
259
+
260
+ url_requested = f"{url_requested}{path_after_domain}"
261
+ break
262
+
263
+ return url_requested
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: berryworld
3
- Version: 1.0.0.182021
3
+ Version: 1.0.0.182201
4
4
  Summary: Handy classes to improve ETL processes
5
5
  Home-page: https://www.berryworld.com
6
6
  Author: BerryWorld ltd
@@ -1,4 +1,4 @@
1
- berryworld/__init__.py,sha256=YPN80HLzEFOksFmQSvcNi7lJmE1HsLTbb8sb6d9L-K0,1172
1
+ berryworld/__init__.py,sha256=FxoH2n864zRK6cVG47s8ciwDldfMB3zVzfa3ZRwtLWk,1185
2
2
  berryworld/aks_logs.py,sha256=Gb2_cokiZbEX01Yoptd0MxpDociaug-GrXdwliyxFBo,2293
3
3
  berryworld/allocation_solver.py,sha256=asFtaCAze6-eHUGWXA0kAp67UBS-Upj1KKdrVLj_ttQ,8513
4
4
  berryworld/app_logs.py,sha256=MKzKPYd3JuPfOQNAapIgaeZeFHw1z_w2mbn9I6QCADE,4180
@@ -9,7 +9,7 @@ berryworld/devops.py,sha256=BAsVonVwCXoApUOovkt-BCzwc6KnXjxRDGff_ejSGw8,9719
9
9
  berryworld/email_con.py,sha256=uSBzs_Ijz9pUPWt9e7U3TCB7i6q7hU1bB5vhsTB_tmw,14448
10
10
  berryworld/email_logging.py,sha256=LeSrTExhQhar49gJR2wGC1dS0lqsNpFl9pS3eYWqnuo,4936
11
11
  berryworld/generate_env.py,sha256=Tk9Z_u7cA4Ve8YYTyLH2qwmLVAuYoTIWoFc0h8Va8lY,7842
12
- berryworld/handy_mix.py,sha256=lRUes_V4jL-3ADOzwiKqi1Dukx-HWXvmf9-4s4MLwsA,9740
12
+ berryworld/handy_mix.py,sha256=ZPr5Z4l5TfyXQjhuLjttGi90whBooTQhB7M-Lq5L1DQ,10683
13
13
  berryworld/logging.py,sha256=tOxzaFALQm3aVVEc3I7t8MU6PwgUI9VSnzNCH9yRryo,1013
14
14
  berryworld/logic_apps.py,sha256=a0uU4tNO3v2w7grdBv-OOx4hUf7VBIerJpwZ9U-29dQ,14591
15
15
  berryworld/microsoft_teams.py,sha256=8uPo0yku-euBj2VdzBoZCeX3IcsCCOqISLqaVZUVxfA,16030
@@ -30,8 +30,8 @@ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
30
  tests/test_allocation_config.py,sha256=e12l6fE9U57eSPS35g6ekJ_hol7-RHg89JV60_m1BlE,4633
31
31
  tests/test_handy_mix_config.py,sha256=Un56mz9KJmdn4K4OwzHAHLSRzDU1Xv2nFrONNuzOG04,2594
32
32
  tests/test_xml_parser.py,sha256=3QTlhFEd6KbK6nRFKZnc35tad6wqukTbe4QrFi8mr_8,859
33
- berryworld-1.0.0.182021.dist-info/LICENSE,sha256=vtkVCJM6E2af2gnsi2XxKPr4WY-uIbvzVLXieFND0UU,1074
34
- berryworld-1.0.0.182021.dist-info/METADATA,sha256=YN3SCClrxT9KZJDqlCE5v29ESv7EaUK11rZVuUdAcdM,1174
35
- berryworld-1.0.0.182021.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
36
- berryworld-1.0.0.182021.dist-info/top_level.txt,sha256=GIZ5qy-P5oxfEH755vA1IMFeTVdX3-40JxMe6nOe5I8,17
37
- berryworld-1.0.0.182021.dist-info/RECORD,,
33
+ berryworld-1.0.0.182201.dist-info/LICENSE,sha256=vtkVCJM6E2af2gnsi2XxKPr4WY-uIbvzVLXieFND0UU,1074
34
+ berryworld-1.0.0.182201.dist-info/METADATA,sha256=VRsEyHlygbfCuucfi6EvdU_kqJPTIiV45Xv-JShyTBE,1174
35
+ berryworld-1.0.0.182201.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
36
+ berryworld-1.0.0.182201.dist-info/top_level.txt,sha256=GIZ5qy-P5oxfEH755vA1IMFeTVdX3-40JxMe6nOe5I8,17
37
+ berryworld-1.0.0.182201.dist-info/RECORD,,