PYield 0.2.12__tar.gz → 0.2.13__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PYield
3
- Version: 0.2.12
3
+ Version: 0.2.13
4
4
  Summary: A Python library for analysis of fixed income instruments in Brazil
5
5
  Keywords: fixed-income, brazil, finance, analysis, bonds
6
6
  Author-Email: Carlos Carvalho <cr.cj@outlook.com>
@@ -0,0 +1 @@
1
+ __version__ = "0.2.13"
@@ -34,14 +34,19 @@ def extract_xml_file(zip_file: io.BytesIO) -> io.BytesIO:
34
34
 
35
35
  # Then, read the inner file
36
36
  with zipfile.ZipFile(outer_file, "r") as inner_zip:
37
- inner_file_name = inner_zip.namelist()[0]
38
- inner_file_content = inner_zip.read(inner_file_name)
37
+ filenames = inner_zip.namelist()
38
+ # Get first file that ends with ".xml"
39
+ xml_filename = [name for name in filenames if name.endswith(".xml")][0]
40
+ inner_file_content = inner_zip.read(xml_filename)
39
41
 
40
42
  return io.BytesIO(inner_file_content)
41
43
 
42
44
 
43
45
  def parse_xml_file(xml_file: io.BytesIO) -> list:
44
- tree = etree.parse(xml_file)
46
+ parser = etree.XMLParser(
47
+ ns_clean=True, remove_blank_text=True, remove_comments=True, recover=True
48
+ )
49
+ tree = etree.parse(xml_file, parser)
45
50
  # Definir os namespaces (substitua 'ns' pelo prefixo apropriado se necessário)
46
51
  namespaces = {"ns": "urn:bvmf.217.01.xsd"}
47
52
 
@@ -31,7 +31,7 @@ dependencies = [
31
31
  "lxml",
32
32
  ]
33
33
  dynamic = []
34
- version = "0.2.12"
34
+ version = "0.2.13"
35
35
 
36
36
  [project.license]
37
37
  file = "LICENSE"
@@ -1 +0,0 @@
1
- __version__ = "0.2.12"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes