eba-xbridge 1.5.0rc6__py3-none-any.whl → 1.5.0rc8__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.0rc6
3
+ Version: 1.5.0rc8
4
4
  Summary: XBRL-XML to XBRL-CSV converter for EBA Taxonomy (version 4.1)
5
5
  License: Apache 2.0
6
6
  License-File: LICENSE
@@ -1,9 +1,9 @@
1
- xbridge/__init__.py,sha256=OJUYuCUHGkgWxo9tS6dntxUteSpYkfqo5Weaad1X56M,68
1
+ xbridge/__init__.py,sha256=bFBeZzJmb7vxo06K1P7xQmr2QUN0_3RI_N_ULbMdE-E,68
2
2
  xbridge/__main__.py,sha256=trtFEv7TRJgrLL84leIapPvgC_iVTj05qLHRRS1Olts,2219
3
3
  xbridge/api.py,sha256=NCBz7VRJWE3gID6ndgL4Awoxw0w1yMIIf_OTLRuZyyQ,1559
4
- xbridge/converter.py,sha256=BgmJY06yuB9aLVhcf8OvVZphbQYP3w66RKi3ViZ3LDA,24571
5
- xbridge/exceptions.py,sha256=C9fjO8nUGVL376qiyQ1vAozafCWP4OfIbuujpXtNPeQ,1002
6
- xbridge/instance.py,sha256=8cCGKxgtmdP9-1c2Nz4TdhsXw5dtRrykwp9rAXD4-Ew,32863
4
+ xbridge/converter.py,sha256=wLBm2QjxmGh_PdTDHExnoQw2WXixYlPpns1ViB4yG_I,24665
5
+ xbridge/exceptions.py,sha256=v219QGAjcO4--7wS0bBRtm2TdccX9RhExV7gAhnEfgE,1285
6
+ xbridge/instance.py,sha256=6Mv-g4lWfCoyEs5nbZaiTdIXJJSEKB1Do5KP3go_Ag0,33775
7
7
  xbridge/modules/ae_ae_4.2.json,sha256=AdFvwZqX0KVP3jF1iHeQc5QSnSMvvT3GvoA2G1AgXis,460165
8
8
  xbridge/modules/ae_con_cir-680-2014_2017-04-04.json,sha256=4n0t9dKJNU8Nb5QHpssrDs8ZLwzI-Mw75ax-ar9pLu0,363273
9
9
  xbridge/modules/ae_con_cir-680-2014_2018-03-31.json,sha256=aVWeLLs20p39kQQUthUzqrxBGKTycqhgX9WLk1rVlNw,363538
@@ -384,8 +384,8 @@ xbridge/modules/sepa_ipr_pay_4.2.json,sha256=JLJvR02LOAJy6SWPRuhV1TT02oXQhsG83FB
384
384
  xbridge/modules.py,sha256=bTvBXtp3w4Gad2DpEQE7Hb-UfuUQLlRl8gywRstQtpU,22399
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.0rc6.dist-info/METADATA,sha256=1lyxX7bu8C3L0XVF1yEjEUMSRiyIgEL-ncJFr41uzw8,12053
388
- eba_xbridge-1.5.0rc6.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
389
- eba_xbridge-1.5.0rc6.dist-info/entry_points.txt,sha256=FATct4icSewM04cegjhybtm7xcQWhaSahL-DTtuFdZw,49
390
- eba_xbridge-1.5.0rc6.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
391
- eba_xbridge-1.5.0rc6.dist-info/RECORD,,
387
+ eba_xbridge-1.5.0rc8.dist-info/METADATA,sha256=gWVIH8Jq1Dzy9FNne0fRb5SfGh52xvkVDhlDW8W_bSc,12053
388
+ eba_xbridge-1.5.0rc8.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
389
+ eba_xbridge-1.5.0rc8.dist-info/entry_points.txt,sha256=FATct4icSewM04cegjhybtm7xcQWhaSahL-DTtuFdZw,49
390
+ eba_xbridge-1.5.0rc8.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
391
+ eba_xbridge-1.5.0rc8.dist-info/RECORD,,
xbridge/__init__.py CHANGED
@@ -2,4 +2,4 @@
2
2
  Init file for eba-xbridge library
3
3
  """
4
4
 
5
- __version__ = "1.5.0rc6"
5
+ __version__ = "1.5.0rc8"
xbridge/converter.py CHANGED
@@ -15,7 +15,11 @@ from zipfile import ZipFile
15
15
 
16
16
  import pandas as pd
17
17
 
18
- from xbridge.exceptions import DecimalValueError, FilingIndicatorWarning
18
+ from xbridge.exceptions import (
19
+ DecimalValueError,
20
+ FilingIndicatorValueError,
21
+ FilingIndicatorWarning,
22
+ )
19
23
  from xbridge.instance import CsvInstance, Instance, XmlInstance
20
24
  from xbridge.modules import Module, Table
21
25
 
@@ -513,7 +517,7 @@ class Converter:
513
517
  """Validate that no facts are orphaned (belong only to non-reported tables).
514
518
 
515
519
  Raises:
516
- ValueError: If facts exist that belong only to tables with filed=false
520
+ FilingIndicatorValueError: If facts exist that belong only to tables with filed=false
517
521
  """
518
522
  if self.instance.instance_df is None or self.instance.instance_df.empty:
519
523
  return
@@ -561,7 +565,7 @@ class Converter:
561
565
  "Either set filed=true for the relevant tables "
562
566
  "or remove these facts from the XML."
563
567
  )
564
- raise ValueError(error_msg)
568
+ raise FilingIndicatorValueError(error_msg, orphaned_per_table)
565
569
  error_msg += (
566
570
  "\nThese facts will be excluded from the output. "
567
571
  "Consider setting filed=true for the relevant tables "
xbridge/exceptions.py CHANGED
@@ -21,6 +21,14 @@ class DecimalValueError(ValueError):
21
21
  self.offending_value = offending_value
22
22
 
23
23
 
24
+ class FilingIndicatorValueError(ValueError):
25
+ """Raised when filing indicator validation fails."""
26
+
27
+ def __init__(self, error_message: str, offending_value: Optional[Any] = None) -> None:
28
+ super().__init__(error_message)
29
+ self.offending_value = offending_value
30
+
31
+
24
32
  class XbridgeWarning(Warning):
25
33
  """Base warning for the xbridge library."""
26
34
 
xbridge/instance.py CHANGED
@@ -13,7 +13,11 @@ from zipfile import ZipFile
13
13
  import pandas as pd
14
14
  from lxml import etree
15
15
 
16
- from xbridge.exceptions import IdentifierPrefixWarning, SchemaRefValueError
16
+ from xbridge.exceptions import (
17
+ FilingIndicatorValueError,
18
+ IdentifierPrefixWarning,
19
+ SchemaRefValueError,
20
+ )
17
21
 
18
22
  # Cache namespace → CSV prefix derivations to avoid repeated string work during parse
19
23
  _namespace_prefix_cache: Dict[str, str] = {}
@@ -341,6 +345,10 @@ class Instance:
341
345
  self.get_filing_indicators()
342
346
  except etree.XMLSyntaxError:
343
347
  raise ValueError("Invalid XML format")
348
+ except SchemaRefValueError:
349
+ raise # Let SchemaRefValueError propagate as-is
350
+ except FilingIndicatorValueError:
351
+ raise # Let FilingIndicatorValueError propagate as-is
344
352
  except Exception as e:
345
353
  raise ValueError(f"Error parsing instance: {str(e)}")
346
354
 
@@ -651,6 +659,10 @@ class XmlInstance(Instance):
651
659
  self.get_filing_indicators()
652
660
  except etree.XMLSyntaxError:
653
661
  raise ValueError("Invalid XML format")
662
+ except SchemaRefValueError:
663
+ raise # Let SchemaRefValueError propagate as-is
664
+ except FilingIndicatorValueError:
665
+ raise # Let FilingIndicatorValueError propagate as-is
654
666
  except Exception as e:
655
667
  raise ValueError(f"Error parsing instance: {str(e)}")
656
668
 
@@ -856,12 +868,22 @@ class FilingIndicator:
856
868
  self.parse()
857
869
 
858
870
  def parse(self) -> None:
859
- """Parse the XML node with the filing indicator."""
871
+ """Parse the XML node with the filing indicator.
872
+
873
+ Raises:
874
+ FilingIndicatorValueError: If the filed attribute is not "true", "false", "0", or "1"
875
+ """
860
876
  value = self.filing_indicator_xml.attrib.get(
861
877
  "{http://www.eurofiling.info/xbrl/ext/filing-indicators}filed"
862
878
  )
863
879
  if value:
864
- self.value = value == "true"
880
+ if value not in ("true", "false", "0", "1"):
881
+ raise FilingIndicatorValueError(
882
+ f"Invalid filing indicator value: '{value}'. "
883
+ f"The 'filed' attribute must be either 'true', 'false', '0', or '1'.",
884
+ offending_value=value,
885
+ )
886
+ self.value = value in ("true", "1")
865
887
  else:
866
888
  self.value = True
867
889
  self.table = self.filing_indicator_xml.text