pysdmx 1.5.0__py3-none-any.whl → 1.5.2__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.
pysdmx/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  """Your opinionated Python SDMX library."""
2
2
 
3
- __version__ = "1.5.0"
3
+ __version__ = "1.5.2"
@@ -13,9 +13,11 @@ from httpx import HTTPStatusError, create_ssl_context
13
13
 
14
14
  from pysdmx.errors import Invalid, NotImplemented
15
15
  from pysdmx.io.format import Format
16
- from pysdmx.io.xml.__parse_xml import SCHEMA_ROOT_31
17
16
  from pysdmx.util import map_httpx_errors
18
17
 
18
+ SCHEMA_ROOT_31 = "http://www.sdmx.org/resources/sdmxml/schemas/v3_1/"
19
+ SCHEMA_ROOT_30 = "http://www.sdmx.org/resources/sdmxml/schemas/v3_0/"
20
+
19
21
 
20
22
  def __remove_bom(input_string: str) -> str:
21
23
  return input_string.replace("\ufeff", "")
@@ -55,8 +57,6 @@ def __get_sdmx_ml_flavour(input_str: str) -> Tuple[str, Format]:
55
57
  flavour_check = input_str[:1000].lower()
56
58
  if ":generic" in flavour_check:
57
59
  return input_str, Format.DATA_SDMX_ML_2_1_GEN
58
- # Local import to ensure xml extra is checked at the latest moment
59
- from pysdmx.io.xml.__parse_xml import SCHEMA_ROOT_30
60
60
 
61
61
  if ":structurespecificdata" in flavour_check:
62
62
  if SCHEMA_ROOT_30 in flavour_check:
@@ -170,7 +170,7 @@ from pysdmx.model.dataflow import (
170
170
  Components,
171
171
  Dataflow,
172
172
  DataStructureDefinition,
173
- GroupDimension,
173
+ Group,
174
174
  Role,
175
175
  )
176
176
  from pysdmx.model.vtl import (
@@ -955,7 +955,7 @@ class StructureParser(Struct):
955
955
  for d in group_dimensions
956
956
  ]
957
957
 
958
- element[GROUPS_LOW] = [GroupDimension(**g) for g in groups]
958
+ element[GROUPS_LOW] = [Group(**g) for g in groups]
959
959
  del element[DSD_COMPS][GROUP]
960
960
  return element
961
961
 
@@ -124,7 +124,7 @@ from pysdmx.model.dataflow import (
124
124
  Component,
125
125
  Dataflow,
126
126
  DataStructureDefinition,
127
- GroupDimension,
127
+ Group,
128
128
  Role,
129
129
  )
130
130
  from pysdmx.util import (
@@ -392,7 +392,7 @@ def __write_item(
392
392
 
393
393
 
394
394
  def __write_groups(
395
- groups: list[GroupDimension], indent: str, references_30: bool = False
395
+ groups: list[Group], indent: str, references_30: bool = False
396
396
  ) -> str:
397
397
  out_file = ""
398
398
  for group in groups:
@@ -487,7 +487,7 @@ def __write_components( # noqa: C901
487
487
 
488
488
 
489
489
  def __find_matching_group_id(
490
- att_rel: str, groups: list[GroupDimension]
490
+ att_rel: str, groups: list[Group]
491
491
  ) -> Optional[str]:
492
492
  comps_to_relate = att_rel.split(",") if "," in att_rel else [att_rel]
493
493
  for group in groups:
@@ -519,7 +519,7 @@ def __write_attribute_relation( # noqa: C901
519
519
  item: Component,
520
520
  indent: str,
521
521
  component_info: Dict[str, Any],
522
- groups: list[GroupDimension],
522
+ groups: list[Group],
523
523
  references_30: bool = False,
524
524
  ) -> str:
525
525
  measure_relationship = ""
@@ -599,7 +599,7 @@ def __write_component(
599
599
  position: int,
600
600
  indent: str,
601
601
  component_info: Dict[str, Any],
602
- groups: list[GroupDimension],
602
+ groups: list[Group],
603
603
  references_30: bool = False,
604
604
  ) -> str:
605
605
  """Writes the component to the XML file."""
pysdmx/model/dataflow.py CHANGED
@@ -232,7 +232,7 @@ class Component(
232
232
  return f"{self.__class__.__name__}({', '.join(attrs)})"
233
233
 
234
234
 
235
- class GroupDimension(
235
+ class Group(
236
236
  IdentifiableArtefact, frozen=True, omit_defaults=True, kw_only=True
237
237
  ):
238
238
  """A group of dimensions that can be used to identify a group."""
@@ -472,7 +472,7 @@ class Schema(Struct, frozen=True, omit_defaults=True, repr_omit_defaults=True):
472
472
  version: str = "1.0"
473
473
  artefacts: Sequence[str] = ()
474
474
  generated: datetime = datetime.now(timezone.utc)
475
- groups: Optional[Sequence[GroupDimension]] = None
475
+ groups: Optional[Sequence[Group]] = None
476
476
 
477
477
  def __str__(self) -> str:
478
478
  """Custom string representation without the class name."""
@@ -538,7 +538,7 @@ class DataStructureDefinition(MaintainableArtefact, frozen=True, kw_only=True):
538
538
  """
539
539
 
540
540
  components: Components
541
- groups: Optional[Sequence[GroupDimension]] = None
541
+ groups: Optional[Sequence[Group]] = None
542
542
  evolving_structure: bool = False
543
543
 
544
544
  def __extract_artefacts(self) -> Sequence[str]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pysdmx
3
- Version: 1.5.0
3
+ Version: 1.5.2
4
4
  Summary: Your opinionated Python SDMX library
5
5
  License: Apache-2.0
6
6
  Keywords: sdmx,data discovery,data retrieval,metadata,fmr
@@ -1,5 +1,5 @@
1
1
  pysdmx/__extras_check.py,sha256=I39OaM1lAPBnyzHVJ7kA_ZA_tMeDAQLr6ZKqEQ9MK1Q,1659
2
- pysdmx/__init__.py,sha256=5z10nwG-grwF4ljX4qnTW3mCl2fdff-9iqmtKljWHL0,67
2
+ pysdmx/__init__.py,sha256=lCxIWAalK5owRQR4jCgDW0NekksEmfHD_f-6xsEa4gM,67
3
3
  pysdmx/api/__init__.py,sha256=8lRaF6kEO51ehl0fmW_pHLvkN_34TtEhqhr3oKo6E6g,26
4
4
  pysdmx/api/dc/__init__.py,sha256=oPU32X8CRZy4T1to9mO5KMqMwxQsVI424dPqai-I8zI,121
5
5
  pysdmx/api/dc/_api.py,sha256=poy1FYFXnF6maBGy5lpOodf32-7QQjH8PCBNDkuOXxQ,7747
@@ -32,7 +32,7 @@ pysdmx/io/csv/sdmx20/__init__.py,sha256=mNfMJKSpmMfk4CbbHhjnBOTQ2IZFY15cNUhHtJPc
32
32
  pysdmx/io/csv/sdmx20/reader/__init__.py,sha256=HSSUE3iL9g2Bzb_vKw97-Uw_3H3yUQxN8ssAyr1EJkI,4925
33
33
  pysdmx/io/csv/sdmx20/writer/__init__.py,sha256=xqNg2L2BdCkKVIkMrBpkbR6wq2gZ3r1K7oZRkZ1aBoU,2062
34
34
  pysdmx/io/format.py,sha256=BJghvHaXNvsfqJCWvB8jhjGMaLPv7zi7N12O0qRwChc,4749
35
- pysdmx/io/input_processor.py,sha256=MALwyWI26KoxIlRARgIsXxHvEHH9tZ9TTHExtYAPCk8,6406
35
+ pysdmx/io/input_processor.py,sha256=KJPWOumYqjoewetbFQ4qzqDqOC6hpcksaThvLp_Y7Oc,6366
36
36
  pysdmx/io/json/fusion/messages/__init__.py,sha256=C0LAG6UfIZcQdlCv5d_D1ZNIcCq04RxZYLAp6tLDqwY,1573
37
37
  pysdmx/io/json/fusion/messages/category.py,sha256=E9jrzXenEpqDNUhT1JJLYxty37PSGegRtx45mB3-COg,4589
38
38
  pysdmx/io/json/fusion/messages/code.py,sha256=kB3RJiSA75G4IJYObYR0hdiXYcRs-vNMKqUeA6F4SSo,7529
@@ -81,8 +81,8 @@ pysdmx/io/xml/__data_aux.py,sha256=ztivjZANN1PJ63IvoMfx-5TA2AiPQTVPC_0YYHOT9Ns,4
81
81
  pysdmx/io/xml/__init__.py,sha256=tcUsSEiM3nBA7lDbZPwGZ7Vu_K9gQd8oliASUMTGjFE,105
82
82
  pysdmx/io/xml/__parse_xml.py,sha256=SITC7Yptq_qY_exetRez90lJCukH1WsKDMqlk7Q1RaY,2899
83
83
  pysdmx/io/xml/__ss_aux_reader.py,sha256=Tfp7oSb_0-AVEVdu7YFtj-SlBuEKp7fpg3-SxCmOHW0,2868
84
- pysdmx/io/xml/__structure_aux_reader.py,sha256=guK6hEi2TN-6csc6JMeXbW4JDHKA6pKy6GoFzQ6FNJE,40276
85
- pysdmx/io/xml/__structure_aux_writer.py,sha256=mXsURMFJuaku6Ac-7nWOrerxfPfTVtQxzBwjRgZeQu8,43588
84
+ pysdmx/io/xml/__structure_aux_reader.py,sha256=dGPmAiW4j38fbsAJ8xCDwXgUcwpOCwgO5jQpvgoKD4Q,40258
85
+ pysdmx/io/xml/__structure_aux_writer.py,sha256=9x2wGYRP9vPGLlHA-3P5Xr3gY5g3gW5fmz0tDQJyH4U,43543
86
86
  pysdmx/io/xml/__tokens.py,sha256=Y_SlFWYIXolsgjHoFq7pm3TYlEu07CR9TmJKk2jHfQ0,6823
87
87
  pysdmx/io/xml/__write_aux.py,sha256=KHZxEhGSjZPRW93OvniZ0kHmiAJtKJu-2aLtMhsKt90,15396
88
88
  pysdmx/io/xml/__write_data_aux.py,sha256=DlFwR1KmVMJmwID_G7Tl9zasah9iiQKHuuHKJpd0huk,5052
@@ -122,7 +122,7 @@ pysdmx/model/__init__.py,sha256=gmY8uGK0_SK9Ca5TqtYJqPSXvO9godlDKu2rhYouPSU,4984
122
122
  pysdmx/model/category.py,sha256=WWWysaTdlcU8KZpQyZgbZkrOelNVCGOfVUk_APJxm-w,6031
123
123
  pysdmx/model/code.py,sha256=KEG2D74UHbZuOplSrztLWCNTzFTOg22imRe_eQvqAM8,12600
124
124
  pysdmx/model/concept.py,sha256=mQfqJdtWc10WdTKX_Mw7Znw65cN3QO-kCar9MWYeWO4,9645
125
- pysdmx/model/dataflow.py,sha256=9SgbQ9n2j5N_TqvN9eQtshL4Lom4kDnapP97cREP-e4,22999
125
+ pysdmx/model/dataflow.py,sha256=gcpPJnyl0FI4mtk52VvPsPU4msFw67AiM0MaV1nsyiE,22972
126
126
  pysdmx/model/dataset.py,sha256=Lbr7tYonGHD3NZUD-M9hK2puaEAluOVPG2DbkOohzMM,4861
127
127
  pysdmx/model/gds.py,sha256=QrnmI8Hn--C95gGXCeUeWwhn-Ur7DuT08Cg7oPJIEVI,4976
128
128
  pysdmx/model/map.py,sha256=IYoxKYpt0-9kYAgU24wryrSchR-lrc3NMacI5Vt5las,17213
@@ -142,7 +142,7 @@ pysdmx/util/__init__.py,sha256=m_XWRAmVJ7F6ai4Ckrj_YuPbhg3cJZAXeZrEThrL88k,3997
142
142
  pysdmx/util/_date_pattern_map.py,sha256=IS1qONwVHbTBNIFCT0Rqbijj2a9mYvs7onXSK6GeQAQ,1620
143
143
  pysdmx/util/_model_utils.py,sha256=d0XY8cnxvviQtkJJInVik7LWeuqX-eb4-zikFortL58,2335
144
144
  pysdmx/util/_net_utils.py,sha256=nOTz_x3FgFrwKh42_J70IqYXz9duQkMFJWtejZXcLHs,1326
145
- pysdmx-1.5.0.dist-info/LICENSE,sha256=3XTNDPtv2RxDUNkQzn9MIWit2u7_Ob5daMLEq-4pBJs,649
146
- pysdmx-1.5.0.dist-info/METADATA,sha256=K7v8g6s1ooDheCBRC4DaAg68MA3mixhIGlw3cnAP2gc,4690
147
- pysdmx-1.5.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
148
- pysdmx-1.5.0.dist-info/RECORD,,
145
+ pysdmx-1.5.2.dist-info/LICENSE,sha256=3XTNDPtv2RxDUNkQzn9MIWit2u7_Ob5daMLEq-4pBJs,649
146
+ pysdmx-1.5.2.dist-info/METADATA,sha256=hHjNyQNC0uUh9cF40kLB4LBRnPRXJ3vqU3iu-BVRbvs,4690
147
+ pysdmx-1.5.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
148
+ pysdmx-1.5.2.dist-info/RECORD,,
File without changes