berryworld 1.0.0.196257__py3-none-any.whl → 1.0.0.196646__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/handy_mix.py CHANGED
@@ -226,39 +226,15 @@ class HandyMix:
226
226
  :param data: DataFrame to transform its integer columns to strings
227
227
  :return: DataFrame with its columns translated to strings
228
228
  """
229
- float_cols = data.columns[data.dtypes == 'float']
230
- for float_col in float_cols:
231
- if data[float_col].dtype == float:
232
- if all(['.0' in val for val in data[float_col].loc[~data[float_col].isnull()].astype(str).values]):
233
- data.loc[~data[float_col].isnull(), float_col] = data.loc[
234
- ~data[float_col].isnull(), float_col].astype(str).str.replace(
235
- '.0', '', regex=True).infer_objects(copy=False)
236
-
237
- return data
238
-
239
-
240
- class URLResolver:
241
- @staticmethod
242
- def resolve_url_requested(url_requested, endpoint_requested):
243
- """Resolve the URL requested.
244
- :param url_requested: The base url that includes the project root
245
- :param endpoint_requested: The endpoint that will be added to the base url
246
- """
247
- url_requested = str(url_requested)
248
- endpoint_requested = str(endpoint_requested)
249
-
250
- domains = ["berryworld.com", "berryworld.net"]
229
+ float_cols = data.select_dtypes(include=['float']).columns
251
230
 
252
- for domain in domains:
253
- if domain in url_requested:
254
- if url_requested.endswith('/'):
255
- url_requested = url_requested.rstrip('/')
231
+ for float_col in float_cols:
232
+ mask = ~data[float_col].isnull()
233
+ values = data.loc[mask, float_col]
256
234
 
257
- path_after_domain = ''
258
- if domain in endpoint_requested:
259
- path_after_domain = endpoint_requested.split(f"{domain}", 1)[-1]
235
+ data[float_col] = data[float_col].astype(object)
260
236
 
261
- url_requested = f"{url_requested}{path_after_domain}"
262
- break
237
+ if ((values % 1) == 0).all():
238
+ data.loc[mask, float_col] = values.astype(int).astype(str)
263
239
 
264
- return url_requested
240
+ return data
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: berryworld
3
- Version: 1.0.0.196257
3
+ Version: 1.0.0.196646
4
4
  Summary: Handy classes to improve ETL processes
5
5
  Home-page: https://www.berryworld.com
6
6
  Author: BerryWorld ltd
@@ -9,7 +9,7 @@ berryworld/devops.py,sha256=7mRbyZPGzk5ox-6J2etv3NxCcfP4cprG0_Xelh7prn8,9776
9
9
  berryworld/email_con.py,sha256=CVyEDVnc_iVeRTwJgIU31ToFgyix7L2yn4Ih9Wu7I5s,15806
10
10
  berryworld/email_logging.py,sha256=LeSrTExhQhar49gJR2wGC1dS0lqsNpFl9pS3eYWqnuo,4936
11
11
  berryworld/generate_env.py,sha256=kJuBb0OOYjoa2gyAnZHgn3gpoEZ8rPbMhnKcTYfENUk,11875
12
- berryworld/handy_mix.py,sha256=dN33Pya8fh5YBR6jSDsxbAle8rKpPYebMbasf6kcaZ4,10734
12
+ berryworld/handy_mix.py,sha256=SqJ3UjIjmIOgjbp-_1eyKQJ3OJLN7OfpDQIASvjNZ_Q,9672
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
@@ -26,12 +26,12 @@ berryworld/verify_keys.py,sha256=X7VUHqYDklWPDO0bGVHIOXeLq5Qi4fZRZbHYw5x7UnA,435
26
26
  berryworld/vivantio.py,sha256=QfZo0UKqkzVRg_LyiwivNd3aEup4TH57x4KxLZkCJwc,10627
27
27
  berryworld/vivantio_logging.py,sha256=ciy7gA4u3FrgUIpEBnMgocbNPp6jcu9TPoy-kLcrTZU,5736
28
28
  berryworld/xml_parser.py,sha256=HWD71NaTN3DaIOGT6Wzxs4CEsroFhGQwe9iPLIL80Co,957
29
- berryworld-1.0.0.196257.dist-info/licenses/LICENSE,sha256=vtkVCJM6E2af2gnsi2XxKPr4WY-uIbvzVLXieFND0UU,1074
29
+ berryworld-1.0.0.196646.dist-info/licenses/LICENSE,sha256=vtkVCJM6E2af2gnsi2XxKPr4WY-uIbvzVLXieFND0UU,1074
30
30
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
31
  tests/test_allocation_config.py,sha256=e12l6fE9U57eSPS35g6ekJ_hol7-RHg89JV60_m1BlE,4633
32
32
  tests/test_handy_mix_config.py,sha256=Un56mz9KJmdn4K4OwzHAHLSRzDU1Xv2nFrONNuzOG04,2594
33
33
  tests/test_xml_parser.py,sha256=3QTlhFEd6KbK6nRFKZnc35tad6wqukTbe4QrFi8mr_8,859
34
- berryworld-1.0.0.196257.dist-info/METADATA,sha256=ZXmujcDreqDhz8QvyNP0MwAcrl_0I6vWhATexM5_eJg,1445
35
- berryworld-1.0.0.196257.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
36
- berryworld-1.0.0.196257.dist-info/top_level.txt,sha256=GIZ5qy-P5oxfEH755vA1IMFeTVdX3-40JxMe6nOe5I8,17
37
- berryworld-1.0.0.196257.dist-info/RECORD,,
34
+ berryworld-1.0.0.196646.dist-info/METADATA,sha256=vhie3997slP6IMtdOSo1W4-5A07_aiytRm0NJSq1Ihs,1445
35
+ berryworld-1.0.0.196646.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
36
+ berryworld-1.0.0.196646.dist-info/top_level.txt,sha256=GIZ5qy-P5oxfEH755vA1IMFeTVdX3-40JxMe6nOe5I8,17
37
+ berryworld-1.0.0.196646.dist-info/RECORD,,