sdmxlib 0.74.0__tar.gz → 0.76.0__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.
Files changed (184) hide show
  1. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/PKG-INFO +3 -2
  2. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/pyproject.toml +5 -3
  3. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/pyproject.toml.orig +15 -9
  4. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/__init__.py +6 -1
  5. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/api/client.py +33 -33
  6. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/api/federated.py +11 -9
  7. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/api/policy.py +1 -1
  8. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/api/registry.py +41 -16
  9. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/api/session.py +26 -3
  10. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/builders/contentconstraint.py +56 -6
  11. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/bundle/__init__.py +13 -6
  12. sdmxlib-0.76.0/src/sdmxlib/bundle/_availability.py +116 -0
  13. sdmxlib-0.76.0/src/sdmxlib/bundle/_build.py +330 -0
  14. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/bundle/_check.py +273 -33
  15. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/bundle/_copy.py +49 -2
  16. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/bundle/_fetch.py +30 -43
  17. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/bundle/_fingerprint.py +19 -6
  18. sdmxlib-0.76.0/src/sdmxlib/bundle/_remote.py +130 -0
  19. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/bundle/_write.py +123 -69
  20. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/bundle/manifest.schema.json +19 -9
  21. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/local/_scan.py +5 -4
  22. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/local/data_store.py +117 -75
  23. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/local/engine.py +39 -8
  24. sdmxlib-0.76.0/src/sdmxlib/local/object_store.py +244 -0
  25. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/local/registry.py +156 -12
  26. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/local/sql.py +64 -0
  27. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/binding.py +0 -25
  28. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/codelist.py +67 -0
  29. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/in_memory_registry.py +5 -1
  30. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/validation.py +12 -6
  31. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/query/_compile.py +185 -30
  32. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/query/_expr.py +9 -1
  33. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/query/_joins.py +27 -0
  34. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/query/accessors.py +3 -0
  35. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/query/observations.py +69 -10
  36. sdmxlib-0.76.0/src/sdmxlib/storage/_columns.py +23 -0
  37. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/storage/_manifest.py +38 -11
  38. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/storage/lazy.py +44 -3
  39. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/storage/readers.py +43 -20
  40. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/storage/resolve.py +33 -0
  41. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/storage/schema.py +38 -5
  42. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/storage/writers.py +45 -6
  43. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/testing.py +1 -1
  44. sdmxlib-0.74.0/src/sdmxlib/bundle/_remote.py +0 -85
  45. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/LICENSE +0 -0
  46. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/README.md +0 -0
  47. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/_duckdb.py +0 -0
  48. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/_singleflight.py +0 -0
  49. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/_time.py +0 -0
  50. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/api/__init__.py +0 -0
  51. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/api/_freshness.py +0 -0
  52. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/api/providers.py +0 -0
  53. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/builders/__init__.py +0 -0
  54. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/builders/metadata_annotation.py +0 -0
  55. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/bundle/_canonical.py +0 -0
  56. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/bundle/_finding.py +0 -0
  57. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/bundle/_overlay.py +0 -0
  58. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/bundle/overlay.schema.json +0 -0
  59. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/data_store.py +0 -0
  60. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/__init__.py +0 -0
  61. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/_arrow.py +0 -0
  62. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/_attachment.py +0 -0
  63. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/_coerce.py +0 -0
  64. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/_index.py +0 -0
  65. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/_positions.py +0 -0
  66. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/_refuse.py +0 -0
  67. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/data_format.py +0 -0
  68. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/gaps.py +0 -0
  69. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/render.py +0 -0
  70. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_csv/__init__.py +0 -0
  71. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_csv/reader.py +0 -0
  72. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_csv/writer.py +0 -0
  73. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_json/__init__.py +0 -0
  74. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_json/_data_common.py +0 -0
  75. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_json/_dto.py +0 -0
  76. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_json/_header.py +0 -0
  77. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_json/_losses.py +0 -0
  78. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_json/_periods.py +0 -0
  79. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_json/_resolve.py +0 -0
  80. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_json/_structure_dto.py +0 -0
  81. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_json/_structure_ingest.py +0 -0
  82. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_json/data.py +0 -0
  83. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_json/data_v1.py +0 -0
  84. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_json/data_v2.py +0 -0
  85. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_json/metadata.py +0 -0
  86. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_json/reader.py +0 -0
  87. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_json/structure_values.py +0 -0
  88. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_json/writer.py +0 -0
  89. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_json_1_0/__init__.py +0 -0
  90. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_json_1_0/writer.py +0 -0
  91. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_ml/__init__.py +0 -0
  92. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_ml/_allowed_children.py +0 -0
  93. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_ml/_closed_world.py +0 -0
  94. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_ml/_common.py +0 -0
  95. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_ml/_header.py +0 -0
  96. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_ml/_losses.py +0 -0
  97. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_ml/_v3_reader.py +0 -0
  98. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_ml/_v3_writer.py +0 -0
  99. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_ml21/__init__.py +0 -0
  100. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_ml21/_providers.py +0 -0
  101. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_ml21/_synthetic.py +0 -0
  102. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_ml21/namespaces.py +0 -0
  103. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_ml21/reader.py +0 -0
  104. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_ml21/writer.py +0 -0
  105. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_ml30/__init__.py +0 -0
  106. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_ml30/metadata.py +0 -0
  107. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_ml30/namespaces.py +0 -0
  108. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_ml30/reader.py +0 -0
  109. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_ml30/writer.py +0 -0
  110. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_ml31/__init__.py +0 -0
  111. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_ml31/namespaces.py +0 -0
  112. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_ml31/reader.py +0 -0
  113. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/formats/sdmx_ml31/writer.py +0 -0
  114. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/local/__init__.py +0 -0
  115. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/__init__.py +0 -0
  116. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/_binding.py +0 -0
  117. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/_container.py +0 -0
  118. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/_invariants.py +0 -0
  119. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/_items.py +0 -0
  120. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/_label_match.py +0 -0
  121. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/_rebind.py +0 -0
  122. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/_referenceable.py +0 -0
  123. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/_refshape.py +0 -0
  124. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/_resolvers.py +0 -0
  125. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/_rules.py +0 -0
  126. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/_tree.py +0 -0
  127. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/annotations.py +0 -0
  128. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/base.py +0 -0
  129. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/category.py +0 -0
  130. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/collections.py +0 -0
  131. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/concept.py +0 -0
  132. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/constraint.py +0 -0
  133. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/convert.py +0 -0
  134. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/dataflow.py +0 -0
  135. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/datastructure.py +0 -0
  136. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/errors.py +0 -0
  137. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/expr.py +0 -0
  138. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/header.py +0 -0
  139. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/hierarchy.py +0 -0
  140. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/istring.py +0 -0
  141. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/link.py +0 -0
  142. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/mapping.py +0 -0
  143. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/message.py +0 -0
  144. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/metadata_provision.py +0 -0
  145. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/metadataflow.py +0 -0
  146. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/metadataset.py +0 -0
  147. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/metadatastructure.py +0 -0
  148. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/organisation.py +0 -0
  149. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/provision.py +0 -0
  150. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/ref.py +0 -0
  151. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/registry.py +0 -0
  152. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/representation.py +0 -0
  153. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/rest_api.py +0 -0
  154. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/rollup.py +0 -0
  155. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/urn.py +0 -0
  156. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/valuelist.py +0 -0
  157. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/version.py +0 -0
  158. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/model/version_rewrite.py +0 -0
  159. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/polars.py +0 -0
  160. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/py.typed +0 -0
  161. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/query/__init__.py +0 -0
  162. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/query/_closure.py +0 -0
  163. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/query/_common.py +0 -0
  164. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/query/_edges.py +0 -0
  165. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/query/_execute.py +0 -0
  166. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/query/_plan.py +0 -0
  167. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/query/_pushdown.py +0 -0
  168. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/query/_rebase.py +0 -0
  169. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/query/_rest.py +0 -0
  170. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/query/query.py +0 -0
  171. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/query/raw.py +0 -0
  172. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/query/schema.py +0 -0
  173. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/rest.py +0 -0
  174. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/session.py +0 -0
  175. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/sql.py +0 -0
  176. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/storage/__init__.py +0 -0
  177. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/storage/_checked.py +0 -0
  178. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/storage/_kinds.py +0 -0
  179. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/storage/_parsed.py +0 -0
  180. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/storage/_projections.py +0 -0
  181. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/storage/_references.py +0 -0
  182. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/storage/_synthetic.py +0 -0
  183. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/storage/_trim.py +0 -0
  184. {sdmxlib-0.74.0 → sdmxlib-0.76.0}/src/sdmxlib/versions.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sdmxlib
3
- Version: 0.74.0
3
+ Version: 0.76.0
4
4
  Summary: SDMX for Python: structures, reference metadata and observation data, from REST, files or a local DuckDB store.
5
5
  Keywords: sdmx,statistics,metadata,datastructure
6
6
  Author: gabrielgellner
@@ -15,7 +15,8 @@ Classifier: Programming Language :: Python :: 3.14
15
15
  Classifier: Topic :: Scientific/Engineering :: Information Analysis
16
16
  Requires-Dist: attrs>=26.1.0
17
17
  Requires-Dist: duckdb>=2.0.0
18
- Requires-Dist: httpx>=0.28.1
18
+ Requires-Dist: httpx2>=2.16.0
19
+ Requires-Dist: google-crc32c>=1.9.0
19
20
  Requires-Dist: lxml>=6.1.3
20
21
  Requires-Dist: msgspec>=0.22.0
21
22
  Requires-Dist: polars>=2.0.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sdmxlib"
3
- version = "0.74.0"
3
+ version = "0.76.0"
4
4
  description = "SDMX for Python: structures, reference metadata and observation data, from REST, files or a local DuckDB store."
5
5
  readme = "README.md"
6
6
  license = "Apache-2.0"
@@ -23,7 +23,8 @@ classifiers = [
23
23
  dependencies = [
24
24
  "attrs>=26.1.0",
25
25
  "duckdb>=2.0.0",
26
- "httpx>=0.28.1",
26
+ "httpx2>=2.16.0",
27
+ "google-crc32c>=1.9.0",
27
28
  "lxml>=6.1.3",
28
29
  "msgspec>=0.22.0",
29
30
  "polars>=2.0.0",
@@ -57,6 +58,7 @@ markers = [
57
58
  "slow: tests that dominate suite wall-time; deselect for tight loops",
58
59
  "serial: thread-heavy tests `just test` runs alone, after the parallel phase; under -n they starve",
59
60
  "bench: performance benchmarks; excluded from default test runs",
61
+ "stores: object-store emulators in containers; skipped, and said so, without a container runtime",
60
62
  "bundle: benchmarks against a real SDMX bundle; need $SDMXLIB_BENCH_BUNDLE",
61
63
  "recompute: bundle-tier assertions that recompute what publishing computed; in `just bench-bundle`, not `just ci`",
62
64
  ]
@@ -121,6 +123,7 @@ dev = [
121
123
  "pytest-xdist>=3.8.0",
122
124
  "pytest-memray>=1.7.0",
123
125
  "pytest-recording>=0.13.4",
126
+ "vcrpy>=8.3.0",
124
127
  "pydoclint>=0.11.1,<0.12",
125
128
  "pyrefly>=1.4.0,<1.5",
126
129
  "ruff>=0.17.1,<0.18",
@@ -128,7 +131,6 @@ dev = [
128
131
  "hypothesis>=6.140,<7",
129
132
  "sqlglot>=27.0",
130
133
  "fastapi>=0.115",
131
- "httpx2>=2.12",
132
134
  ]
133
135
  bench-compete = [
134
136
  "sdmx1>=2.27.0",
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sdmxlib"
3
- version = "0.74.0"
3
+ version = "0.76.0"
4
4
  description = "SDMX for Python: structures, reference metadata and observation data, from REST, files or a local DuckDB store."
5
5
  readme = "README.md"
6
6
  license = "Apache-2.0"
@@ -23,7 +23,14 @@ dependencies = [
23
23
  # unfinished result raises rather than clobbering it (`session.completed`).
24
24
  # The tests assert 2.0's profile JSON, error text and sort costs.
25
25
  "duckdb>=2.0.0",
26
- "httpx>=0.28.1",
26
+ # httpx2: Pydantic's maintained fork of httpx 0.28.1 (GH-141), which
27
+ # Starlette's TestClient and sdmxlib-rest also use, so the suite installs
28
+ # one HTTP stack. It verifies TLS against the system trust store.
29
+ "httpx2>=2.16.0",
30
+ # CRC32C, the digest S3 (full-object, any upload) and GCS (always) keep:
31
+ # the manifest records it so a store can verify a file without a
32
+ # download (GH-181). The standard library has only CRC-32.
33
+ "google-crc32c>=1.9.0",
27
34
  # >=6.1: `resolve_entities` defaults to 'internal' (CVE-2026-41066), so no
28
35
  # parse expands an external entity.
29
36
  "lxml>=6.1.3",
@@ -38,8 +45,8 @@ dependencies = [
38
45
  "pyarrow>=26.0.0",
39
46
  # PEP 728's `closed=True` TypedDict, which `typing` gains only in 3.15: a
40
47
  # TypedDict unpacked into a constructor (`**read_reference_attrs(el)`) must
41
- # be closed for a checker to know it holds no other key. httpx already
42
- # brings it in, through anyio; declared because we now import it.
48
+ # be closed for a checker to know it holds no other key. Declared because
49
+ # we import it.
43
50
  "typing-extensions>=4.16.0",
44
51
  ]
45
52
 
@@ -83,6 +90,7 @@ markers = [
83
90
  "slow: tests that dominate suite wall-time; deselect for tight loops",
84
91
  "serial: thread-heavy tests `just test` runs alone, after the parallel phase; under -n they starve",
85
92
  "bench: performance benchmarks; excluded from default test runs",
93
+ "stores: object-store emulators in containers; skipped, and said so, without a container runtime",
86
94
  # The bundle tier (#379) reads a real 2.6 GB SDMX bundle that is not, and
87
95
  # cannot be, in the repo. Split from `bench` so `just bench` means the same
88
96
  # thing on every machine and `bench/baselines/` stays comparable across them.
@@ -135,6 +143,9 @@ dev = [
135
143
  "pytest-xdist>=3.8.0",
136
144
  "pytest-memray>=1.7.0",
137
145
  "pytest-recording>=0.13.4",
146
+ # 8.3 patches httpx2's transports, so the integration tier's cassettes replay
147
+ # sdmxlib's requests; an older vcrpy lets them reach the network.
148
+ "vcrpy>=8.3.0",
138
149
  "pydoclint>=0.11.1,<0.12",
139
150
  "pyrefly>=1.4.0,<1.5",
140
151
  "ruff>=0.17.1,<0.18",
@@ -155,11 +166,6 @@ dev = [
155
166
  # an undefined `Request` and an undefined `parse_c_params`. Not a runtime
156
167
  # dependency and must not become one: sdmxlib has no web framework.
157
168
  "fastapi>=0.115",
158
- # Starlette's TestClient asks for this by name — on plain `httpx` it emits a
159
- # StarletteDeprecationWarning, which `filterwarnings = ["error"]` turns into
160
- # a failure. Taking the fix it names beats ignoring the warning it raises.
161
- # Test-only, like fastapi; sdmxlib's own client stays on httpx.
162
- "httpx2>=2.12",
163
169
  ]
164
170
  # Optional: third-party SDMX libraries for the competitive benchmarks
165
171
  # (tests/bench/test_compete.py, and `just bench-compete` — bench/compete/).
@@ -10,7 +10,7 @@ from sdmxlib.api.providers import Provider
10
10
  from sdmxlib.formats.data_format import DataFormat
11
11
  from sdmxlib.formats.gaps import DroppedArtefact, Gap, dropped, unrepresentable
12
12
  from sdmxlib.api.client import ResponseTooLargeError
13
- from sdmxlib.api.registry import BearerToken, FmrRegistry, RestRegistry
13
+ from sdmxlib.api.registry import BearerToken, FmrRegistry, Resolve, RestRegistry
14
14
  from sdmxlib.data_store import DataStore, WriteSource
15
15
  from sdmxlib.model.datastructure import ComponentRole
16
16
  from sdmxlib.model.ref import short_urn as short_urn
@@ -56,6 +56,7 @@ from sdmxlib.local import (
56
56
  SchemaInspector,
57
57
  )
58
58
  from sdmxlib.local.data_store import DuckDBDataStore, DuckLakeVersionError
59
+ from sdmxlib.local.object_store import StoreSecret
59
60
  from sdmxlib.local.sql import SidecarNotUniqueError
60
61
  from sdmxlib.rest import ComponentFilter, parse_components, widen_key
61
62
  from sdmxlib.query._common import Descending
@@ -72,6 +73,7 @@ from sdmxlib.model.validation import (
72
73
  SdmxParseError,
73
74
  ValidationError,
74
75
  ValidationIssue,
76
+ check_serialisable,
75
77
  validate,
76
78
  validate_references,
77
79
  )
@@ -391,6 +393,7 @@ __all__ = [
391
393
  "Representation",
392
394
  "RepresentationMap",
393
395
  "RepresentationMapping",
396
+ "Resolve",
394
397
  "ResolvePeriod",
395
398
  "ResponseTooLargeError",
396
399
  "RestRegistry",
@@ -414,6 +417,7 @@ __all__ = [
414
417
  "SqlRelation",
415
418
  "StoreFormatError",
416
419
  "StoreSchemaError",
420
+ "StoreSecret",
417
421
  "Str",
418
422
  "StructureMap",
419
423
  "StructureMessage",
@@ -436,6 +440,7 @@ __all__ = [
436
440
  "WinPred",
437
441
  "WriteSource",
438
442
  "artefact_urn",
443
+ "check_serialisable",
439
444
  "dropped",
440
445
  "from_dict",
441
446
  "item",
@@ -1,4 +1,4 @@
1
- """SdmxClient — thin httpx wrapper around the SDMX REST API."""
1
+ """SdmxClient — thin httpx2 wrapper around the SDMX REST API."""
2
2
 
3
3
  import ssl
4
4
  import threading
@@ -9,7 +9,7 @@ from http.cookiejar import CookieJar
9
9
  from pathlib import Path
10
10
  from typing import Self, Unpack
11
11
 
12
- import httpx
12
+ import httpx2
13
13
  from typing_extensions import TypedDict
14
14
 
15
15
  from sdmxlib.api._freshness import Freshness, read_freshness
@@ -19,27 +19,27 @@ from sdmxlib.formats.data_format import DataFormat
19
19
  from sdmxlib.model.message import StructureMessage
20
20
  from sdmxlib.model.rest_api import ApiVersion
21
21
 
22
- # Mirrors httpx's private `_types.PrimitiveData`. Spelled out rather than
23
- # imported because `httpx._types` is not public API.
22
+ # Mirrors httpx2's private `_types.PrimitiveData`. Spelled out rather than
23
+ # imported because `httpx2._types` is not public API.
24
24
  type _PrimitiveData = str | int | float | bool | None
25
25
 
26
26
 
27
27
  class _HttpxTransportFields(TypedDict, total=False):
28
28
  """`HttpxOptions` minus ``auth`` — see there for the full rationale.
29
29
 
30
- Split out because `GlobalRegistry` exposes its own richer ``auth``
30
+ Split out because `FmrRegistry` exposes its own richer ``auth``
31
31
  parameter (it also accepts a ``BearerToken``, which becomes a header
32
- rather than an httpx auth object). A caller-facing ``auth`` keyword and an
32
+ rather than an httpx2 auth object). A caller-facing ``auth`` keyword and an
33
33
  ``Unpack`` shape that also carries ``auth`` are a static conflict, so that
34
34
  constructor accepts this narrower set and supplies ``auth`` itself.
35
35
  """
36
36
 
37
- # `params` and `cookies` mirror httpx's `QueryParamTypes` / `CookieTypes`
37
+ # `params` and `cookies` mirror httpx2's `QueryParamTypes` / `CookieTypes`
38
38
  # in full. The tuple/list spellings are exact rather than widened to
39
- # `Sequence[...]`: httpx's own aliases name `list` and `tuple` concretely,
39
+ # `Sequence[...]`: httpx2's own aliases name `list` and `tuple` concretely,
40
40
  # and a `Sequence` here would not be assignable at the forwarding call.
41
41
  params: (
42
- httpx.QueryParams
42
+ httpx2.QueryParams
43
43
  | Mapping[str, _PrimitiveData | Sequence[_PrimitiveData]]
44
44
  | list[tuple[str, _PrimitiveData]]
45
45
  | tuple[tuple[str, _PrimitiveData], ...]
@@ -47,31 +47,31 @@ class _HttpxTransportFields(TypedDict, total=False):
47
47
  | bytes
48
48
  | None
49
49
  )
50
- cookies: httpx.Cookies | CookieJar | dict[str, str] | list[tuple[str, str]] | None
50
+ cookies: httpx2.Cookies | CookieJar | dict[str, str] | list[tuple[str, str]] | None
51
51
  verify: ssl.SSLContext | str | bool
52
52
  cert: str | tuple[str, str] | tuple[str, str, str] | None
53
53
  trust_env: bool
54
54
  http1: bool
55
55
  http2: bool
56
- proxy: httpx.Proxy | httpx.URL | str | None
57
- mounts: Mapping[str, httpx.BaseTransport | None] | None
56
+ proxy: httpx2.Proxy | httpx2.URL | str | None
57
+ mounts: Mapping[str, httpx2.BaseTransport | None] | None
58
58
  follow_redirects: bool
59
- limits: httpx.Limits
59
+ limits: httpx2.Limits
60
60
  max_redirects: int
61
- transport: httpx.BaseTransport | None
61
+ transport: httpx2.BaseTransport | None
62
62
  default_encoding: str | Callable[[bytes], str]
63
63
 
64
64
 
65
65
  class _HttpxAuthField(TypedDict, total=False):
66
66
  """Just ``auth``, so it can be unpacked alongside `HttpxTransportOptions`.
67
67
 
68
- `GlobalRegistry` supplies ``auth`` itself and forwards the rest untouched.
68
+ `FmrRegistry` supplies ``auth`` itself and forwards the rest untouched.
69
69
  Both halves have to be separate shapes for that to type-check: two ``**``
70
70
  unpackings in one call must have provably disjoint key sets, which they do
71
71
  not if either side is the combined `HttpxOptions`.
72
72
  """
73
73
 
74
- auth: httpx.Auth | tuple[str | bytes, str | bytes] | Callable[[httpx.Request], httpx.Request] | None
74
+ auth: httpx2.Auth | tuple[str | bytes, str | bytes] | Callable[[httpx2.Request], httpx2.Request] | None
75
75
 
76
76
 
77
77
  class HttpxTransportOptions(_HttpxTransportFields, total=False, closed=True):
@@ -87,28 +87,28 @@ class HttpxAuthOption(_HttpxAuthField, total=False, closed=True):
87
87
 
88
88
 
89
89
  class HttpxOptions(_HttpxTransportFields, _HttpxAuthField, total=False, closed=True):
90
- """The `httpx.Client` options sdmxlib forwards, as a PEP 692 kwargs shape.
90
+ """The `httpx2.Client` options sdmxlib forwards, as a PEP 692 kwargs shape.
91
91
 
92
- This is the *supported surface*, not a mirror of httpx: `headers`,
92
+ This is the *supported surface*, not a mirror of httpx2: `headers`,
93
93
  `timeout` and `base_url` are deliberately absent because `SdmxClient` owns
94
94
  them — passing one used to be a runtime ``TypeError`` from a duplicate
95
95
  keyword, and is now a type error at the call site.
96
96
 
97
- Every option that *is* here carries httpx's own type in full. Narrowing one
98
- below httpx would reject a call httpx would have accepted, and there is no
99
- SDMX-level reason to: none of these values is read by sdmxlib, and httpx
100
- normalises them at construction (``params`` becomes a `httpx.QueryParams`
97
+ Every option that *is* here carries httpx2's own type in full. Narrowing one
98
+ below httpx2 would reject a call httpx2 would have accepted, and there is no
99
+ SDMX-level reason to: none of these values is read by sdmxlib, and httpx2
100
+ normalises them at construction (``params`` becomes a `httpx2.QueryParams`
101
101
  before any request is built), so all accepted spellings behave identically.
102
102
  The only legitimate narrowing is dropping an option entirely, as above.
103
103
 
104
104
  Used as ``**httpx_kwargs: Unpack[HttpxOptions]`` so the pass-through stays
105
105
  fully checked end to end. The alternative shapes both cost something the
106
106
  library should not pay: ``**kwargs: object`` is *provably* wrong at the
107
- httpx boundary (every one of its parameters rejects `object`, which is why
107
+ httpx2 boundary (every one of its parameters rejects `object`, which is why
108
108
  a single blanket suppression was hiding 17 errors), and ``**kwargs: Any``
109
109
  is honest but silently accepts typos and wrong types at a public API.
110
110
 
111
- ``event_hooks`` is omitted on purpose: httpx types its hooks as
111
+ ``event_hooks`` is omitted on purpose: httpx2 types its hooks as
112
112
  ``Callable[..., Any]``, which would put `Any` back into this signature for
113
113
  a rarely-used option. Add it — with a narrower callable type — if a real
114
114
  caller needs it.
@@ -176,7 +176,7 @@ def _version_parts(version: str) -> tuple[int, ...]:
176
176
  return tuple(parts)
177
177
 
178
178
 
179
- def _check_content_type(response: httpx.Response, fmt: DataFormat, *, url: str) -> None:
179
+ def _check_content_type(response: httpx2.Response, fmt: DataFormat, *, url: str) -> None:
180
180
  """Refuse a response that is not the format that was asked for.
181
181
 
182
182
  Without this the format argument is decorative — which is precisely the
@@ -216,7 +216,7 @@ def _check_content_type(response: httpx.Response, fmt: DataFormat, *, url: str)
216
216
  raise ValueError(msg)
217
217
 
218
218
 
219
- def _require_csv(response: httpx.Response, *, accept: str, url: str) -> None:
219
+ def _require_csv(response: httpx2.Response, *, accept: str, url: str) -> None:
220
220
  """Refuse an observation fetch's response that is not CSV (GH-50).
221
221
 
222
222
  The data plane hands the body to DuckDB's CSV reader, which reads an
@@ -243,10 +243,10 @@ def _require_csv(response: httpx.Response, *, accept: str, url: str) -> None:
243
243
  raise ValueError(msg)
244
244
 
245
245
 
246
- def _raise_for_status(response: httpx.Response, *, url: str) -> None:
246
+ def _raise_for_status(response: httpx2.Response, *, url: str) -> None:
247
247
  """`raise_for_status`, with the two size refusals named.
248
248
 
249
- Everything else keeps httpx's own error — there is nothing this layer can
249
+ Everything else keeps httpx2's own error — there is nothing this layer can
250
250
  add to a 500 that the message does not already say.
251
251
  """
252
252
  reason = _TOO_LARGE.get(response.status_code)
@@ -280,7 +280,7 @@ NOT_MODIFIED = object()
280
280
 
281
281
 
282
282
  class SdmxClient:
283
- """Thin httpx wrapper that fetches SDMX REST resources and parses them.
283
+ """Thin httpx2 wrapper that fetches SDMX REST resources and parses them.
284
284
 
285
285
  Handles URL construction, Accept headers, and response parsing.
286
286
 
@@ -342,7 +342,7 @@ class SdmxClient:
342
342
  default_headers = {"Accept": "application/xml"}
343
343
  if headers:
344
344
  default_headers.update(headers)
345
- self._client = httpx.Client(
345
+ self._client = httpx2.Client(
346
346
  headers=default_headers,
347
347
  timeout=timeout,
348
348
  **httpx_kwargs,
@@ -510,12 +510,12 @@ class SdmxClient:
510
510
 
511
511
  with self._reaching(url):
512
512
  response = self._client.get(url, params=params, headers=validators or None)
513
- if response.status_code == httpx.codes.NOT_FOUND:
513
+ if response.status_code == httpx2.codes.NOT_FOUND:
514
514
  err = f"{resource} {agency}:{id}({version}) not found at {self._endpoint}"
515
515
  raise KeyError(err)
516
516
  if cache_key is not None:
517
517
  self._remember(cache_key, response.headers)
518
- if response.status_code == httpx.codes.NOT_MODIFIED:
518
+ if response.status_code == httpx2.codes.NOT_MODIFIED:
519
519
  # The provider confirmed the pointer has not moved. There is no
520
520
  # body to parse — that is the whole saving — so the caller reuses
521
521
  # what it resolved last time.
@@ -569,7 +569,7 @@ class SdmxClient:
569
569
  """
570
570
  try:
571
571
  yield
572
- except (httpx.TransportError, OSError) as exc:
572
+ except (httpx2.TransportError, OSError) as exc:
573
573
  raise RegistryUnavailable(self._endpoint, exc, tried=url) from exc
574
574
 
575
575
  def _data_url(
@@ -35,12 +35,12 @@ Example:
35
35
  import annotationlib
36
36
  import functools
37
37
  import inspect
38
- from collections.abc import Sequence
39
38
  from typing import overload
40
39
 
41
- import httpx
40
+ import httpx2
42
41
 
43
42
  from sdmxlib.api.policy import RegistryUnavailable
43
+ from sdmxlib.api.registry import Resolve
44
44
  from sdmxlib.model.binding import DataflowBinding, DriftError, DriftIssue, _validate_binding
45
45
  from sdmxlib.model.ref import Ref, target_urn
46
46
  from sdmxlib.model.registry import RegistryReader
@@ -129,7 +129,7 @@ class FederatedRegistry:
129
129
  /,
130
130
  *,
131
131
  expect: type[T],
132
- resolve: bool | Sequence[type] = False,
132
+ resolve: Resolve = False,
133
133
  partial: bool = True,
134
134
  ) -> T | None: ...
135
135
 
@@ -139,7 +139,7 @@ class FederatedRegistry:
139
139
  target: SdmxUrn[T] | Ref[T],
140
140
  /,
141
141
  *,
142
- resolve: bool | Sequence[type] = False,
142
+ resolve: Resolve = False,
143
143
  partial: bool = True,
144
144
  ) -> T | None: ...
145
145
 
@@ -149,7 +149,7 @@ class FederatedRegistry:
149
149
  /,
150
150
  *,
151
151
  expect: type[T] | None = None,
152
- resolve: bool | Sequence[type] = False,
152
+ resolve: Resolve = False,
153
153
  partial: bool = True,
154
154
  ) -> object:
155
155
  """Resolve ``target`` via the routed source.
@@ -175,8 +175,10 @@ class FederatedRegistry:
175
175
  target: Identity of the artefact to read — a URN, or a `Ref`
176
176
  naming one. Routing reads the *agency* off it, so a `Ref`
177
177
  had to be unwrapped before this could route at all.
178
- resolve: How deep to follow references. `True` for every
179
- reference, a sequence of artefact types for only those.
178
+ resolve: How deep to follow references, as on `RestRegistry.get`:
179
+ `True` for every reference, `"all"` or `"parents"` for the
180
+ artefacts referring to it, a sequence of artefact types for
181
+ only those.
180
182
  partial: `False` asks for untrimmed codelists.
181
183
  expect: The class the caller requires. The artefact is returned
182
184
  when it is an instance, `None` otherwise — see
@@ -203,7 +205,7 @@ class FederatedRegistry:
203
205
  # Already named by the source that raised it; re-wrapping would
204
206
  # bury the inner source's id behind this one's.
205
207
  raise
206
- except (httpx.HTTPError, OSError) as exc:
208
+ except (httpx2.HTTPError, OSError) as exc:
207
209
  raise RegistryUnavailable(getattr(source, "id", None), exc, tried=str(urn)) from exc
208
210
  # Applied here rather than forwarded: `_dispatch_kwargs` sends each
209
211
  # source only what it understands, and a local source takes neither
@@ -218,7 +220,7 @@ class FederatedRegistry:
218
220
  source: RegistryReader,
219
221
  urn: SdmxUrn[object],
220
222
  *,
221
- resolve: bool | Sequence[type],
223
+ resolve: Resolve,
222
224
  partial: bool,
223
225
  ) -> dict[str, object]:
224
226
  """Which of ``resolve`` / ``partial`` this source can be asked for.
@@ -31,7 +31,7 @@ so, which cannot mislabel anything:
31
31
  class RegistryUnavailable(Exception): # noqa: N818 # name matches #46 vocabulary
32
32
  """A source could not be reached, so no read of it can be believed.
33
33
 
34
- Wraps the underlying httpx / connection error so callers catch one type
34
+ Wraps the underlying httpx2 / connection error so callers catch one type
35
35
  without depending on the HTTP layer. Carries the *source* and *what was
36
36
  tried*, because §5.8 asks the error to name both — a bare
37
37
  ``ConnectError: connection refused`` names neither, and in a federation
@@ -5,7 +5,7 @@ import threading
5
5
  from collections.abc import Sequence
6
6
  from contextlib import AbstractContextManager
7
7
  from pathlib import Path
8
- from typing import Never, Self, Unpack, cast, overload
8
+ from typing import Literal, Never, Self, Unpack, cast, overload
9
9
 
10
10
  import attrs
11
11
 
@@ -115,17 +115,26 @@ def _to_references(reference_type: type) -> str:
115
115
  return sdmx_class.lower()
116
116
 
117
117
 
118
- def _references_for(*, resolve: bool | Sequence[type]) -> str:
118
+ #: What `RestRegistry.get` follows: nothing, every reference, the artefacts
119
+ #: referring to it as well (``"all"``), only those (``"parents"``), or the
120
+ #: references to these types.
121
+ type Resolve = bool | Literal["all", "parents"] | Sequence[type]
122
+
123
+
124
+ def _references_for(*, resolve: Resolve) -> str:
119
125
  """The `references=` a resolution depth asks for.
120
126
 
121
127
  Lifted out of `_read` when the freshness paths pushed it past the
122
128
  complexity gate — and it reads better alone, being the one place the
123
- three-way `resolve` argument becomes a wire parameter.
129
+ `resolve` argument becomes a wire parameter. The two words come before
130
+ the sequence case, which a `str` would otherwise satisfy.
124
131
  """
125
132
  if resolve is True:
126
133
  return "descendants"
127
134
  if resolve is False:
128
135
  return "none"
136
+ if isinstance(resolve, str):
137
+ return resolve
129
138
  return ",".join(sorted(_to_references(t) for t in resolve))
130
139
 
131
140
 
@@ -550,7 +559,7 @@ class RestRegistry:
550
559
  return cached
551
560
  return self._local_cache_lookup(urn)
552
561
 
553
- def _confirmed[T](self, urn: SdmxUrn[T], *, completeness: Completeness) -> T | None:
562
+ def _confirmed[T](self, urn: SdmxUrn[T], *, completeness: Completeness, parents: bool = False) -> T | None:
554
563
  """What a confirmed-unmoved pointer resolves to, or `None` to ask again.
555
564
 
556
565
  `None` means the provider vouched for a pointer whose artefact this
@@ -558,12 +567,12 @@ class RestRegistry:
558
567
  freshness that vouched for it is dropped on the way out, so the retry
559
568
  goes to the provider instead of looping on the same confirmation.
560
569
  """
561
- held = self._settled_answer(urn, completeness=completeness)
570
+ held = self._settled_answer(urn, completeness=completeness, parents=parents)
562
571
  if held is None:
563
572
  self._forget(str(urn))
564
573
  return held
565
574
 
566
- def _settled_answer[T](self, urn: SdmxUrn[T], *, completeness: Completeness) -> T | None:
575
+ def _settled_answer[T](self, urn: SdmxUrn[T], *, completeness: Completeness, parents: bool = False) -> T | None:
567
576
  """What a confirmed-unmoved `latest` pointer resolves to, if still held.
568
577
 
569
578
  This is a `latest -> pinned` map, which #338 deleted. The difference is
@@ -579,7 +588,7 @@ class RestRegistry:
579
588
  # cannot say so — the documented "localize the unsafe object -> T step
580
589
  # to the accessor" case from CLAUDE.md, written as a cast rather than a
581
590
  # suppression so it belongs to no single checker.
582
- held = self._session.get_at_least(settled, completeness)
591
+ held = self._session.get_at_least(settled, completeness, parents=parents)
583
592
  return cast("T | None", held)
584
593
 
585
594
  def _remember_pointer(self, latest: str, pinned: SdmxUrn[object]) -> None:
@@ -763,7 +772,7 @@ class RestRegistry:
763
772
  /,
764
773
  *,
765
774
  expect: type[T],
766
- resolve: bool | Sequence[type] = False,
775
+ resolve: Resolve = False,
767
776
  partial: bool = True,
768
777
  ) -> T | None: ...
769
778
 
@@ -773,7 +782,7 @@ class RestRegistry:
773
782
  target: SdmxUrn[T] | Ref[T],
774
783
  /,
775
784
  *,
776
- resolve: bool | Sequence[type] = False,
785
+ resolve: Resolve = False,
777
786
  partial: bool = True,
778
787
  ) -> T | None: ...
779
788
 
@@ -783,7 +792,7 @@ class RestRegistry:
783
792
  /,
784
793
  *,
785
794
  expect: type[T] | None = None,
786
- resolve: bool | Sequence[type] = False,
795
+ resolve: Resolve = False,
787
796
  partial: bool = True,
788
797
  ) -> object:
789
798
  """Read one artefact by identity.
@@ -801,6 +810,16 @@ class RestRegistry:
801
810
  reg.get(urn, resolve=True) # every reference followed
802
811
  reg.get(urn, resolve=[sl.Codelist]) # only refs of these types
803
812
  reg.get(urn, resolve=True, partial=False) # and untrimmed
813
+ reg.get(urn, resolve="all") # and what refers to it
814
+ reg.get(urn, resolve="parents") # only what refers to it
815
+
816
+ `"all"` and `"parents"` bring the artefacts that refer to this one:
817
+ the constraints on a dataflow, and the hierarchy associations linked
818
+ to it or to its DSD's dimensions. A ``descendants`` fetch never
819
+ returns them, so a bundle's structural closure needs one of these.
820
+ Over SDMX 2.1 no hierarchy association arrives, since 2.1
821
+ has none. `"parents"` asks for the artefact's own fields in full and
822
+ follows none of its references.
804
823
 
805
824
  **The default differs from `LocalRegistry.get`, and that is not an
806
825
  inconsistency.** Resolving is a join away locally and another round
@@ -810,7 +829,9 @@ class RestRegistry:
810
829
  Args:
811
830
  target: A URN, or a `Ref` from graph traversal. Positional-only,
812
831
  and the same two types every other `get` takes.
813
- resolve: `False` for a skeleton, `True` for every reference, or a
832
+ resolve: `False` for a skeleton, `True` for every reference,
833
+ `"all"` for every reference and every artefact referring to
834
+ this one, `"parents"` for only the referring ones, or a
814
835
  sequence of artefact types to follow only those.
815
836
  partial: When resolving, trim referenced ItemSchemes by their
816
837
  DataConstraints. `False` for a full audit.
@@ -844,13 +865,15 @@ class RestRegistry:
844
865
  return found if isinstance(found, expect) else None
845
866
  return found
846
867
 
847
- def _read[T](self, urn: SdmxUrn[T], *, resolve: bool | Sequence[type], partial: bool) -> T:
868
+ def _read[T](self, urn: SdmxUrn[T], *, resolve: Resolve, partial: bool) -> T:
848
869
  """`get` without the not-found translation, for callers that require one."""
849
- wants_refs = bool(resolve)
870
+ wants_refs = bool(resolve) and resolve != "parents"
850
871
  detail = ("referencepartial" if partial else "full") if wants_refs else "full"
851
872
  references = _references_for(resolve=resolve)
852
873
  wanted = completeness_of(detail=detail, references=references)
853
- cached = self._session.get_at_least(urn, wanted)
874
+ # The two words are the only `str` values; a type list is unhashable.
875
+ parents = isinstance(resolve, str)
876
+ cached = self._session.get_at_least(urn, wanted, parents=parents)
854
877
  if cached is not None:
855
878
  return cached
856
879
  if not wants_refs:
@@ -867,7 +890,7 @@ class RestRegistry:
867
890
  references=references,
868
891
  )
869
892
  if fetched is NOT_MODIFIED:
870
- confirmed = self._confirmed(urn, completeness=wanted)
893
+ confirmed = self._confirmed(urn, completeness=wanted, parents=parents)
871
894
  if confirmed is not None:
872
895
  return confirmed
873
896
  return self._read(urn, resolve=resolve, partial=partial)
@@ -880,6 +903,8 @@ class RestRegistry:
880
903
  self._raise_if_refused(urn)
881
904
  err = f"{urn} not found in response"
882
905
  raise KeyError(err)
906
+ if parents and isinstance(result, SupportsUrn):
907
+ self._session.record_parents(artefact_urn(result))
883
908
  if urn.version == "latest" and isinstance(result, SupportsUrn):
884
909
  self._remember_pointer(str(urn), artefact_urn(result))
885
910
  return result
@@ -1264,7 +1289,7 @@ class FmrRegistry(RestRegistry):
1264
1289
  id: str | None = None,
1265
1290
  store: LocalRegistry | None = None,
1266
1291
  # Transport options only: this constructor owns `auth` (it also takes a
1267
- # BearerToken, which becomes a header rather than an httpx auth object),
1292
+ # BearerToken, which becomes a header rather than an httpx2 auth object),
1268
1293
  # so the forwarded shape must not carry one.
1269
1294
  **kwargs: Unpack[HttpxTransportOptions],
1270
1295
  ) -> None: