eba-xbridge 1.5.1rc1__py3-none-any.whl → 1.5.1rc2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eba-xbridge
3
- Version: 1.5.1rc1
3
+ Version: 1.5.1rc2
4
4
  Summary: XBRL-XML to XBRL-CSV converter for EBA Taxonomy (version 4.2)
5
5
  License: Apache 2.0
6
6
  License-File: LICENSE
@@ -1,7 +1,7 @@
1
- xbridge/__init__.py,sha256=lDiMxA5rScYVsUoiKha4kwV8z6Amiu7d97XX0B_-bN8,68
1
+ xbridge/__init__.py,sha256=g-41YqPxdxmSKCDBU24bb3lddhqDST3YwbfrZVly_Co,68
2
2
  xbridge/__main__.py,sha256=trtFEv7TRJgrLL84leIapPvgC_iVTj05qLHRRS1Olts,2219
3
3
  xbridge/api.py,sha256=NCBz7VRJWE3gID6ndgL4Awoxw0w1yMIIf_OTLRuZyyQ,1559
4
- xbridge/converter.py,sha256=wLBm2QjxmGh_PdTDHExnoQw2WXixYlPpns1ViB4yG_I,24665
4
+ xbridge/converter.py,sha256=ZZFi_yqYjgJvslJ45XD8Srgz7gsBucMVp24uh_qfBA0,24986
5
5
  xbridge/exceptions.py,sha256=v219QGAjcO4--7wS0bBRtm2TdccX9RhExV7gAhnEfgE,1285
6
6
  xbridge/instance.py,sha256=6Mv-g4lWfCoyEs5nbZaiTdIXJJSEKB1Do5KP3go_Ag0,33775
7
7
  xbridge/modules/ae_ae_4.2.json,sha256=Ee2xY5H-0i3CaFhXjG6-Cf2xH9qH1gbHEKdzdwyjQSw,460878
@@ -381,11 +381,11 @@ xbridge/modules/sbpimv_ind_its-2016-svbxx_2016-02-01.json,sha256=Kffht2pKVT4fk0H
381
381
  xbridge/modules/sbpimv_sbp_4.2.json,sha256=4UwlStgVYq3j4KCbR6dCfiLHhZkzbQLVySmWuMYIHtQ,7150
382
382
  xbridge/modules/sepa_ipr_pay_4.1.json,sha256=I4SA_wz3HtmGZoaX1JzfYD52Kzix4qB8dnFQ7VSk0Go,27240
383
383
  xbridge/modules/sepa_ipr_pay_4.2.json,sha256=0NItBVtcZXL81Uipn1iflGyCaLHULT4it8kzHr9c2as,27928
384
- xbridge/modules.py,sha256=SjlgjD_Hb6vApWVJahYKcK6VlIBpth60X9VJ5hjwlJY,23130
384
+ xbridge/modules.py,sha256=M0WeKw4n2F3H9-o64off0RLiUz8DdIardUUJQZ1K2ck,23423
385
385
  xbridge/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
386
386
  xbridge/taxonomy_loader.py,sha256=K0lnJVryvkKsaoK3fMis-L2JpmwLO6z3Ruq3yj9FxDY,9317
387
- eba_xbridge-1.5.1rc1.dist-info/METADATA,sha256=9nlvvdsckZU2cs7fvuq43ugHUMBwFStlm2DSZ5FMDkI,12082
388
- eba_xbridge-1.5.1rc1.dist-info/WHEEL,sha256=3ny-bZhpXrU6vSQ1UPG34FoxZBp3lVcvK0LkgUz6VLk,88
389
- eba_xbridge-1.5.1rc1.dist-info/entry_points.txt,sha256=FATct4icSewM04cegjhybtm7xcQWhaSahL-DTtuFdZw,49
390
- eba_xbridge-1.5.1rc1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
391
- eba_xbridge-1.5.1rc1.dist-info/RECORD,,
387
+ eba_xbridge-1.5.1rc2.dist-info/METADATA,sha256=XJiZoeridbffNUBPUAbabnmh0dKUQ4S3V8U4u68hNxU,12082
388
+ eba_xbridge-1.5.1rc2.dist-info/WHEEL,sha256=kJCRJT_g0adfAJzTx2GUMmS80rTJIVHRCfG0DQgLq3o,88
389
+ eba_xbridge-1.5.1rc2.dist-info/entry_points.txt,sha256=FATct4icSewM04cegjhybtm7xcQWhaSahL-DTtuFdZw,49
390
+ eba_xbridge-1.5.1rc2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
391
+ eba_xbridge-1.5.1rc2.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.3.0
2
+ Generator: poetry-core 2.3.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
xbridge/__init__.py CHANGED
@@ -2,4 +2,4 @@
2
2
  Init file for eba-xbridge library
3
3
  """
4
4
 
5
- __version__ = "1.5.1rc1"
5
+ __version__ = "1.5.1rc2"
xbridge/converter.py CHANGED
@@ -407,6 +407,12 @@ class Converter:
407
407
  if "allowed_values" in table_df.columns:
408
408
  drop_columns.append("allowed_values")
409
409
 
410
+ # Clear unit for rows where variable didn't have unit in dimensions
411
+ if "_has_unit_dim" in table_df.columns:
412
+ if "unit" in table.attributes and "unit" in table_df.columns:
413
+ table_df.loc[~table_df["_has_unit_dim"], "unit"] = pd.NA
414
+ drop_columns.append("_has_unit_dim")
415
+
410
416
  table_df.drop(columns=drop_columns, inplace=True)
411
417
 
412
418
  # Drop the datapoints that have null values in the open keys
xbridge/modules.py CHANGED
@@ -279,6 +279,7 @@ class Table:
279
279
  cols.discard("datapoint")
280
280
  cols.discard("data_type")
281
281
  cols.discard("allowed_values")
282
+ cols.discard("_has_unit_dim")
282
283
  return cols
283
284
 
284
285
  @property
@@ -314,6 +315,7 @@ class Table:
314
315
  if self.architecture == "datapoints":
315
316
  for variable in self.variables:
316
317
  variable_info: dict[str, Any] = {}
318
+ has_unit_dim = "unit" in variable.dimensions
317
319
  for dim_k, dim_v in variable.dimensions.items():
318
320
  if dim_k not in ("unit", "decimals"):
319
321
  variable_info[dim_k] = dim_v
@@ -327,10 +329,12 @@ class Table:
327
329
  variable_info["datapoint"] = variable.code
328
330
  variable_info["data_type"] = variable._attributes
329
331
  variable_info["allowed_values"] = variable._allowed_values
332
+ variable_info["_has_unit_dim"] = has_unit_dim
330
333
  variables.append(copy.copy(variable_info))
331
334
  elif self.architecture == "headers":
332
335
  for column in self.columns:
333
336
  variable_info = {"datapoint": column["variable_id"]}
337
+ has_unit_dim = "unit" in column.get("dimensions", {})
334
338
  if "dimensions" in column:
335
339
  for dim_k, dim_v in column["dimensions"].items():
336
340
  if dim_k == "concept":
@@ -342,6 +346,7 @@ class Table:
342
346
 
343
347
  if "decimals" in column:
344
348
  variable_info["data_type"] = column["decimals"]
349
+ variable_info["_has_unit_dim"] = has_unit_dim
345
350
  variables.append(copy.copy(variable_info))
346
351
 
347
352
  self._variable_df = pd.DataFrame(variables)