sdmxlib 0.84.0__tar.gz → 0.86.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 (227) hide show
  1. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/PKG-INFO +1 -1
  2. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/pyproject.toml +1 -1
  3. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/pyproject.toml.orig +1 -1
  4. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/edition/EGM.md +10 -2
  5. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/edition/__init__.py +4 -1
  6. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/edition/_check.py +61 -15
  7. sdmxlib-0.86.0/src/sdmxlib/inventory/EGM.md +131 -0
  8. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/inventory/__init__.py +74 -2
  9. sdmxlib-0.86.0/src/sdmxlib/inventory/_format.py +1030 -0
  10. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/inventory/_reader.py +107 -25
  11. sdmxlib-0.86.0/src/sdmxlib/inventory/_routing.py +149 -0
  12. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/inventory/_rules.py +254 -11
  13. sdmxlib-0.86.0/src/sdmxlib/inventory/conformance.py +735 -0
  14. sdmxlib-0.86.0/src/sdmxlib/inventory/schemas/catalog-2.0.schema.json +47 -0
  15. sdmxlib-0.86.0/src/sdmxlib/inventory/schemas/catalog.schema.json +43 -0
  16. sdmxlib-0.86.0/src/sdmxlib/inventory/schemas/history.schema.json +94 -0
  17. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/inventory/schemas/leaf.schema.json +21 -2
  18. sdmxlib-0.86.0/src/sdmxlib/inventory/schemas/root-1.2.schema.json +378 -0
  19. sdmxlib-0.86.0/src/sdmxlib/inventory/schemas/root.schema.json +375 -0
  20. sdmxlib-0.86.0/src/sdmxlib/inventory/schemas/segment-header.schema.json +163 -0
  21. sdmxlib-0.86.0/src/sdmxlib/inventory/schemas/segment-line.schema.json +343 -0
  22. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/storage/EGM.md +4 -2
  23. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/storage/_manifest.py +16 -6
  24. sdmxlib-0.84.0/src/sdmxlib/inventory/EGM.md +0 -80
  25. sdmxlib-0.84.0/src/sdmxlib/inventory/_format.py +0 -411
  26. sdmxlib-0.84.0/src/sdmxlib/inventory/conformance.py +0 -341
  27. sdmxlib-0.84.0/src/sdmxlib/inventory/schemas/catalog.schema.json +0 -26
  28. sdmxlib-0.84.0/src/sdmxlib/inventory/schemas/root.schema.json +0 -164
  29. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/LICENSE +0 -0
  30. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/README.md +0 -0
  31. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/EGM.md +0 -0
  32. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/__init__.py +0 -0
  33. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/_duckdb.py +0 -0
  34. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/_facet_types.xsd +0 -0
  35. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/_facets.py +0 -0
  36. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/_read_errors.py +0 -0
  37. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/_singleflight.py +0 -0
  38. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/_time.py +0 -0
  39. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/api/EGM.md +0 -0
  40. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/api/__init__.py +0 -0
  41. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/api/_freshness.py +0 -0
  42. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/api/client.py +0 -0
  43. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/api/federated.py +0 -0
  44. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/api/policy.py +0 -0
  45. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/api/providers.py +0 -0
  46. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/api/registry.py +0 -0
  47. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/api/session.py +0 -0
  48. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/builders/EGM.md +0 -0
  49. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/builders/__init__.py +0 -0
  50. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/builders/contentconstraint.py +0 -0
  51. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/builders/metadata_annotation.py +0 -0
  52. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/data_store.py +0 -0
  53. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/edition/_availability.py +0 -0
  54. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/edition/_build.py +0 -0
  55. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/edition/_canonical.py +0 -0
  56. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/edition/_copy.py +0 -0
  57. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/edition/_fetch.py +0 -0
  58. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/edition/_finding.py +0 -0
  59. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/edition/_fingerprint.py +0 -0
  60. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/edition/_overlay.py +0 -0
  61. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/edition/_remote.py +0 -0
  62. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/edition/_write.py +0 -0
  63. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/edition/manifest.schema.json +0 -0
  64. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/edition/overlay.schema.json +0 -0
  65. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/EGM.md +0 -0
  66. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/__init__.py +0 -0
  67. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/_arrow.py +0 -0
  68. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/_attachment.py +0 -0
  69. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/_coerce.py +0 -0
  70. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/_index.py +0 -0
  71. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/_positions.py +0 -0
  72. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/_refuse.py +0 -0
  73. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/_tags.py +0 -0
  74. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/data_format.py +0 -0
  75. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/gaps.py +0 -0
  76. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/render.py +0 -0
  77. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_csv/EGM.md +0 -0
  78. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_csv/__init__.py +0 -0
  79. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_csv/reader.py +0 -0
  80. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_csv/writer.py +0 -0
  81. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_json/EGM.md +0 -0
  82. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_json/__init__.py +0 -0
  83. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_json/_data_common.py +0 -0
  84. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_json/_dto.py +0 -0
  85. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_json/_header.py +0 -0
  86. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_json/_losses.py +0 -0
  87. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_json/_periods.py +0 -0
  88. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_json/_resolve.py +0 -0
  89. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_json/_structure_dto.py +0 -0
  90. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_json/_structure_ingest.py +0 -0
  91. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_json/data.py +0 -0
  92. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_json/data_v1.py +0 -0
  93. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_json/data_v2.py +0 -0
  94. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_json/metadata.py +0 -0
  95. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_json/reader.py +0 -0
  96. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_json/structure_values.py +0 -0
  97. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_json/writer.py +0 -0
  98. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_json_1_0/EGM.md +0 -0
  99. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_json_1_0/__init__.py +0 -0
  100. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_json_1_0/writer.py +0 -0
  101. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml/EGM.md +0 -0
  102. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml/__init__.py +0 -0
  103. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml/_allowed_children.py +0 -0
  104. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml/_closed_world.py +0 -0
  105. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml/_common.py +0 -0
  106. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml/_header.py +0 -0
  107. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml/_losses.py +0 -0
  108. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml/_v3_reader.py +0 -0
  109. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml/_v3_writer.py +0 -0
  110. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml21/EGM.md +0 -0
  111. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml21/__init__.py +0 -0
  112. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml21/_providers.py +0 -0
  113. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml21/_synthetic.py +0 -0
  114. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml21/namespaces.py +0 -0
  115. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml21/reader.py +0 -0
  116. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml21/writer.py +0 -0
  117. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml30/EGM.md +0 -0
  118. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml30/__init__.py +0 -0
  119. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml30/metadata.py +0 -0
  120. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml30/namespaces.py +0 -0
  121. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml30/reader.py +0 -0
  122. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml30/writer.py +0 -0
  123. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml31/EGM.md +0 -0
  124. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml31/__init__.py +0 -0
  125. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml31/namespaces.py +0 -0
  126. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml31/reader.py +0 -0
  127. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/formats/sdmx_ml31/writer.py +0 -0
  128. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/inventory/schemas/current.schema.json +0 -0
  129. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/local/EGM.md +0 -0
  130. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/local/__init__.py +0 -0
  131. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/local/_scan.py +0 -0
  132. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/local/data_store.py +0 -0
  133. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/local/engine.py +0 -0
  134. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/local/object_store.py +0 -0
  135. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/local/registry.py +0 -0
  136. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/local/sql.py +0 -0
  137. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/EGM.md +0 -0
  138. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/__init__.py +0 -0
  139. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/_binding.py +0 -0
  140. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/_container.py +0 -0
  141. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/_invariants.py +0 -0
  142. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/_items.py +0 -0
  143. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/_label_match.py +0 -0
  144. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/_rebind.py +0 -0
  145. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/_referenceable.py +0 -0
  146. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/_refshape.py +0 -0
  147. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/_resolvers.py +0 -0
  148. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/_rules.py +0 -0
  149. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/_tree.py +0 -0
  150. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/annotations.py +0 -0
  151. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/base.py +0 -0
  152. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/binding.py +0 -0
  153. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/category.py +0 -0
  154. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/codelist.py +0 -0
  155. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/collections.py +0 -0
  156. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/concept.py +0 -0
  157. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/constraint.py +0 -0
  158. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/convert.py +0 -0
  159. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/dataflow.py +0 -0
  160. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/datastructure.py +0 -0
  161. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/errors.py +0 -0
  162. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/expr.py +0 -0
  163. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/header.py +0 -0
  164. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/hierarchy.py +0 -0
  165. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/in_memory_registry.py +0 -0
  166. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/istring.py +0 -0
  167. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/link.py +0 -0
  168. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/mapping.py +0 -0
  169. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/message.py +0 -0
  170. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/metadata_provision.py +0 -0
  171. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/metadataflow.py +0 -0
  172. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/metadataset.py +0 -0
  173. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/metadatastructure.py +0 -0
  174. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/organisation.py +0 -0
  175. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/provision.py +0 -0
  176. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/ref.py +0 -0
  177. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/registry.py +0 -0
  178. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/representation.py +0 -0
  179. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/rest_api.py +0 -0
  180. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/rollup.py +0 -0
  181. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/urn.py +0 -0
  182. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/validation.py +0 -0
  183. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/valuelist.py +0 -0
  184. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/version.py +0 -0
  185. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/model/version_rewrite.py +0 -0
  186. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/polars.py +0 -0
  187. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/py.typed +0 -0
  188. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/query/EGM.md +0 -0
  189. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/query/__init__.py +0 -0
  190. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/query/_closure.py +0 -0
  191. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/query/_common.py +0 -0
  192. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/query/_compile.py +0 -0
  193. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/query/_edges.py +0 -0
  194. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/query/_execute.py +0 -0
  195. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/query/_expr.py +0 -0
  196. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/query/_joins.py +0 -0
  197. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/query/_plan.py +0 -0
  198. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/query/_pushdown.py +0 -0
  199. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/query/_rebase.py +0 -0
  200. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/query/_rest.py +0 -0
  201. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/query/accessors.py +0 -0
  202. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/query/observations.py +0 -0
  203. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/query/query.py +0 -0
  204. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/query/raw.py +0 -0
  205. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/query/schema.py +0 -0
  206. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/rest.py +0 -0
  207. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/session.py +0 -0
  208. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/sql.py +0 -0
  209. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/storage/__init__.py +0 -0
  210. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/storage/_checked.py +0 -0
  211. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/storage/_columns.py +0 -0
  212. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/storage/_files.py +0 -0
  213. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/storage/_kinds.py +0 -0
  214. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/storage/_layout.py +0 -0
  215. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/storage/_parsed.py +0 -0
  216. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/storage/_projections.py +0 -0
  217. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/storage/_references.py +0 -0
  218. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/storage/_synthetic.py +0 -0
  219. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/storage/_tags.py +0 -0
  220. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/storage/_trim.py +0 -0
  221. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/storage/lazy.py +0 -0
  222. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/storage/readers.py +0 -0
  223. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/storage/resolve.py +0 -0
  224. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/storage/schema.py +0 -0
  225. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/storage/writers.py +0 -0
  226. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/testing.py +0 -0
  227. {sdmxlib-0.84.0 → sdmxlib-0.86.0}/src/sdmxlib/versions.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sdmxlib
3
- Version: 0.84.0
3
+ Version: 0.86.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.84.0"
3
+ version = "0.86.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.84.0"
3
+ version = "0.86.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"
@@ -45,12 +45,15 @@ seals through `seal(extensions=...)`.
45
45
  `references` check also accepts a reference one of the `structures=`
46
46
  editions holds as a full artefact or an item of one
47
47
  (`storage._references.held_targets`; spec §6.5 item 9, GH-351). A data
48
- product's references resolve in its own edition alone.
48
+ product's references resolve in its own edition alone. `references=False`
49
+ skips the `references` check at `receive` and leaves it out of
50
+ `Report.checked`, and raises `ValueError` at `publish` and `open` (GH-371).
51
+ `structures=` then still runs the `partials` check.
49
52
  - `check_on_open` (`_check.py`): runs one profile per call. Without a stamp
50
53
  for this `(product_id, edition id, manifest sha256)` it runs `receive` and writes
51
54
  the stamp when the report is clean; with one it runs `open`. An unreadable
52
55
  manifest, or a `product_id` that cannot name a stamp path, gets a `receive`
53
- check and no stamp.
56
+ check and no stamp. `references=False` goes to its `receive` calls only.
54
57
  - `copy_edition` and `edition_files` (`_copy.py`): copy the files of the chosen
55
58
  tiers and verify each one, and list the paths such a copy needs.
56
59
  - `verify_remote`, `RemoteFile`, `content_md5` and `content_crc32c`
@@ -90,6 +93,7 @@ seals through `seal(extensions=...)`.
90
93
  its availability and for coded-column values outside their enumeration.
91
94
  `seal` and `check_edition(at="publish")` both call it.
92
95
  - Manifest types, re-exported from `storage._manifest`: `read_manifest`,
96
+ `decode_manifest` (the same read from bytes, naming `source` in its errors),
93
97
  `Manifest`, `Producer`, `Provenance`, `EditionFile`, `ArtefactEntry`,
94
98
  `BindingCount`, `Tier`, `ManifestError`, `StoreFormatError`, and the
95
99
  constants `DATA_PATH`, `MANIFEST_NAME`, `SIGNATURE_NAME`, `FORMAT_VERSION`
@@ -130,6 +134,10 @@ seals through `seal(extensions=...)`.
130
134
  exists.
131
135
  - `check_on_open` writes a stamp only after a clean `receive` check, and only
132
136
  to a path made of exactly two plain components under the stamps directory.
137
+ - A stamp satisfies a full `check_on_open` only when its `checked` lists
138
+ `references`. A `references=False` call accepts either stamp. A full call
139
+ that meets a deferred stamp runs `receive`, and replaces the stamp when that
140
+ finds nothing.
133
141
  - `settle_lake` never deletes files from `data/`.
134
142
  - `check_edition`'s `tags` check, at `publish` and `receive`, reports every
135
143
  stored language tag `normalize_tag` would change or refuse: a store built
@@ -6,7 +6,8 @@ edition id, and the ``data/`` every edition shares.
6
6
  minting its edition id; `seal` seals it: a file list with a sha256 per file,
7
7
  observation counts per binding, and the ``edition_id``, the value a cache or
8
8
  an ETag keys on. ``LocalRegistry.edition(edition_dir)`` opens it read-only.
9
- `read_manifest` reads a manifest back, refusing a format it cannot read;
9
+ `read_manifest` reads a manifest back, refusing a format it cannot read, and
10
+ `decode_manifest` does the same for bytes a caller already holds;
10
11
  `check_edition` checks an edition against it and against itself;
11
12
  `copy_edition` copies one elsewhere, manifest last, and `edition_files` lists
12
13
  what such a copy needs for another tool; `verify_remote` checks the
@@ -88,6 +89,7 @@ from sdmxlib.storage._manifest import (
88
89
  SIGNATURE_NAME,
89
90
  StoreFormatError,
90
91
  Tier,
92
+ decode_manifest,
91
93
  read_manifest,
92
94
  )
93
95
 
@@ -133,6 +135,7 @@ __all__ = [
133
135
  "content_crc32c",
134
136
  "content_md5",
135
137
  "copy_edition",
138
+ "decode_manifest",
136
139
  "discard",
137
140
  "edition_files",
138
141
  "effective_token",
@@ -94,6 +94,7 @@ def check_edition(
94
94
  fingerprints: bool | None = None,
95
95
  expect: Manifest | str | Path | None = None,
96
96
  structures: str | Path | Sequence[str | Path] | None = None,
97
+ references: bool = True,
97
98
  extensions: Mapping[str, Check] | None = None,
98
99
  ) -> Report:
99
100
  """Check a sealed edition against its manifest and against itself, as profile `at` asks.
@@ -107,7 +108,7 @@ def check_edition(
107
108
  | remote: ``data/``'s entries in object storage, by size | no | with `remote` and no `lookup` | no |
108
109
  | lake: current files at their recorded size, no delete file, every referenced file listed | yes | yes | no |
109
110
  | bindings: the manifest's, each with the count it gives | yes | yes | no |
110
- | references: every stored reference names something in the store (see `structures`) | yes | yes | no |
111
+ | references: every stored reference is in the store (see `structures`) | yes | unless `references` is False | no |
111
112
  | tags: every stored language tag is in the form `normalize_tag` gives | yes | yes | no |
112
113
  | fingerprints: recomputed, equal to the manifest's | unless `fingerprints` is False | if it is True | no |
113
114
  | availability: coded columns hold codes; stored availability is the data's | yes | no | no |
@@ -171,6 +172,13 @@ def check_edition(
171
172
  of one (sharded catalog spec §6.5 item 9). A data product
172
173
  vendors its closure, so its references resolve in the edition
173
174
  alone.
175
+ references: Whether to run the ``references`` check. False is for
176
+ ``receive`` only, for a caller that cannot name the other editions
177
+ a structure product's references resolve in, and leaves
178
+ ``references`` out of `Report.checked`. A later check has to cover
179
+ them. `structures` then still runs the ``partials`` check. An
180
+ edition with bindings is allowed, and its references go unchecked
181
+ too.
174
182
  extensions: More checks, by name, for parts of the edition other
175
183
  packages own (statcatlib's search index, say).
176
184
 
@@ -180,9 +188,12 @@ def check_edition(
180
188
  Raises:
181
189
  ValueError: If `lookup`, `remote` or `structures` is given at a
182
190
  profile that does not use it, `fingerprints` is True at ``open``,
183
- or `structures` is an empty sequence.
191
+ `references` is False at ``publish`` or ``open``, or `structures`
192
+ is an empty sequence.
184
193
  """
185
- _refuse_unused(at, lookup=lookup, fingerprints=fingerprints, remote=remote, structures=structures)
194
+ _refuse_unused(
195
+ at, lookup=lookup, fingerprints=fingerprints, remote=remote, structures=structures, references=references
196
+ )
186
197
  root = Path(path)
187
198
  checked: list[str] = ["manifest"]
188
199
  try:
@@ -220,6 +231,7 @@ def check_edition(
220
231
  sized_remotely=remote is not None and lookup is None,
221
232
  fingerprints=fingerprints,
222
233
  structures=_editions(structures),
234
+ references=references,
223
235
  extensions=extensions or {},
224
236
  )
225
237
  for name, step in steps:
@@ -251,6 +263,7 @@ def _refuse_unused(
251
263
  fingerprints: bool | None,
252
264
  remote: str | None,
253
265
  structures: str | Path | Sequence[str | Path] | None,
266
+ references: bool,
254
267
  ) -> None:
255
268
  """Raise for an argument the profile `at` does not use."""
256
269
  if structures is not None and not isinstance(structures, (str, Path)) and not structures:
@@ -268,6 +281,12 @@ def _refuse_unused(
268
281
  if fingerprints and at == "open":
269
282
  msg = "fingerprints=True recomputes them from the store; at='open' reads no store"
270
283
  raise ValueError(msg)
284
+ if not references and at != "receive":
285
+ msg = (
286
+ f"references=False defers the references check at receive; at={at!r} "
287
+ "does not use it, since a seal must check references and open never does"
288
+ )
289
+ raise ValueError(msg)
271
290
 
272
291
 
273
292
  def _steps(
@@ -279,6 +298,7 @@ def _steps(
279
298
  sized_remotely: bool,
280
299
  fingerprints: bool | None,
281
300
  structures: tuple[Path, ...] | None,
301
+ references: bool,
282
302
  extensions: Mapping[str, Check],
283
303
  ) -> list[tuple[str, Callable[[], Iterable[Finding]]]]:
284
304
  """The checks that read the store, by name, in the order profile `at` runs them."""
@@ -288,11 +308,10 @@ def _steps(
288
308
  if at != "open":
289
309
  if (root / "tables.ducklake").exists():
290
310
  steps.append(("lake", partial(_lake, root, manifest, reg)))
291
- steps += [
292
- ("bindings", partial(_bindings, manifest, reg)),
293
- ("references", partial(_references, reg, None if manifest.bindings else structures)),
294
- ("tags", partial(_tags, reg)),
295
- ]
311
+ steps.append(("bindings", partial(_bindings, manifest, reg)))
312
+ if references:
313
+ steps.append(("references", partial(_references, reg, None if manifest.bindings else structures)))
314
+ steps.append(("tags", partial(_tags, reg)))
296
315
  if fingerprints or (fingerprints is None and at == "publish"):
297
316
  steps.append(("fingerprints", partial(_fingerprints, root, manifest, reg)))
298
317
  if at == "publish":
@@ -309,6 +328,7 @@ def check_on_open(
309
328
  remote: str | None = None,
310
329
  engine: EditionEngine | None = None,
311
330
  lookup: Lookup | None = None,
331
+ references: bool = True,
312
332
  extensions: Mapping[str, Check] | None = None,
313
333
  ) -> Report:
314
334
  """Check an edition as a server opens it: ``receive`` once per edition id and manifest, ``open`` after.
@@ -319,6 +339,12 @@ def check_on_open(
319
339
  runs, which hashes nothing. With none, or a stamp for another manifest
320
340
  under the same edition id, the ``receive`` profile runs first.
321
341
 
342
+ A stamp satisfies a full check only when its recorded checks list
343
+ ``references``. A call with ``references=False`` accepts either stamp. A
344
+ full call that meets a stamp from a deferred check runs ``receive``, and
345
+ replaces the stamp when that finds nothing. A stamp that a deferring call
346
+ wrote stays in place when that ``receive`` finds something.
347
+
322
348
  Args:
323
349
  path: The edition directory.
324
350
  stamps: The directory holding the stamps, outside every edition: local
@@ -326,25 +352,37 @@ def check_on_open(
326
352
  remote: As `check_edition`'s, for either profile.
327
353
  engine: As `check_edition`'s, for either profile.
328
354
  lookup: As `check_edition`'s, for the receive check.
355
+ references: As `check_edition`'s, for the receive check. The ``open``
356
+ profile never runs that check.
329
357
  extensions: As `check_edition`'s, for either profile.
330
358
 
331
359
  Returns:
332
360
  The report of the profile that ran; its ``at`` says which.
333
361
  """
334
362
  root = Path(path)
363
+ receive = partial(
364
+ check_edition,
365
+ root,
366
+ at="receive",
367
+ remote=remote,
368
+ engine=engine,
369
+ lookup=lookup,
370
+ references=references,
371
+ extensions=extensions,
372
+ )
335
373
  try:
336
374
  digest = hashlib.sha256((root / MANIFEST_NAME).read_bytes()).hexdigest()
337
375
  manifest = read_manifest(root)
338
376
  except OSError, ManifestError:
339
- return check_edition(root, at="receive", remote=remote, engine=engine, lookup=lookup, extensions=extensions)
377
+ return receive()
340
378
  stamp = Path(stamps) / manifest.product_id / manifest.edition_id
341
379
  if not _names_a_file_under(stamp, Path(stamps)):
342
- report = check_edition(root, at="receive", remote=remote, engine=engine, lookup=lookup, extensions=extensions)
380
+ report = receive()
343
381
  detail = f"product_id {manifest.product_id!r} cannot name a stamp directory, so the check is not stamped"
344
382
  return attrs.evolve(report, findings=(*report.findings, Finding("manifest", MANIFEST_NAME, detail)))
345
- if _stamped(stamp, digest):
383
+ if _stamped(stamp, digest, references=references):
346
384
  return check_edition(root, at="open", remote=remote, engine=engine, extensions=extensions)
347
- report = check_edition(root, at="receive", remote=remote, engine=engine, lookup=lookup, extensions=extensions)
385
+ report = receive()
348
386
  if report.ok:
349
387
  _write_stamp(stamp, digest, report)
350
388
  return report
@@ -359,13 +397,21 @@ def _names_a_file_under(stamp: Path, stamps: Path) -> bool:
359
397
  return len(parts) == 2 and all(part not in {".", ".."} for part in parts)
360
398
 
361
399
 
362
- def _stamped(stamp: Path, digest: str) -> bool:
363
- """Whether `stamp` records a clean receive check of the manifest with sha256 `digest`."""
400
+ def _stamped(stamp: Path, digest: str, *, references: bool) -> bool:
401
+ """Whether `stamp` records a clean receive check of the manifest with sha256 `digest`.
402
+
403
+ When `references` is true, the recorded check must also list ``references``.
404
+ """
364
405
  try:
365
406
  recorded = json.loads(stamp.read_text())
366
407
  except OSError, ValueError:
367
408
  return False
368
- return isinstance(recorded, dict) and recorded.get("manifest_sha256") == digest
409
+ if not isinstance(recorded, dict) or recorded.get("manifest_sha256") != digest:
410
+ return False
411
+ if not references:
412
+ return True
413
+ checked = recorded.get("checked")
414
+ return isinstance(checked, list) and "references" in checked
369
415
 
370
416
 
371
417
  def _write_stamp(stamp: Path, digest: str, report: Report) -> None:
@@ -0,0 +1,131 @@
1
+ # sdmxlib.inventory
2
+
3
+ ## Overview
4
+
5
+ `sdmxlib.inventory` holds a catalog's Inventory: which edition of each
6
+ product is live (sharded catalog spec §6; GH-251). sdmxlib owns the
7
+ documents, their validation, the state-transition rules and a reader;
8
+ statcatlib owns the writer. sdmxlib holds no blob client: the reader takes a
9
+ `fetch(path) -> bytes | None` callable.
10
+
11
+ ## Interface
12
+
13
+ - Documents (`_format.py`): `CatalogDocument` (`catalog.json`), `Current`
14
+ (`CURRENT`), `Root` (`inventory/<seq>.json`), `Leaf` and `LeafEntry`
15
+ (`inventory/leaves/<sha256>.json`), with `Event`, `LeafRef`, `Tombstone`,
16
+ `StructureSource` and `PartialRecord`. `encode` writes one; `decode_catalog`,
17
+ `decode_current`, `decode_root` and `decode_leaf` read one, refusing
18
+ another major format with `InventoryError`; `validate_root` and
19
+ `validate_leaf` check the format's own rules. `decode_root` checks every
20
+ rule `validate_root` does except the event kind. `EventKind` is the set a
21
+ writer records (`EVENT_KINDS`, `check_event_kind`); `Event.kind` is a
22
+ `str`. `root_path(seq)`,
23
+ `leaf_path(sha256)` and `sha256_hex` name and address them.
24
+ `INVENTORY_FORMAT` is `"1.2"`, `CATALOG_FORMAT` `"1.0"`.
25
+ - History documents (`_format.py`, Inventory 1.2, spec §6.1-§6.3, §6.9;
26
+ GH-361): a root's history fields `previous_root_sha256` and `changes`
27
+ (`ChangeItem`, `LeafHashes`, `EntryItem` with its `Marker`, `EntryRecord`),
28
+ unset when absent, tested by `Root.has_history`; `CatalogDocument.history`
29
+ (`CatalogHistory`), set exactly in `catalog.json` 2.x; `History`
30
+ (`inventory/HISTORY`); `SegmentHeader` and `SegmentLine`. `decode_catalog`
31
+ takes `decoder=`: a reader and a stage-2 writer read majors 1 and 2, a
32
+ `stage-1-writer` refuses 2.x. `decode_history`, `decode_segment`,
33
+ `encode_segment`, `segment_line` and `segment_path` read and write them.
34
+ - Routing fields (`_format.py`, `_routing.py`, spec §6.3, §7.3, §10.3;
35
+ GH-348): `LeafEntry.dataflows` and `pull_bytes`, unset when absent, tested
36
+ by `LeafEntry.has_routing`; `LeafEntry.full_artefacts`, the records without
37
+ `partial_of`. `routing_fields(manifest)` computes `RoutingFields`
38
+ (`dataflows`, `pull_bytes`, `artefacts`, the last by `manifest_records`)
39
+ for a writer. `route(edition, manifest)` gives a `LiveEdition`'s `Route`
40
+ (`dataflows`, `pull_bytes`, `homes`), calling `manifest()` only for a field
41
+ the entry lacks and refusing bytes that do not hash to `manifest_sha256`.
42
+ `verify_entry(entry, manifest)` lists each filled field that differs from
43
+ the manifest, for statcatlib's `verify-catalog`. `ShardRouter` is
44
+ statcat-serve's.
45
+ - `schema(document)` (`__init__.py`): the shipped JSON Schema of `catalog`,
46
+ `current`, `root`, `leaf`, `catalog-2.0`, `root-1.2` (history fields
47
+ required), `history`, `segment-header` or `segment-line`. `generate_schemas`
48
+ builds all nine from the models, merging in the conditional rules msgspec
49
+ cannot state from a type (`_DEFINITION_RULES`, `_SCHEMAS`).
50
+ - Rules (`_rules.py`): `head`, `record`, `release`, `due`, `release_due`,
51
+ `cancel`, `supersede_pending`, `rollback`, `retire`, `reinstate`,
52
+ `leaf_ref` and `next_root`. Each takes a product's current leaf and
53
+ returns the next, or raises `TransitionError` with its `rule`, a `Rule`
54
+ (exported, GH-339). `record` and `reinstate` take `artefacts`,
55
+ `dataflows` and `pull_bytes`; every other rule copies them.
56
+ - History rules (`_rules.py`, spec §6.6): `change_list` diffs the base
57
+ version, root `seq - 1`, and its leaves against the new version;
58
+ `next_created_at` keeps `created_at` at least `CREATED_AT_STEP` past the
59
+ base's and refuses a base more than `MAX_BASE_AHEAD` ahead; `next_root`
60
+ takes `previous_bytes` and `changes` together and writes both history
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)`
65
+ return `LiveEdition`s, which carry the entry's `dataflows`, `pull_bytes`
66
+ and `artefacts` (None when absent); `FullInventory.root`, `embargo`,
67
+ `retired`, `products()`, `leaf()`, `leaves()` and `entries()`. `local_fetch(dir)`
68
+ is a `Fetch` over a directory.
69
+ - `repairable(journal, leaves, retired)` (`_rules.py`): the seal-journal
70
+ entries the narrow repair (spec §6.7) may record: those the newest version
71
+ neither names nor tombstones.
72
+ - Conformance (`conformance.py`, GH-252): a `Backend` protocol (`head`,
73
+ `commit` raising `ConflictError` on a stale base, `commit_interrupted`,
74
+ `reader`, `hint_behind`, `restore_to`, `restore_with_new_epoch`), the
75
+ `Snapshot` it returns, the checks in `CHECKS`, and `run(new)`, which runs
76
+ every check against fresh backends. An implementation of the protocol
77
+ (statcatlib's writer) runs it as a test. A writer of the history fields
78
+ also provides a `HistoryBackend` (`stage_2`, `fetch`, `put`, `commit_at`)
79
+ and runs `run_history`, the stage-1 checks in `HISTORY_CHECKS`. The §6.9
80
+ cases for the lock, opt-in, expiry, restores and `verify-catalog` wait for
81
+ stage 2.
82
+
83
+ ## Invariants
84
+
85
+ - A leaf lists its editions sorted by id, at most one `live` per
86
+ `schema_version`, and a `release_at` only on an `embargoed` entry.
87
+ - An edition becomes `live` only when built on the live edition at its
88
+ schema, or, with none there, on nothing or on a live edition at another
89
+ schema (fast-forward). A rollback names the live edition it expects. A
90
+ tombstoned edition is recorded again only by `reinstate`. Every
91
+ transition time is time-zone aware.
92
+ - A reader never accepts a lower `seq` than one it holds unless
93
+ `restore_epoch` changed; it verifies the root `CURRENT` names, probes
94
+ `seq + 1` onward without listing, and skips an invalid root into
95
+ `skipped`. A leaf must hash to its name.
96
+ - With `CURRENT` present and verifying, a reader fetches only `CURRENT` and
97
+ roots. Otherwise it reads `catalog.json` and, on 2.x, `inventory/HISTORY`;
98
+ takes the epoch from `HISTORY` (2.x) or `catalog.json` (1.x); bounds its
99
+ walk back and starts its probe at max(held `seq` in that epoch,
100
+ `expired_through`); drops a held root at or below `expired_through`; and
101
+ fails closed with no root above the bound and none held, or on 2.x
102
+ without `HISTORY` (spec §6.6).
103
+ - A leaf entry carries both routing fields or neither; `dataflows` is sorted
104
+ without duplicates and `pull_bytes` is at least 0. No rule tests
105
+ `format_version` for them, so an entry without them decodes and routes
106
+ from its manifest.
107
+ - A root carries both history fields or neither; `previous_root_sha256` is
108
+ None exactly at version 1; changes are sorted by product, entry items by
109
+ edition, and an entry item carries `entry` exactly when `to` is a state.
110
+ - A reader accepts any `event.kind` within format 1.x; `next_root` and
111
+ `validate_root` refuse a kind outside `EventKind`, and the shipped root
112
+ schema keeps that enum (GH-338).
113
+ - `LiveInventory` holds only `live` entries at its schema version and
114
+ exposes no leaf, so a public reader has nothing embargoed to filter.
115
+
116
+ ## Side Effects
117
+
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.
121
+
122
+ ## Verification
123
+
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`.
125
+ The conformance suite runs against two backends in
126
+ `tests/support/inventory_backends.py`: the file protocol, written by the
127
+ reference writer in `tests/support/inventory.py` (it writes the history
128
+ fields and refuses `catalog.json` 2.x), and a prototype over a
129
+ Delta table (delta-rs, a dev dependency), which proves the spec's escape
130
+ route. A Delta reader lists its log, so `hint_behind` has nothing to do
131
+ there. Sabotaged backends show each check, and each history check, can fail.
@@ -13,6 +13,9 @@ validation, the state-transition rules and a reader; statcatlib writes it.
13
13
  `next_root`):
14
14
  pure functions over a product's leaf that return the next one or raise
15
15
  `TransitionError`, naming the `Rule`.
16
+ - **Routing** (`routing_fields`, `route`, `verify_entry`): a leaf entry's
17
+ routing fields computed from its manifest for a writer, read back for a
18
+ router with the manifest as fallback, and checked by ``verify-catalog``.
16
19
  - **Reading** (`LiveInventory`, `FullInventory`): the read protocol over a
17
20
  ``fetch(path) -> bytes | None`` callable, since sdmxlib holds no blob
18
21
  client. `LiveInventory` holds only live entries; `FullInventory` every
@@ -26,41 +29,67 @@ from sdmxlib.inventory._format import (
26
29
  CATALOG_FORMAT,
27
30
  CATALOG_NAME,
28
31
  CURRENT_NAME,
32
+ HISTORY_DIR,
33
+ HISTORY_FORMAT,
34
+ HISTORY_NAME,
29
35
  INVENTORY_FORMAT,
36
+ OPTED_IN_CATALOG_FORMAT,
37
+ CatalogDecoder,
30
38
  CatalogDocument,
39
+ CatalogHistory,
40
+ ChangeItem,
31
41
  Current,
42
+ EntryItem,
43
+ EntryRecord,
32
44
  Event,
33
45
  EventKind,
46
+ History,
34
47
  InventoryError,
35
48
  Kind,
36
49
  Leaf,
37
50
  LeafEntry,
51
+ LeafHashes,
38
52
  LeafRef,
39
53
  Lifecycle,
54
+ Marker,
40
55
  PartialRecord,
41
56
  Root,
57
+ SegmentHeader,
58
+ SegmentKind,
59
+ SegmentLine,
42
60
  State,
43
61
  StructureSource,
44
62
  Tombstone,
45
63
  decode_catalog,
46
64
  decode_current,
65
+ decode_history,
47
66
  decode_leaf,
48
67
  decode_root,
68
+ decode_segment,
49
69
  encode,
70
+ encode_segment,
50
71
  leaf_path,
51
72
  root_path,
73
+ segment_line,
74
+ segment_path,
52
75
  sha256_hex,
53
76
  validate_leaf,
54
77
  validate_root,
55
78
  )
56
79
  from sdmxlib.inventory._reader import Fetch, FullInventory, LiveEdition, LiveInventory, local_fetch
80
+ from sdmxlib.inventory._routing import Route, RoutingFields, manifest_records, route, routing_fields, verify_entry
57
81
  from sdmxlib.inventory._rules import (
82
+ CREATED_AT_STEP,
83
+ MAX_BASE_AHEAD,
58
84
  Rule,
59
85
  TransitionError,
60
86
  cancel,
87
+ change_list,
61
88
  due,
89
+ entry_record,
62
90
  head,
63
91
  leaf_ref,
92
+ next_created_at,
64
93
  next_root,
65
94
  record,
66
95
  reinstate,
@@ -75,40 +104,66 @@ from sdmxlib.inventory._rules import (
75
104
  __all__ = [
76
105
  "CATALOG_FORMAT",
77
106
  "CATALOG_NAME",
107
+ "CREATED_AT_STEP",
78
108
  "CURRENT_NAME",
109
+ "HISTORY_DIR",
110
+ "HISTORY_FORMAT",
111
+ "HISTORY_NAME",
79
112
  "INVENTORY_FORMAT",
113
+ "MAX_BASE_AHEAD",
114
+ "OPTED_IN_CATALOG_FORMAT",
115
+ "CatalogDecoder",
80
116
  "CatalogDocument",
117
+ "CatalogHistory",
118
+ "ChangeItem",
81
119
  "Current",
120
+ "EntryItem",
121
+ "EntryRecord",
82
122
  "Event",
83
123
  "EventKind",
84
124
  "Fetch",
85
125
  "FullInventory",
126
+ "History",
86
127
  "InventoryError",
87
128
  "Kind",
88
129
  "Leaf",
89
130
  "LeafEntry",
131
+ "LeafHashes",
90
132
  "LeafRef",
91
133
  "Lifecycle",
92
134
  "LiveEdition",
93
135
  "LiveInventory",
136
+ "Marker",
94
137
  "PartialRecord",
95
138
  "Root",
139
+ "Route",
140
+ "RoutingFields",
96
141
  "Rule",
142
+ "SegmentHeader",
143
+ "SegmentKind",
144
+ "SegmentLine",
97
145
  "State",
98
146
  "StructureSource",
99
147
  "Tombstone",
100
148
  "TransitionError",
101
149
  "cancel",
150
+ "change_list",
102
151
  "decode_catalog",
103
152
  "decode_current",
153
+ "decode_history",
104
154
  "decode_leaf",
105
155
  "decode_root",
156
+ "decode_segment",
106
157
  "due",
107
158
  "encode",
159
+ "encode_segment",
160
+ "entry_record",
108
161
  "head",
109
162
  "leaf_path",
110
163
  "leaf_ref",
111
164
  "local_fetch",
165
+ "manifest_records",
166
+ "next_created_at",
112
167
  "next_root",
113
168
  "record",
114
169
  "reinstate",
@@ -118,14 +173,31 @@ __all__ = [
118
173
  "retire",
119
174
  "rollback",
120
175
  "root_path",
176
+ "route",
177
+ "routing_fields",
121
178
  "schema",
179
+ "segment_line",
180
+ "segment_path",
122
181
  "sha256_hex",
123
182
  "supersede_pending",
124
183
  "validate_leaf",
125
184
  "validate_root",
185
+ "verify_entry",
126
186
  ]
127
187
 
128
188
 
129
- def schema(document: Literal["catalog", "current", "root", "leaf"]) -> bytes:
130
- """The shipped JSON Schema for one Inventory document (``schemas/<document>.schema.json``)."""
189
+ def schema(
190
+ document: Literal[
191
+ "catalog", "current", "root", "leaf", "catalog-2.0", "root-1.2", "history", "segment-header", "segment-line"
192
+ ],
193
+ ) -> bytes:
194
+ """The shipped JSON Schema for one Inventory document (``schemas/<document>.schema.json``).
195
+
196
+ Each is generated from its model, with the conditional rules msgspec
197
+ cannot state from a type merged in. ``catalog`` and ``root`` describe
198
+ every document of their major; ``catalog-2.0`` is an opted-in
199
+ ``catalog.json``, and ``root-1.2`` a root with the history fields
200
+ required. ``history`` is ``inventory/HISTORY``, and ``segment-header``
201
+ and ``segment-line`` a history segment's lines (spec §6.1-§6.3, §6.9).
202
+ """
131
203
  return resources.files(__package__).joinpath("schemas", f"{document}.schema.json").read_bytes()