sdmxlib 0.86.0__tar.gz → 0.88.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 (222) hide show
  1. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/PKG-INFO +1 -1
  2. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/pyproject.toml +1 -1
  3. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/pyproject.toml.orig +1 -1
  4. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/edition/EGM.md +5 -1
  5. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/edition/manifest.schema.json +2 -2
  6. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/inventory/EGM.md +22 -9
  7. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/inventory/__init__.py +9 -1
  8. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/inventory/_format.py +9 -5
  9. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/inventory/_reader.py +84 -10
  10. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/inventory/conformance.py +10 -2
  11. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/inventory/schemas/leaf.schema.json +2 -2
  12. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/storage/EGM.md +5 -1
  13. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/storage/_manifest.py +68 -7
  14. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/LICENSE +0 -0
  15. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/README.md +0 -0
  16. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/EGM.md +0 -0
  17. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/__init__.py +0 -0
  18. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/_duckdb.py +0 -0
  19. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/_facet_types.xsd +0 -0
  20. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/_facets.py +0 -0
  21. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/_read_errors.py +0 -0
  22. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/_singleflight.py +0 -0
  23. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/_time.py +0 -0
  24. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/api/EGM.md +0 -0
  25. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/api/__init__.py +0 -0
  26. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/api/_freshness.py +0 -0
  27. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/api/client.py +0 -0
  28. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/api/federated.py +0 -0
  29. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/api/policy.py +0 -0
  30. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/api/providers.py +0 -0
  31. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/api/registry.py +0 -0
  32. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/api/session.py +0 -0
  33. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/builders/EGM.md +0 -0
  34. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/builders/__init__.py +0 -0
  35. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/builders/contentconstraint.py +0 -0
  36. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/builders/metadata_annotation.py +0 -0
  37. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/data_store.py +0 -0
  38. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/edition/__init__.py +0 -0
  39. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/edition/_availability.py +0 -0
  40. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/edition/_build.py +0 -0
  41. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/edition/_canonical.py +0 -0
  42. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/edition/_check.py +0 -0
  43. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/edition/_copy.py +0 -0
  44. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/edition/_fetch.py +0 -0
  45. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/edition/_finding.py +0 -0
  46. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/edition/_fingerprint.py +0 -0
  47. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/edition/_overlay.py +0 -0
  48. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/edition/_remote.py +0 -0
  49. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/edition/_write.py +0 -0
  50. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/edition/overlay.schema.json +0 -0
  51. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/EGM.md +0 -0
  52. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/__init__.py +0 -0
  53. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/_arrow.py +0 -0
  54. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/_attachment.py +0 -0
  55. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/_coerce.py +0 -0
  56. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/_index.py +0 -0
  57. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/_positions.py +0 -0
  58. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/_refuse.py +0 -0
  59. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/_tags.py +0 -0
  60. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/data_format.py +0 -0
  61. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/gaps.py +0 -0
  62. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/render.py +0 -0
  63. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_csv/EGM.md +0 -0
  64. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_csv/__init__.py +0 -0
  65. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_csv/reader.py +0 -0
  66. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_csv/writer.py +0 -0
  67. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_json/EGM.md +0 -0
  68. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_json/__init__.py +0 -0
  69. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_json/_data_common.py +0 -0
  70. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_json/_dto.py +0 -0
  71. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_json/_header.py +0 -0
  72. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_json/_losses.py +0 -0
  73. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_json/_periods.py +0 -0
  74. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_json/_resolve.py +0 -0
  75. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_json/_structure_dto.py +0 -0
  76. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_json/_structure_ingest.py +0 -0
  77. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_json/data.py +0 -0
  78. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_json/data_v1.py +0 -0
  79. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_json/data_v2.py +0 -0
  80. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_json/metadata.py +0 -0
  81. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_json/reader.py +0 -0
  82. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_json/structure_values.py +0 -0
  83. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_json/writer.py +0 -0
  84. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_json_1_0/EGM.md +0 -0
  85. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_json_1_0/__init__.py +0 -0
  86. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_json_1_0/writer.py +0 -0
  87. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml/EGM.md +0 -0
  88. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml/__init__.py +0 -0
  89. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml/_allowed_children.py +0 -0
  90. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml/_closed_world.py +0 -0
  91. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml/_common.py +0 -0
  92. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml/_header.py +0 -0
  93. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml/_losses.py +0 -0
  94. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml/_v3_reader.py +0 -0
  95. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml/_v3_writer.py +0 -0
  96. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml21/EGM.md +0 -0
  97. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml21/__init__.py +0 -0
  98. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml21/_providers.py +0 -0
  99. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml21/_synthetic.py +0 -0
  100. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml21/namespaces.py +0 -0
  101. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml21/reader.py +0 -0
  102. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml21/writer.py +0 -0
  103. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml30/EGM.md +0 -0
  104. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml30/__init__.py +0 -0
  105. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml30/metadata.py +0 -0
  106. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml30/namespaces.py +0 -0
  107. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml30/reader.py +0 -0
  108. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml30/writer.py +0 -0
  109. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml31/EGM.md +0 -0
  110. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml31/__init__.py +0 -0
  111. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml31/namespaces.py +0 -0
  112. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml31/reader.py +0 -0
  113. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/formats/sdmx_ml31/writer.py +0 -0
  114. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/inventory/_routing.py +0 -0
  115. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/inventory/_rules.py +0 -0
  116. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/inventory/schemas/catalog-2.0.schema.json +0 -0
  117. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/inventory/schemas/catalog.schema.json +0 -0
  118. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/inventory/schemas/current.schema.json +0 -0
  119. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/inventory/schemas/history.schema.json +0 -0
  120. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/inventory/schemas/root-1.2.schema.json +0 -0
  121. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/inventory/schemas/root.schema.json +0 -0
  122. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/inventory/schemas/segment-header.schema.json +0 -0
  123. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/inventory/schemas/segment-line.schema.json +0 -0
  124. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/local/EGM.md +0 -0
  125. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/local/__init__.py +0 -0
  126. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/local/_scan.py +0 -0
  127. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/local/data_store.py +0 -0
  128. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/local/engine.py +0 -0
  129. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/local/object_store.py +0 -0
  130. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/local/registry.py +0 -0
  131. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/local/sql.py +0 -0
  132. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/EGM.md +0 -0
  133. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/__init__.py +0 -0
  134. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/_binding.py +0 -0
  135. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/_container.py +0 -0
  136. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/_invariants.py +0 -0
  137. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/_items.py +0 -0
  138. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/_label_match.py +0 -0
  139. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/_rebind.py +0 -0
  140. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/_referenceable.py +0 -0
  141. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/_refshape.py +0 -0
  142. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/_resolvers.py +0 -0
  143. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/_rules.py +0 -0
  144. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/_tree.py +0 -0
  145. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/annotations.py +0 -0
  146. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/base.py +0 -0
  147. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/binding.py +0 -0
  148. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/category.py +0 -0
  149. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/codelist.py +0 -0
  150. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/collections.py +0 -0
  151. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/concept.py +0 -0
  152. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/constraint.py +0 -0
  153. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/convert.py +0 -0
  154. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/dataflow.py +0 -0
  155. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/datastructure.py +0 -0
  156. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/errors.py +0 -0
  157. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/expr.py +0 -0
  158. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/header.py +0 -0
  159. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/hierarchy.py +0 -0
  160. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/in_memory_registry.py +0 -0
  161. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/istring.py +0 -0
  162. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/link.py +0 -0
  163. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/mapping.py +0 -0
  164. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/message.py +0 -0
  165. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/metadata_provision.py +0 -0
  166. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/metadataflow.py +0 -0
  167. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/metadataset.py +0 -0
  168. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/metadatastructure.py +0 -0
  169. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/organisation.py +0 -0
  170. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/provision.py +0 -0
  171. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/ref.py +0 -0
  172. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/registry.py +0 -0
  173. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/representation.py +0 -0
  174. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/rest_api.py +0 -0
  175. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/rollup.py +0 -0
  176. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/urn.py +0 -0
  177. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/validation.py +0 -0
  178. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/valuelist.py +0 -0
  179. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/version.py +0 -0
  180. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/model/version_rewrite.py +0 -0
  181. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/polars.py +0 -0
  182. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/py.typed +0 -0
  183. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/query/EGM.md +0 -0
  184. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/query/__init__.py +0 -0
  185. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/query/_closure.py +0 -0
  186. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/query/_common.py +0 -0
  187. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/query/_compile.py +0 -0
  188. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/query/_edges.py +0 -0
  189. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/query/_execute.py +0 -0
  190. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/query/_expr.py +0 -0
  191. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/query/_joins.py +0 -0
  192. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/query/_plan.py +0 -0
  193. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/query/_pushdown.py +0 -0
  194. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/query/_rebase.py +0 -0
  195. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/query/_rest.py +0 -0
  196. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/query/accessors.py +0 -0
  197. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/query/observations.py +0 -0
  198. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/query/query.py +0 -0
  199. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/query/raw.py +0 -0
  200. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/query/schema.py +0 -0
  201. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/rest.py +0 -0
  202. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/session.py +0 -0
  203. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/sql.py +0 -0
  204. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/storage/__init__.py +0 -0
  205. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/storage/_checked.py +0 -0
  206. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/storage/_columns.py +0 -0
  207. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/storage/_files.py +0 -0
  208. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/storage/_kinds.py +0 -0
  209. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/storage/_layout.py +0 -0
  210. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/storage/_parsed.py +0 -0
  211. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/storage/_projections.py +0 -0
  212. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/storage/_references.py +0 -0
  213. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/storage/_synthetic.py +0 -0
  214. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/storage/_tags.py +0 -0
  215. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/storage/_trim.py +0 -0
  216. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/storage/lazy.py +0 -0
  217. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/storage/readers.py +0 -0
  218. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/storage/resolve.py +0 -0
  219. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/storage/schema.py +0 -0
  220. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/storage/writers.py +0 -0
  221. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/testing.py +0 -0
  222. {sdmxlib-0.86.0 → sdmxlib-0.88.0}/src/sdmxlib/versions.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sdmxlib
3
- Version: 0.86.0
3
+ Version: 0.88.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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sdmxlib"
3
- version = "0.86.0"
3
+ version = "0.88.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"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sdmxlib"
3
- version = "0.86.0"
3
+ version = "0.88.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"
@@ -93,7 +93,8 @@ seals through `seal(extensions=...)`.
93
93
  its availability and for coded-column values outside their enumeration.
94
94
  `seal` and `check_edition(at="publish")` both call it.
95
95
  - Manifest types, re-exported from `storage._manifest`: `read_manifest`,
96
- `decode_manifest` (the same read from bytes, naming `source` in its errors),
96
+ `decode_manifest` (the same read from bytes, naming `source` in its errors;
97
+ both refuse a path that could name a file outside the product, GH-380),
97
98
  `Manifest`, `Producer`, `Provenance`, `EditionFile`, `ArtefactEntry`,
98
99
  `BindingCount`, `Tier`, `ManifestError`, `StoreFormatError`, and the
99
100
  constants `DATA_PATH`, `MANIFEST_NAME`, `SIGNATURE_NAME`, `FORMAT_VERSION`
@@ -128,6 +129,9 @@ seals through `seal(extensions=...)`.
128
129
  names: the manifest, its signature, and a staged manifest a crash left.
129
130
  - Data files are always tier 3. `metadata.duckdb` and `tables.ducklake` default to
130
131
  tier 1, and other files to tier 2.
132
+ - `copy_edition` and `check_edition` read and write no listed file for a
133
+ manifest `decode_manifest` refuses: an unsafe `files` path or a
134
+ `data_path` outside the product raises `ManifestError` first.
131
135
  - `copy_edition` skips a `data/` file already present with the same size and
132
136
  digest, raises when a copied file does not match, and refuses a destination
133
137
  that is already sealed. Every file it copied is fsynced before the manifest
@@ -3,7 +3,7 @@
3
3
  "$defs": {
4
4
  "Manifest": {
5
5
  "title": "Manifest",
6
- "description": "`manifest.json`: written last, so a directory without one is an unsealed edition.\n\nAttributes:\n format_version: The manifest format, ``major.minor``.\n product_id: The producer's stable name for the product, kept across\n editions. Identifies *which* product, never which edition.\n edition_id: A UUIDv7 minted when the edition's build starts, and the\n name of its directory. Changes on every edition, never on a read.\n previous: The edition this one was built from, or None for the\n first of its product.\n created_at: When the manifest was written (UTC).\n producer: What sealed the edition.\n sdmxlib_version: The sdmxlib that wrote the manifest.\n schema_version: The store schema of ``metadata.duckdb``, checked before the\n file is opened.\n duckdb_version: The DuckDB release that wrote the DuckDB files.\n duckdb_storage_version: The newest storage version among the DuckDB\n files, as DuckDB reads it from each file's active database header\n (`storage_version_of`). A reader refuses one newer than its engine\n before opening any file. sdmxlib 0.73.0 recorded 999 for a file in\n DuckDB 2.0's format; a reader reads the headers for that.\n ducklake_version: The DuckLake extension that wrote ``tables.ducklake``,\n or None for an edition without one.\n ducklake_spec_version: The DuckLake format the catalog records, or\n None for an edition without one. A reader refuses one newer\n than its own.\n data_path: Where the data files live, relative to the edition\n directory: `DATA_PATH`.\n files: Every file of the edition but the manifest, and every data\n file its lake catalog references, sorted by root and path.\n bindings: Observation counts per bound dataflow, sorted by URN.\n artefacts: Every maintainable artefact in the store but the\n bindings, sorted by URN.\n canonical_form: The version of the canonical text every fingerprint\n here hashes. Fingerprints at different forms are never compared.\n content_fingerprint: The product fingerprint: every artefact\n fingerprint and every table fingerprint, so two editions with\n equal content have equal ones.\n producer_fields: Producer-specific fields, carried and not interpreted.\n extensions: Sections owned by other packages (statcatlib's search\n index, say), by name; carried and not interpreted.\n provenance: Where a fetched edition came from; None for\n one built from data the producer holds.",
6
+ "description": "`manifest.json`: written last, so a directory without one is an unsealed edition.\n\nAttributes:\n format_version: The manifest format, ``major.minor``.\n product_id: The producer's stable name for the product, kept across\n editions. Identifies *which* product, never which edition.\n edition_id: A UUIDv7 minted when the edition's build starts, and the\n name of its directory. Changes on every edition, never on a read.\n previous: The edition this one was built from, or None for the\n first of its product.\n created_at: When the manifest was written (UTC).\n producer: What sealed the edition.\n sdmxlib_version: The sdmxlib that wrote the manifest.\n schema_version: The store schema of ``metadata.duckdb``, checked before the\n file is opened.\n duckdb_version: The DuckDB release that wrote the DuckDB files.\n duckdb_storage_version: The newest storage version among the DuckDB\n files, as DuckDB reads it from each file's active database header\n (`storage_version_of`). A reader refuses one newer than its engine\n before opening any file. sdmxlib 0.73.0 recorded 999 for a file in\n DuckDB 2.0's format; a reader reads the headers for that.\n ducklake_version: The DuckLake extension that wrote ``tables.ducklake``,\n or None for an edition without one.\n ducklake_spec_version: The DuckLake format the catalog records, or\n None for an edition without one. A reader refuses one newer\n than its own.\n data_path: Where the data files live, relative to the edition\n directory: `DATA_PATH`. `decode_manifest` refuses one that\n leaves the product directory.\n files: Every file of the edition but the manifest, and every data\n file its lake catalog references, sorted by root and path.\n bindings: Observation counts per bound dataflow, sorted by URN.\n artefacts: Every maintainable artefact in the store but the\n bindings, sorted by URN.\n canonical_form: The version of the canonical text every fingerprint\n here hashes. Fingerprints at different forms are never compared.\n content_fingerprint: The product fingerprint: every artefact\n fingerprint and every table fingerprint, so two editions with\n equal content have equal ones.\n producer_fields: Producer-specific fields, carried and not interpreted.\n extensions: Sections owned by other packages (statcatlib's search\n index, say), by name; carried and not interpreted.\n provenance: Where a fetched edition came from; None for\n one built from data the producer holds.",
7
7
  "type": "object",
8
8
  "properties": {
9
9
  "format_version": {
@@ -166,7 +166,7 @@
166
166
  },
167
167
  "EditionFile": {
168
168
  "title": "EditionFile",
169
- "description": "One file of the edition: where it is, its digests, and its placement tier.\n\nAttributes:\n path: ``/``-separated, relative to the directory `root` names.\n size: In bytes.\n digests: The file's digests by algorithm, each lowercase hex: every\n one of `REQUIRED_DIGESTS`, and any other an algorithm name keys.\n An object store reports the same digests in base64: Azure's\n ``Content-MD5``, S3's ``x-amz-checksum-crc32c``, GCS's ``crc32c``.\n root: ``edition`` for a file in the edition directory, ``data`` for\n a data file under the manifest's `data_path`.\n tier: The producer's default placement: ``required`` pulled before a\n server is ready, ``lazy`` pulled to local disk on first use,\n ``remote`` read by byte range.\n carried_from: The edition id of the manifest `size` and the digests\n were copied from, for a data file an earlier edition listed; None\n for one hashed by this edition.",
169
+ "description": "One file of the edition: where it is, its digests, and its placement tier.\n\nAttributes:\n path: ``/``-separated, relative to the directory `root` names.\n Every segment is a plain name: not empty, ``.`` or ``..``, and\n free of backslashes and NUL. `decode_manifest` refuses any\n other path.\n size: In bytes.\n digests: The file's digests by algorithm, each lowercase hex: every\n one of `REQUIRED_DIGESTS`, and any other an algorithm name keys.\n An object store reports the same digests in base64: Azure's\n ``Content-MD5``, S3's ``x-amz-checksum-crc32c``, GCS's ``crc32c``.\n root: ``edition`` for a file in the edition directory, ``data`` for\n a data file under the manifest's `data_path`.\n tier: The producer's default placement: ``required`` pulled before a\n server is ready, ``lazy`` pulled to local disk on first use,\n ``remote`` read by byte range.\n carried_from: The edition id of the manifest `size` and the digests\n were copied from, for a data file an earlier edition listed; None\n for one hashed by this edition.",
170
170
  "type": "object",
171
171
  "properties": {
172
172
  "path": {
@@ -59,13 +59,15 @@ statcatlib owns the writer. sdmxlib holds no blob client: the reader takes a
59
59
  base's and refuses a base more than `MAX_BASE_AHEAD` ahead; `next_root`
60
60
  takes `previous_bytes` and `changes` together and writes both history
61
61
  fields; `entry_record` is a change item's copy of a `LeafEntry`.
62
- - Reading (`_reader.py`): `LiveInventory(fetch, schema_version=...)` and
63
- `FullInventory(fetch)`, each with `refresh()`, `seq`, `restore_epoch` and
64
- `skipped`; `LiveInventory.editions()`, `products()` and `head(product)`
62
+ - Reading (`_reader.py`): `LiveInventory(fetch, schema_version=...,
63
+ leaf_threads=...)` and `FullInventory(fetch, leaf_threads=...)`
64
+ (`DEFAULT_LEAF_THREADS`, 64), each with `refresh()`, `seq`, `restore_epoch`
65
+ and `skipped`; `LiveInventory.editions()`, `products()` and `head(product)`
65
66
  return `LiveEdition`s, which carry the entry's `dataflows`, `pull_bytes`
66
67
  and `artefacts` (None when absent); `FullInventory.root`, `embargo`,
67
68
  `retired`, `products()`, `leaf()`, `leaves()` and `entries()`. `local_fetch(dir)`
68
- is a `Fetch` over a directory.
69
+ is a `Fetch` over a directory. A `Fetch` may be called from several threads
70
+ at once.
69
71
  - `repairable(journal, leaves, retired)` (`_rules.py`): the seal-journal
70
72
  entries the narrow repair (spec §6.7) may record: those the newest version
71
73
  neither names nor tombstones.
@@ -73,7 +75,9 @@ statcatlib owns the writer. sdmxlib holds no blob client: the reader takes a
73
75
  `commit` raising `ConflictError` on a stale base, `commit_interrupted`,
74
76
  `reader`, `hint_behind`, `restore_to`, `restore_with_new_epoch`), the
75
77
  `Snapshot` it returns, the checks in `CHECKS`, and `run(new)`, which runs
76
- every check against fresh backends. An implementation of the protocol
78
+ every check against fresh backends. The routing check reads back the
79
+ `artefacts` of a structure entry, a reinstated one and a data entry, since
80
+ a writer fills them in every entry from Phase 5 (spec §6.3). An implementation of the protocol
77
81
  (statcatlib's writer) runs it as a test. A writer of the history fields
78
82
  also provides a `HistoryBackend` (`stage_2`, `fetch`, `put`, `commit_at`)
79
83
  and runs `run_history`, the stage-1 checks in `HISTORY_CHECKS`. The §6.9
@@ -93,6 +97,14 @@ statcatlib owns the writer. sdmxlib holds no blob client: the reader takes a
93
97
  `restore_epoch` changed; it verifies the root `CURRENT` names, probes
94
98
  `seq + 1` onward without listing, and skips an invalid root into
95
99
  `skipped`. A leaf must hash to its name.
100
+ - `LiveInventory.editions()`, `LiveInventory.products()` and
101
+ `FullInventory.leaves()` make one GET per leaf the reader does not hold. With
102
+ two or more to fetch and `leaf_threads` above 1, the GETs run on a pool that
103
+ ends before the call returns or raises. Only `fetch` runs on a worker: the
104
+ calling thread checks, decodes and holds each leaf in sorted product order.
105
+ The first bad leaf in that order raises and the leaves before it stay held,
106
+ as in a sequential read. Fetches in flight then finish, and fetches not yet
107
+ started are cancelled. A read of one product fetches in the calling thread.
96
108
  - With `CURRENT` present and verifying, a reader fetches only `CURRENT` and
97
109
  roots. Otherwise it reads `catalog.json` and, on 2.x, `inventory/HISTORY`;
98
110
  takes the epoch from `HISTORY` (2.x) or `catalog.json` (1.x); bounds its
@@ -115,13 +127,14 @@ statcatlib owns the writer. sdmxlib holds no blob client: the reader takes a
115
127
 
116
128
  ## Side Effects
117
129
 
118
- - None: the rules are pure, the readers read only through `fetch`, caching
119
- leaves by hash, and `route` reads only through the `manifest` callable it
120
- is given.
130
+ - None on the catalog: the rules are pure, the readers read only through
131
+ `fetch`, caching leaves by hash, and `route` reads only through the
132
+ `manifest` callable it is given. A read of every product starts up to
133
+ `leaf_threads` threads for its own duration.
121
134
 
122
135
  ## Verification
123
136
 
124
- - `uv run pytest -m unit tests/unit/test_inventory.py tests/unit/test_inventory_history.py tests/unit/test_inventory_reader_fallback.py tests/unit/test_inventory_history_schemas.py tests/unit/test_inventory_conformance.py tests/unit/test_inventory_routing.py`.
137
+ - `uv run pytest -m unit tests/unit/test_inventory.py tests/unit/test_inventory_history.py tests/unit/test_inventory_reader_fallback.py tests/unit/test_inventory_history_schemas.py tests/unit/test_inventory_conformance.py tests/unit/test_inventory_routing.py tests/unit/test_inventory_concurrent_leaves.py`.
125
138
  The conformance suite runs against two backends in
126
139
  `tests/support/inventory_backends.py`: the file protocol, written by the
127
140
  reference writer in `tests/support/inventory.py` (it writes the history
@@ -76,7 +76,14 @@ from sdmxlib.inventory._format import (
76
76
  validate_leaf,
77
77
  validate_root,
78
78
  )
79
- from sdmxlib.inventory._reader import Fetch, FullInventory, LiveEdition, LiveInventory, local_fetch
79
+ from sdmxlib.inventory._reader import (
80
+ DEFAULT_LEAF_THREADS,
81
+ Fetch,
82
+ FullInventory,
83
+ LiveEdition,
84
+ LiveInventory,
85
+ local_fetch,
86
+ )
80
87
  from sdmxlib.inventory._routing import Route, RoutingFields, manifest_records, route, routing_fields, verify_entry
81
88
  from sdmxlib.inventory._rules import (
82
89
  CREATED_AT_STEP,
@@ -106,6 +113,7 @@ __all__ = [
106
113
  "CATALOG_NAME",
107
114
  "CREATED_AT_STEP",
108
115
  "CURRENT_NAME",
116
+ "DEFAULT_LEAF_THREADS",
109
117
  "HISTORY_DIR",
110
118
  "HISTORY_FORMAT",
111
119
  "HISTORY_NAME",
@@ -329,11 +329,12 @@ class StructureSource(msgspec.Struct, frozen=True, kw_only=True):
329
329
 
330
330
 
331
331
  class PartialRecord(msgspec.Struct, frozen=True, kw_only=True, omit_defaults=True):
332
- """One artefact of an edition as its manifest fingerprints it.
332
+ """One artefact of an edition as its manifest fingerprints it: a full artefact or a partial.
333
333
 
334
334
  Attributes:
335
335
  fingerprint: The artefact fingerprint.
336
- partial_of: For a partial, the fingerprint of the full artefact it was cut from.
336
+ partial_of: For a partial, the fingerprint of the full artefact it was
337
+ cut from; absent for a full artefact.
337
338
  """
338
339
 
339
340
  fingerprint: str
@@ -356,9 +357,12 @@ class LeafEntry(msgspec.Struct, frozen=True, kw_only=True):
356
357
  authoritative.
357
358
  artefacts: The artefact records of its manifest, by URN: every full
358
359
  artefact with its fingerprint, and every partial with its
359
- fingerprint and ``partial_of``. Optional in 1.x; a writer fills it
360
- in every structure entry, and an entry without it is read from
361
- its manifest (spec §6.3).
360
+ fingerprint and ``partial_of``. Optional in 1.x. A writer fills
361
+ it in every structure entry, and from Phase 5 in every entry it
362
+ records, so the cross-product rules read it in place of the
363
+ manifest; a filled value equals the records of the manifest
364
+ ``manifest_sha256`` names. An entry without it is read from its
365
+ manifest (spec §6.3).
362
366
  dataflows: A routing field: the URNs of its manifest's bindings,
363
367
  sorted and without duplicates; empty for a structure edition.
364
368
  Unset in an entry without the routing fields.
@@ -3,7 +3,8 @@
3
3
  sdmxlib holds no blob client (spec §11.5): a reader is given
4
4
  ``fetch(path) -> bytes | None``, a path relative to the catalog root to its
5
5
  bytes, or None when nothing is there. `local_fetch` reads a directory; a
6
- pod passes one over ``obstore`` or ``fsspec``.
6
+ pod passes one over ``obstore`` or ``fsspec``. A reader may call `fetch` from
7
+ several threads at once, so a `fetch` must be safe to call that way.
7
8
 
8
9
  The read protocol (spec §6.6):
9
10
 
@@ -27,6 +28,13 @@ has no ``HISTORY``.
27
28
  A root that does not validate is skipped and reported in `skipped`, and the
28
29
  last valid version is kept.
29
30
 
31
+ A read of every product (`LiveInventory.editions`, `LiveInventory.products`,
32
+ `FullInventory.leaves`) fetches the leaves the reader does not hold on a pool
33
+ of ``leaf_threads`` threads, then checks and decodes them in the calling thread
34
+ in sorted product order. The first bad leaf in that order raises. The leaves
35
+ before it stay held, and fetches not yet started are cancelled. A read of one
36
+ product, and a read with one leaf to fetch, fetch in the calling thread.
37
+
30
38
  Two views, constructed separately so a public reader holds nothing it must
31
39
  filter:
32
40
 
@@ -36,7 +44,8 @@ filter:
36
44
  and the operational objects.
37
45
  """
38
46
 
39
- from collections.abc import Callable, Mapping
47
+ from collections.abc import Callable, Iterable, Mapping
48
+ from concurrent.futures import ThreadPoolExecutor
40
49
  from pathlib import Path
41
50
  from typing import Self
42
51
 
@@ -68,8 +77,15 @@ from sdmxlib.inventory._format import (
68
77
  from sdmxlib.storage.schema import SCHEMA_VERSION
69
78
 
70
79
  #: A path under the catalog root to its bytes, or None when nothing is there.
80
+ #: A reader calls it from several threads at once, each on a worker thread that
81
+ #: does not inherit the caller's context variables, unless ``leaf_threads`` is 1.
71
82
  type Fetch = Callable[[str], bytes | None]
72
83
 
84
+ #: The threads a reader fetches leaves on unless told otherwise. It comes from an
85
+ #: estimate at an assumed 10 ms a request (spec §6.5), and no real store has
86
+ #: measured it.
87
+ DEFAULT_LEAF_THREADS = 64
88
+
73
89
 
74
90
  def local_fetch(root: str | Path) -> Fetch:
75
91
  """A `Fetch` over a local catalog directory."""
@@ -118,8 +134,22 @@ class LiveEdition(msgspec.Struct, frozen=True, kw_only=True):
118
134
  class _Chain:
119
135
  """The read protocol over `fetch`: the newest valid root, never behind the floor."""
120
136
 
121
- def __init__(self, fetch: Fetch) -> None:
137
+ def __init__(self, fetch: Fetch, *, leaf_threads: int = DEFAULT_LEAF_THREADS) -> None:
138
+ """Read through `fetch`.
139
+
140
+ Args:
141
+ fetch: The reader's only route to the catalog.
142
+ leaf_threads: The threads a read of every product fetches leaves
143
+ on. 1 fetches each in the calling thread.
144
+
145
+ Raises:
146
+ ValueError: If `leaf_threads` is below 1.
147
+ """
148
+ if leaf_threads < 1:
149
+ msg = f"leaf_threads must be at least 1, got {leaf_threads}"
150
+ raise ValueError(msg)
122
151
  self._fetch = fetch
152
+ self._leaf_threads = leaf_threads
123
153
  self._root: Root | None = None
124
154
  self._leaves: dict[str, Leaf] = {}
125
155
  self.skipped: list[str] = []
@@ -257,7 +287,10 @@ class _Chain:
257
287
  cached = self._leaves.get(ref.leaf_sha256)
258
288
  if cached is not None:
259
289
  return cached
260
- raw = self._fetch(ref.leaf)
290
+ return self._keep_leaf(ref, self._fetch(ref.leaf))
291
+
292
+ def _keep_leaf(self, ref: LeafRef, raw: bytes | None) -> Leaf:
293
+ """Check `raw` against `ref`, decode it and hold the leaf by its hash."""
261
294
  if raw is None:
262
295
  msg = f"{ref.leaf} is missing"
263
296
  raise InventoryError(msg)
@@ -268,9 +301,38 @@ class _Chain:
268
301
  self._leaves[ref.leaf_sha256] = leaf
269
302
  return leaf
270
303
 
304
+ def _read_leaves(self, refs: Iterable[LeafRef]) -> None:
305
+ """Fetch the leaves of `refs` not held on a pool, and hold them, in the order of `refs`.
306
+
307
+ Only `fetch` runs on a worker, so ``_leaves`` is written from the
308
+ calling thread alone. Checking in order makes the error the one a
309
+ sequential read raises, and holds the same leaves before it. With fewer
310
+ than two leaves to fetch, or one thread, it does nothing, and `_leaf`
311
+ fetches each in the calling thread.
312
+ """
313
+ missing = {ref.leaf_sha256: ref for ref in refs if ref.leaf_sha256 not in self._leaves}
314
+ if len(missing) < 2 or self._leaf_threads == 1:
315
+ return
316
+ pool = ThreadPoolExecutor(self._leaf_threads, thread_name_prefix="sdmxlib-inventory-leaf")
317
+ try:
318
+ reads = [(ref, pool.submit(self._fetch, ref.leaf)) for ref in missing.values()]
319
+ for ref, read in reads:
320
+ self._keep_leaf(ref, read.result())
321
+ finally:
322
+ pool.shutdown(cancel_futures=True)
323
+
324
+ def _products_read(self) -> list[tuple[str, LeafRef]]:
325
+ """The held version's products in sorted order, with their leaves fetched."""
326
+ products = sorted(self._current.products.items())
327
+ self._read_leaves(ref for _, ref in products)
328
+ return products
329
+
271
330
 
272
331
  class FullInventory(_Chain):
273
- """Every entry of every product, and the tombstones: for the release job and the operational objects."""
332
+ """Every entry of every product, and the tombstones: for the release job and the operational objects.
333
+
334
+ It takes the same arguments as `LiveInventory`, without ``schema_version``.
335
+ """
274
336
 
275
337
  @property
276
338
  def root(self) -> Root:
@@ -301,7 +363,7 @@ class FullInventory(_Chain):
301
363
 
302
364
  def leaves(self) -> Mapping[str, Leaf]:
303
365
  """Every product's leaf, by product."""
304
- return {p: self._leaf(ref) for p, ref in sorted(self._current.products.items())}
366
+ return {p: self._leaf(ref) for p, ref in self._products_read()}
305
367
 
306
368
  def entries(self, product_id: str) -> tuple[LeafEntry, ...]:
307
369
  """The product's entries in every state."""
@@ -315,9 +377,21 @@ class LiveInventory(_Chain):
315
377
  through it needs filtering.
316
378
  """
317
379
 
318
- def __init__(self, fetch: Fetch, *, schema_version: str = SCHEMA_VERSION) -> None:
319
- """Read through `fetch`, routing to the live editions at `schema_version` (this sdmxlib's by default)."""
320
- super().__init__(fetch)
380
+ def __init__(
381
+ self, fetch: Fetch, *, schema_version: str = SCHEMA_VERSION, leaf_threads: int = DEFAULT_LEAF_THREADS
382
+ ) -> None:
383
+ """Read through `fetch`, routing to the live editions at `schema_version` (this sdmxlib's by default).
384
+
385
+ Args:
386
+ fetch: The reader's only route to the catalog.
387
+ schema_version: The store schema to route to.
388
+ leaf_threads: The threads a read of every product fetches leaves
389
+ on. 1 fetches each in the calling thread.
390
+
391
+ Raises:
392
+ ValueError: If `leaf_threads` is below 1.
393
+ """
394
+ super().__init__(fetch, leaf_threads=leaf_threads)
321
395
  self.schema_version = schema_version
322
396
 
323
397
  def _live(self, product_id: str, ref: LeafRef) -> LiveEdition | None:
@@ -339,7 +413,7 @@ class LiveInventory(_Chain):
339
413
 
340
414
  def editions(self) -> Mapping[str, LiveEdition]:
341
415
  """Each product's live edition, by product; a product with none is absent."""
342
- found = {p: self._live(p, ref) for p, ref in sorted(self._current.products.items())}
416
+ found = {p: self._live(p, ref) for p, ref in self._products_read()}
343
417
  return {p: e for p, e in found.items() if e is not None}
344
418
 
345
419
  def products(self) -> list[str]:
@@ -325,6 +325,11 @@ _FLOWS = (
325
325
  _HOME = "urn:sdmx:org.sdmx.infomodel.codelist.Codelist=STC:CL_GEO(1.0)"
326
326
  _CUT = "urn:sdmx:org.sdmx.infomodel.codelist.Codelist=STC:CL_FREQ(1.0)"
327
327
  _RECORDS = {_HOME: PartialRecord(fingerprint="f1"), _CUT: PartialRecord(fingerprint="f2", partial_of="f3")}
328
+ #: A data edition's records: its full data structure and a partial cut from the structure home.
329
+ _DATA_RECORDS = {
330
+ "urn:sdmx:org.sdmx.infomodel.datastructure.DataStructure=STC:DSD_A(1.0)": PartialRecord(fingerprint="f4"),
331
+ _CUT: PartialRecord(fingerprint="f5", partial_of="f1"),
332
+ }
328
333
 
329
334
 
330
335
  def _routed(leaf: Leaf | None, edition: str, previous: str | None) -> Leaf:
@@ -358,7 +363,9 @@ def _routing_of(snapshot: Snapshot | None, product: str, edition: str) -> object
358
363
  def check_the_routing_fields_survive_a_commit_and_a_reinstate(new: Callable[[], Backend]) -> None:
359
364
  """An entry's routing fields and ``artefacts`` read back as recorded, and a reinstated entry keeps them.
360
365
 
361
- An entry recorded without them reads with them absent (spec §6.3).
366
+ A data entry's ``artefacts`` read back as a structure entry's do, since
367
+ a writer fills them in every entry from Phase 5. An entry recorded
368
+ without them reads with them absent (spec §6.3).
362
369
  """
363
370
  backend = new()
364
371
  data = record(
@@ -372,6 +379,7 @@ def check_the_routing_fields_survive_a_commit_and_a_reinstate(new: Callable[[],
372
379
  schema_version=SCHEMA_VERSION,
373
380
  embargo=False,
374
381
  now=_T0 + _MINUTE,
382
+ artefacts=_DATA_RECORDS,
375
383
  dataflows=_FLOWS,
376
384
  pull_bytes=13131776,
377
385
  )
@@ -383,7 +391,7 @@ def check_the_routing_fields_survive_a_commit_and_a_reinstate(new: Callable[[],
383
391
  if bare != (msgspec.UNSET, msgspec.UNSET, None):
384
392
  msg = f"{who} read routing fields {bare} into an entry recorded without them"
385
393
  raise _fail(msg)
386
- if (found := _routing_of(snapshot, "d", _edition(2))) != (tuple(sorted(_FLOWS)), 13131776, None):
394
+ if (found := _routing_of(snapshot, "d", _edition(2))) != (tuple(sorted(_FLOWS)), 13131776, _DATA_RECORDS):
387
395
  msg = f"{who} read the data entry's routing fields as {found}"
388
396
  raise _fail(msg)
389
397
  if (found := _routing_of(snapshot, "s", _edition(3))) != ((), 4096, _RECORDS):
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "LeafEntry": {
43
43
  "title": "LeafEntry",
44
- "description": "One edition of a product, as the Inventory records it.\n\nAttributes:\n edition_id: The edition.\n previous: Its manifest's ``previous``.\n state: Its state (spec §6.4).\n manifest_sha256: The SHA-256 of its ``manifest.json``.\n schema_version: The store schema it was written at.\n state_changed_at: When it took its state.\n release_at: For an embargoed entry, when it may be released, or None\n for no scheduled release; None in every other state.\n structure_source: Where its structures came from, when a registry is\n authoritative.\n artefacts: The artefact records of its manifest, by URN: every full\n artefact with its fingerprint, and every partial with its\n fingerprint and ``partial_of``. Optional in 1.x; a writer fills it\n in every structure entry, and an entry without it is read from\n its manifest (spec §6.3).\n dataflows: A routing field: the URNs of its manifest's bindings,\n sorted and without duplicates; empty for a structure edition.\n Unset in an entry without the routing fields.\n pull_bytes: A routing field: the sum of ``size`` over its manifest's\n ``required``-tier files. Unset in an entry without the routing\n fields.",
44
+ "description": "One edition of a product, as the Inventory records it.\n\nAttributes:\n edition_id: The edition.\n previous: Its manifest's ``previous``.\n state: Its state (spec §6.4).\n manifest_sha256: The SHA-256 of its ``manifest.json``.\n schema_version: The store schema it was written at.\n state_changed_at: When it took its state.\n release_at: For an embargoed entry, when it may be released, or None\n for no scheduled release; None in every other state.\n structure_source: Where its structures came from, when a registry is\n authoritative.\n artefacts: The artefact records of its manifest, by URN: every full\n artefact with its fingerprint, and every partial with its\n fingerprint and ``partial_of``. Optional in 1.x. A writer fills\n it in every structure entry, and from Phase 5 in every entry it\n records, so the cross-product rules read it in place of the\n manifest; a filled value equals the records of the manifest\n ``manifest_sha256`` names. An entry without it is read from its\n manifest (spec §6.3).\n dataflows: A routing field: the URNs of its manifest's bindings,\n sorted and without duplicates; empty for a structure edition.\n Unset in an entry without the routing fields.\n pull_bytes: A routing field: the sum of ``size`` over its manifest's\n ``required``-tier files. Unset in an entry without the routing\n fields.",
45
45
  "type": "object",
46
46
  "properties": {
47
47
  "edition_id": {
@@ -169,7 +169,7 @@
169
169
  },
170
170
  "PartialRecord": {
171
171
  "title": "PartialRecord",
172
- "description": "One artefact of an edition as its manifest fingerprints it.\n\nAttributes:\n fingerprint: The artefact fingerprint.\n partial_of: For a partial, the fingerprint of the full artefact it was cut from.",
172
+ "description": "One artefact of an edition as its manifest fingerprints it: a full artefact or a partial.\n\nAttributes:\n fingerprint: The artefact fingerprint.\n partial_of: For a partial, the fingerprint of the full artefact it was\n cut from; absent for a full artefact.",
173
173
  "type": "object",
174
174
  "properties": {
175
175
  "fingerprint": {
@@ -64,7 +64,11 @@ of the store that edition ships (`_trim.py`).
64
64
  then `decode_manifest(raw, source)`, split so `LocalRegistry.edition` hashes
65
65
  the bytes it parses; `source` is a `str` or `Path` the errors name, and
66
66
  `sdmxlib.edition` exports the function for bytes read from object storage.
67
- The module also defines `ManifestError`,
67
+ `decode_manifest` ends with `refuse_unsafe_paths`, which raises
68
+ `ManifestError` for a `files` path that is empty or absolute or holds an
69
+ empty, `.`, `..`, backslash or NUL segment, for an `edition` entry named
70
+ `manifest.json`, and for a `data_path` that leaves the product directory
71
+ (GH-380). The module also defines `ManifestError`,
68
72
  `StoreFormatError`, `MANIFEST_NAME`, `FORMAT_VERSION`, `DATA_PATH`,
69
73
  `DUCKLAKE_SPEC_VERSION`, `edition_storage_version`,
70
74
  `engine_storage_version` and `generate_schema` (the manifest's JSON Schema).
@@ -15,10 +15,12 @@ proof the files are the ones the manifest describes, which the edition checker
15
15
  verifies (GH-67).
16
16
  """
17
17
 
18
+ import posixpath
18
19
  import tempfile
19
20
  from datetime import datetime
20
- from pathlib import Path
21
+ from pathlib import Path, PurePosixPath, PureWindowsPath
21
22
  from typing import Annotated, Literal
23
+ from urllib.parse import urlsplit
22
24
 
23
25
  import duckdb
24
26
  import msgspec
@@ -240,6 +242,9 @@ class EditionFile(msgspec.Struct, frozen=True, kw_only=True):
240
242
 
241
243
  Attributes:
242
244
  path: ``/``-separated, relative to the directory `root` names.
245
+ Every segment is a plain name: not empty, ``.`` or ``..``, and
246
+ free of backslashes and NUL. `decode_manifest` refuses any
247
+ other path.
243
248
  size: In bytes.
244
249
  digests: The file's digests by algorithm, each lowercase hex: every
245
250
  one of `REQUIRED_DIGESTS`, and any other an algorithm name keys.
@@ -381,7 +386,8 @@ class Manifest(msgspec.Struct, frozen=True, kw_only=True):
381
386
  None for an edition without one. A reader refuses one newer
382
387
  than its own.
383
388
  data_path: Where the data files live, relative to the edition
384
- directory: `DATA_PATH`.
389
+ directory: `DATA_PATH`. `decode_manifest` refuses one that
390
+ leaves the product directory.
385
391
  files: Every file of the edition but the manifest, and every data
386
392
  file its lake catalog references, sorted by root and path.
387
393
  bindings: Observation counts per bound dataflow, sorted by URN.
@@ -449,8 +455,9 @@ def read_manifest(root: Path) -> Manifest:
449
455
  The manifest.
450
456
 
451
457
  Raises:
452
- ManifestError: If there is none, it is malformed, or its major format
453
- version is not one this build reads.
458
+ ManifestError: If there is none, it is malformed, its major format
459
+ version is not one this build reads, or a path in it could name a
460
+ file outside the product.
454
461
  """
455
462
  return decode_manifest(read_manifest_bytes(root), root / MANIFEST_NAME)
456
463
 
@@ -482,8 +489,9 @@ def decode_manifest(raw: bytes, source: str | Path) -> Manifest:
482
489
  The manifest.
483
490
 
484
491
  Raises:
485
- ManifestError: If it is malformed, or its major format version is not
486
- one this build reads.
492
+ ManifestError: If it is malformed, its major format version is not
493
+ one this build reads, or a path in it could name a file outside
494
+ the product (`refuse_unsafe_paths`).
487
495
  """
488
496
  try:
489
497
  found = msgspec.json.decode(raw, type=_FormatProbe).format_version
@@ -507,7 +515,60 @@ def decode_manifest(raw: bytes, source: str | Path) -> Manifest:
507
515
  )
508
516
  raise ManifestError(msg)
509
517
  try:
510
- return msgspec.json.decode(raw, type=Manifest)
518
+ manifest = msgspec.json.decode(raw, type=Manifest)
511
519
  except msgspec.MsgspecError as exc:
512
520
  msg = f"{source} is not a valid format {found} manifest: {exc}"
513
521
  raise ManifestError(msg) from exc
522
+ refuse_unsafe_paths(manifest, source)
523
+ return manifest
524
+
525
+
526
+ def refuse_unsafe_paths(manifest: Manifest, source: str | Path) -> None:
527
+ """Refuse a manifest whose ``files`` or ``data_path`` could name a file outside its product.
528
+
529
+ A `files` path must be relative, with every ``/``-separated segment
530
+ non-empty, free of backslashes and NUL, and neither ``.`` nor ``..``; an
531
+ ``edition`` entry must not be the manifest itself. `data_path` must be
532
+ relative, free of backslashes and NUL, and stay inside the product directory
533
+ once resolved against the edition directory. statcatlib's pull applies
534
+ the same rule (``store/blob.py``).
535
+
536
+ Raises:
537
+ ManifestError: Naming `source` and the first path refused.
538
+ """
539
+ for entry in manifest.files:
540
+ if not _is_safe_path(entry.path) or (entry.root == "edition" and entry.path == MANIFEST_NAME):
541
+ msg = (
542
+ f"{source} files lists the path {entry.path!r} under the {entry.root} root, which could name a "
543
+ "file outside the edition; a path is relative and every segment a plain name"
544
+ )
545
+ raise ManifestError(msg)
546
+ if not _stays_in_product(manifest.data_path):
547
+ msg = f"{source} has data_path {manifest.data_path!r}, which leads outside the product directory"
548
+ raise ManifestError(msg)
549
+
550
+
551
+ def _is_relative(path: str) -> bool:
552
+ """Whether `path` has no root and no drive, read as a POSIX path and as a Windows one."""
553
+ return not PurePosixPath(path).anchor and not PureWindowsPath(path).anchor
554
+
555
+
556
+ def _is_plain_name(name: str) -> bool:
557
+ """Whether `name` is one path segment: not empty, no separator, no NUL, not ``.`` or ``..``."""
558
+ return bool(name) and not {"/", "\\", "\0"} & set(name) and name not in {".", ".."}
559
+
560
+
561
+ def _is_safe_path(path: str) -> bool:
562
+ """Whether `path` stays below the directory it is joined to: relative, with only plain segments."""
563
+ return _is_relative(path) and all(_is_plain_name(part) for part in path.split("/"))
564
+
565
+
566
+ def _stays_in_product(data_path: str) -> bool:
567
+ """Whether `data_path`, resolved against an edition directory, names a directory in its product.
568
+
569
+ The edition directory is one segment below the product directory, so a
570
+ stand-in segment resolves it the same way for every edition id.
571
+ """
572
+ if not _is_relative(data_path) or urlsplit(data_path).scheme or {"\\", "\0"} & set(data_path):
573
+ return False
574
+ return posixpath.normpath(posixpath.join("edition", data_path)).split("/")[0] != ".."
File without changes
File without changes
File without changes
File without changes