sdmxlib 0.80.0__tar.gz → 0.82.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 (216) hide show
  1. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/PKG-INFO +1 -1
  2. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/pyproject.toml +2 -1
  3. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/pyproject.toml.orig +4 -1
  4. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/edition/EGM.md +10 -4
  5. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/edition/_check.py +11 -17
  6. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/edition/_copy.py +6 -3
  7. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/edition/_write.py +8 -5
  8. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/inventory/EGM.md +9 -2
  9. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/inventory/__init__.py +3 -1
  10. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/inventory/_format.py +45 -9
  11. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/inventory/_rules.py +17 -1
  12. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/inventory/schemas/root.schema.json +4 -2
  13. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/local/EGM.md +6 -3
  14. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/local/data_store.py +3 -1
  15. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/local/object_store.py +8 -3
  16. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/local/registry.py +38 -9
  17. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/storage/EGM.md +21 -3
  18. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/storage/__init__.py +9 -0
  19. sdmxlib-0.82.0/src/sdmxlib/storage/_files.py +116 -0
  20. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/storage/_layout.py +7 -7
  21. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/storage/_manifest.py +38 -4
  22. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/storage/_trim.py +3 -0
  23. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/LICENSE +0 -0
  24. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/README.md +0 -0
  25. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/EGM.md +0 -0
  26. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/__init__.py +0 -0
  27. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/_duckdb.py +0 -0
  28. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/_facet_types.xsd +0 -0
  29. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/_facets.py +0 -0
  30. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/_read_errors.py +0 -0
  31. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/_singleflight.py +0 -0
  32. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/_time.py +0 -0
  33. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/api/EGM.md +0 -0
  34. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/api/__init__.py +0 -0
  35. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/api/_freshness.py +0 -0
  36. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/api/client.py +0 -0
  37. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/api/federated.py +0 -0
  38. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/api/policy.py +0 -0
  39. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/api/providers.py +0 -0
  40. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/api/registry.py +0 -0
  41. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/api/session.py +0 -0
  42. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/builders/EGM.md +0 -0
  43. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/builders/__init__.py +0 -0
  44. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/builders/contentconstraint.py +0 -0
  45. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/builders/metadata_annotation.py +0 -0
  46. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/data_store.py +0 -0
  47. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/edition/__init__.py +0 -0
  48. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/edition/_availability.py +0 -0
  49. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/edition/_build.py +0 -0
  50. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/edition/_canonical.py +0 -0
  51. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/edition/_fetch.py +0 -0
  52. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/edition/_finding.py +0 -0
  53. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/edition/_fingerprint.py +0 -0
  54. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/edition/_overlay.py +0 -0
  55. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/edition/_remote.py +0 -0
  56. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/edition/manifest.schema.json +0 -0
  57. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/edition/overlay.schema.json +0 -0
  58. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/EGM.md +0 -0
  59. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/__init__.py +0 -0
  60. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/_arrow.py +0 -0
  61. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/_attachment.py +0 -0
  62. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/_coerce.py +0 -0
  63. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/_index.py +0 -0
  64. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/_positions.py +0 -0
  65. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/_refuse.py +0 -0
  66. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/_tags.py +0 -0
  67. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/data_format.py +0 -0
  68. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/gaps.py +0 -0
  69. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/render.py +0 -0
  70. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_csv/EGM.md +0 -0
  71. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_csv/__init__.py +0 -0
  72. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_csv/reader.py +0 -0
  73. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_csv/writer.py +0 -0
  74. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_json/EGM.md +0 -0
  75. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_json/__init__.py +0 -0
  76. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_json/_data_common.py +0 -0
  77. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_json/_dto.py +0 -0
  78. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_json/_header.py +0 -0
  79. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_json/_losses.py +0 -0
  80. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_json/_periods.py +0 -0
  81. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_json/_resolve.py +0 -0
  82. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_json/_structure_dto.py +0 -0
  83. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_json/_structure_ingest.py +0 -0
  84. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_json/data.py +0 -0
  85. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_json/data_v1.py +0 -0
  86. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_json/data_v2.py +0 -0
  87. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_json/metadata.py +0 -0
  88. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_json/reader.py +0 -0
  89. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_json/structure_values.py +0 -0
  90. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_json/writer.py +0 -0
  91. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_json_1_0/EGM.md +0 -0
  92. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_json_1_0/__init__.py +0 -0
  93. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_json_1_0/writer.py +0 -0
  94. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml/EGM.md +0 -0
  95. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml/__init__.py +0 -0
  96. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml/_allowed_children.py +0 -0
  97. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml/_closed_world.py +0 -0
  98. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml/_common.py +0 -0
  99. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml/_header.py +0 -0
  100. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml/_losses.py +0 -0
  101. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml/_v3_reader.py +0 -0
  102. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml/_v3_writer.py +0 -0
  103. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml21/EGM.md +0 -0
  104. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml21/__init__.py +0 -0
  105. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml21/_providers.py +0 -0
  106. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml21/_synthetic.py +0 -0
  107. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml21/namespaces.py +0 -0
  108. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml21/reader.py +0 -0
  109. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml21/writer.py +0 -0
  110. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml30/EGM.md +0 -0
  111. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml30/__init__.py +0 -0
  112. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml30/metadata.py +0 -0
  113. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml30/namespaces.py +0 -0
  114. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml30/reader.py +0 -0
  115. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml30/writer.py +0 -0
  116. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml31/EGM.md +0 -0
  117. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml31/__init__.py +0 -0
  118. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml31/namespaces.py +0 -0
  119. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml31/reader.py +0 -0
  120. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/formats/sdmx_ml31/writer.py +0 -0
  121. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/inventory/_reader.py +0 -0
  122. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/inventory/conformance.py +0 -0
  123. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/inventory/schemas/catalog.schema.json +0 -0
  124. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/inventory/schemas/current.schema.json +0 -0
  125. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/inventory/schemas/leaf.schema.json +0 -0
  126. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/local/__init__.py +0 -0
  127. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/local/_scan.py +0 -0
  128. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/local/engine.py +0 -0
  129. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/local/sql.py +0 -0
  130. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/EGM.md +0 -0
  131. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/__init__.py +0 -0
  132. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/_binding.py +0 -0
  133. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/_container.py +0 -0
  134. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/_invariants.py +0 -0
  135. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/_items.py +0 -0
  136. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/_label_match.py +0 -0
  137. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/_rebind.py +0 -0
  138. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/_referenceable.py +0 -0
  139. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/_refshape.py +0 -0
  140. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/_resolvers.py +0 -0
  141. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/_rules.py +0 -0
  142. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/_tree.py +0 -0
  143. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/annotations.py +0 -0
  144. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/base.py +0 -0
  145. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/binding.py +0 -0
  146. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/category.py +0 -0
  147. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/codelist.py +0 -0
  148. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/collections.py +0 -0
  149. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/concept.py +0 -0
  150. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/constraint.py +0 -0
  151. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/convert.py +0 -0
  152. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/dataflow.py +0 -0
  153. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/datastructure.py +0 -0
  154. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/errors.py +0 -0
  155. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/expr.py +0 -0
  156. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/header.py +0 -0
  157. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/hierarchy.py +0 -0
  158. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/in_memory_registry.py +0 -0
  159. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/istring.py +0 -0
  160. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/link.py +0 -0
  161. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/mapping.py +0 -0
  162. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/message.py +0 -0
  163. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/metadata_provision.py +0 -0
  164. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/metadataflow.py +0 -0
  165. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/metadataset.py +0 -0
  166. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/metadatastructure.py +0 -0
  167. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/organisation.py +0 -0
  168. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/provision.py +0 -0
  169. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/ref.py +0 -0
  170. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/registry.py +0 -0
  171. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/representation.py +0 -0
  172. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/rest_api.py +0 -0
  173. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/rollup.py +0 -0
  174. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/urn.py +0 -0
  175. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/validation.py +0 -0
  176. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/valuelist.py +0 -0
  177. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/version.py +0 -0
  178. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/model/version_rewrite.py +0 -0
  179. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/polars.py +0 -0
  180. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/py.typed +0 -0
  181. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/query/EGM.md +0 -0
  182. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/query/__init__.py +0 -0
  183. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/query/_closure.py +0 -0
  184. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/query/_common.py +0 -0
  185. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/query/_compile.py +0 -0
  186. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/query/_edges.py +0 -0
  187. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/query/_execute.py +0 -0
  188. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/query/_expr.py +0 -0
  189. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/query/_joins.py +0 -0
  190. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/query/_plan.py +0 -0
  191. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/query/_pushdown.py +0 -0
  192. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/query/_rebase.py +0 -0
  193. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/query/_rest.py +0 -0
  194. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/query/accessors.py +0 -0
  195. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/query/observations.py +0 -0
  196. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/query/query.py +0 -0
  197. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/query/raw.py +0 -0
  198. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/query/schema.py +0 -0
  199. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/rest.py +0 -0
  200. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/session.py +0 -0
  201. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/sql.py +0 -0
  202. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/storage/_checked.py +0 -0
  203. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/storage/_columns.py +0 -0
  204. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/storage/_kinds.py +0 -0
  205. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/storage/_parsed.py +0 -0
  206. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/storage/_projections.py +0 -0
  207. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/storage/_references.py +0 -0
  208. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/storage/_synthetic.py +0 -0
  209. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/storage/_tags.py +0 -0
  210. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/storage/lazy.py +0 -0
  211. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/storage/readers.py +0 -0
  212. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/storage/resolve.py +0 -0
  213. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/storage/schema.py +0 -0
  214. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/storage/writers.py +0 -0
  215. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/testing.py +0 -0
  216. {sdmxlib-0.80.0 → sdmxlib-0.82.0}/src/sdmxlib/versions.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sdmxlib
3
- Version: 0.80.0
3
+ Version: 0.82.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.80.0"
3
+ version = "0.82.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"
@@ -112,6 +112,7 @@ forkserver_warmup = "none"
112
112
  [dependency-groups]
113
113
  dev = [
114
114
  "sdmxlib-cli",
115
+ "typer>=0.27.3,<0.28",
115
116
  "catppuccin[pygments]>=2.5.0",
116
117
  "types-lxml>=2025.3.30",
117
118
  "types-jsonschema>=4.21.0",
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sdmxlib"
3
- version = "0.80.0"
3
+ version = "0.82.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"
@@ -125,6 +125,9 @@ dev = [
125
125
  # The CLI, a workspace member released with sdmxlib (GH-67): installed here so
126
126
  # its tests run in `just ci` with everything else.
127
127
  "sdmxlib-cli",
128
+ # The scripts under bench/ and tools/ take their arguments through typer, so
129
+ # pyrefly checks each option against its use (GH-326). The CLI's bound.
130
+ "typer>=0.27.3,<0.28",
128
131
  # Checker versions carry UPPER bounds. uv.lock is gitignored (published
129
132
  # library), so every fresh `uv sync` resolves the dev group anew — an
130
133
  # unbounded floor means a checker release lands in `just ci` unannounced.
@@ -90,8 +90,14 @@ seals through `seal(extensions=...)`.
90
90
  for writing. An edition refused at the survey or at the `*.wal` check is
91
91
  left settled with its availability cleared; a rerun after fixing the cause
92
92
  redoes both.
93
- - `seal` and `copy_edition` both write the manifest to a `.tmp` file
94
- and rename it into place.
93
+ - `seal` and `copy_edition` both create the manifest with
94
+ `storage.create_exclusive`: staged, fsynced, hard-linked into place, the
95
+ directory fsynced. A manifest another process created first is never
96
+ replaced; both raise `ManifestError`. `seal` writes the journal entry
97
+ with `replace_durably` and fsyncs the compacted store before its rename
98
+ (GH-335).
99
+ - `list_files` and the `files` check skip `storage._manifest.unlisted`
100
+ names: the manifest, its signature, and a staged manifest a crash left.
95
101
  - Data files are always tier 3. `metadata.duckdb` and `tables.ducklake` default to
96
102
  tier 1, and other files to tier 2.
97
103
  - `copy_edition` skips a `data/` file already present with the same size and
@@ -125,8 +131,8 @@ seals through `seal(extensions=...)`.
125
131
  availability is enabled, stores it again.
126
132
  - `copy_edition` creates directories and copies files with `shutil.copyfile`,
127
133
  then copies the detached signature and the manifest last.
128
- - `check_on_open` writes the JSON stamp `<stamps>/<product_id>/<edition_id>` through
129
- a `.partial` file and a rename.
134
+ - `check_on_open` writes the JSON stamp `<stamps>/<product_id>/<edition_id>`
135
+ with `storage._files.replace_durably`, which replaces any stamp there.
130
136
  - `fetch_edition` makes SDMX REST requests and creates a product directory.
131
137
  `verify_remote` and `check_edition(remote=...)` read from object storage.
132
138
 
@@ -34,14 +34,15 @@ from sdmxlib.local.object_store import sizes
34
34
  from sdmxlib.local.registry import EditionRegistry, LocalRegistry
35
35
  from sdmxlib.model.binding import DataflowBinding
36
36
  from sdmxlib.model.urn import SdmxUrn
37
+ from sdmxlib.storage._files import replace_durably
37
38
  from sdmxlib.storage._manifest import (
38
39
  MANIFEST_NAME,
39
- UNLISTED,
40
40
  EditionFile,
41
41
  Manifest,
42
42
  ManifestError,
43
43
  StoreFormatError,
44
44
  read_manifest,
45
+ unlisted,
45
46
  )
46
47
  from sdmxlib.storage._references import unresolved_references
47
48
  from sdmxlib.storage._tags import stale_tags
@@ -333,28 +334,21 @@ def _stamped(stamp: Path, digest: str) -> bool:
333
334
 
334
335
 
335
336
  def _write_stamp(stamp: Path, digest: str, report: Report) -> None:
336
- """Record `report` under `stamp`, whole or not at all: a rename puts it in place."""
337
- stamp.parent.mkdir(parents=True, exist_ok=True)
338
- partial = stamp.with_name(f".{stamp.name}.partial")
339
- partial.write_text(
340
- json.dumps(
341
- {
342
- "manifest_sha256": digest,
343
- "at": report.at,
344
- "checked": list(report.checked),
345
- "verified_at": datetime.now(UTC).isoformat(),
346
- },
347
- indent=2,
348
- )
349
- )
350
- partial.replace(stamp)
337
+ """Record `report` under `stamp`, whole or not at all, replacing any stamp there."""
338
+ record = {
339
+ "manifest_sha256": digest,
340
+ "at": report.at,
341
+ "checked": list(report.checked),
342
+ "verified_at": datetime.now(UTC).isoformat(),
343
+ }
344
+ replace_durably(stamp, json.dumps(record, indent=2).encode())
351
345
 
352
346
 
353
347
  def _files(root: Path, manifest: Manifest, at: Profile, *, remote: bool) -> Iterable[Finding]:
354
348
  on_disk = {
355
349
  p.relative_to(root).as_posix(): p
356
350
  for p in sorted(root.rglob("*"))
357
- if p.is_file() and p.relative_to(root).as_posix() not in UNLISTED
351
+ if p.is_file() and not unlisted(p.relative_to(root).as_posix())
358
352
  }
359
353
  data = root / manifest.data_path
360
354
  for entry in manifest.files:
@@ -19,6 +19,7 @@ from collections.abc import Collection
19
19
  from pathlib import Path
20
20
 
21
21
  from sdmxlib.edition._write import digests_of, recorded
22
+ from sdmxlib.storage._files import create_exclusive
22
23
  from sdmxlib.storage._manifest import (
23
24
  MANIFEST_NAME,
24
25
  SIGNATURE_NAME,
@@ -80,9 +81,11 @@ def copy_edition(
80
81
  raise ManifestError(msg)
81
82
  if (src / SIGNATURE_NAME).is_file():
82
83
  shutil.copyfile(src / SIGNATURE_NAME, dst / SIGNATURE_NAME)
83
- staged = dst / f"{MANIFEST_NAME}.tmp"
84
- shutil.copyfile(src / MANIFEST_NAME, staged)
85
- staged.replace(dst / MANIFEST_NAME)
84
+ try:
85
+ create_exclusive(dst / MANIFEST_NAME, (src / MANIFEST_NAME).read_bytes())
86
+ except FileExistsError as exc:
87
+ msg = f"{dst} was sealed by another process while this copy ran; an edition is never rewritten"
88
+ raise ManifestError(msg) from exc
86
89
  return manifest
87
90
 
88
91
 
@@ -26,6 +26,7 @@ from sdmxlib.local.registry import EditionRegistry, LocalRegistry
26
26
  from sdmxlib.model.binding import DataflowBinding
27
27
  from sdmxlib.model.datastructure import DataStructure
28
28
  from sdmxlib.model.urn import SdmxUrn
29
+ from sdmxlib.storage._files import create_exclusive
29
30
  from sdmxlib.storage._layout import JournalEntry, write_journal
30
31
  from sdmxlib.storage._manifest import (
31
32
  DATA_PATH,
@@ -33,7 +34,6 @@ from sdmxlib.storage._manifest import (
33
34
  MANIFEST_NAME,
34
35
  METADATA_NAME,
35
36
  TABLES_NAME,
36
- UNLISTED,
37
37
  ArtefactEntry,
38
38
  BindingCount,
39
39
  EditionFile,
@@ -45,6 +45,7 @@ from sdmxlib.storage._manifest import (
45
45
  edition_storage_version,
46
46
  encode_manifest,
47
47
  read_manifest,
48
+ unlisted,
48
49
  )
49
50
  from sdmxlib.storage._trim import compact_for_publication
50
51
  from sdmxlib.storage.schema import get_schema_version, meta_value
@@ -170,7 +171,7 @@ def list_files(root: Path, tiers: Mapping[str, Tier] | None = None) -> tuple[Edi
170
171
  Returns:
171
172
  Each file's path from the root, size, digests and tier.
172
173
  """
173
- files = sorted(p for p in root.rglob("*") if p.is_file() and p.relative_to(root).as_posix() not in UNLISTED)
174
+ files = sorted(p for p in root.rglob("*") if p.is_file() and not unlisted(p.relative_to(root).as_posix()))
174
175
  entries: list[EditionFile] = []
175
176
  for p in files:
176
177
  path = p.relative_to(root).as_posix()
@@ -596,9 +597,11 @@ def seal(
596
597
  extensions=extensions or {},
597
598
  provenance=provenance,
598
599
  )
599
- staged = root / f"{MANIFEST_NAME}.tmp"
600
- staged.write_bytes(encode_manifest(manifest))
601
- staged.replace(root / MANIFEST_NAME)
600
+ try:
601
+ create_exclusive(root / MANIFEST_NAME, encode_manifest(manifest))
602
+ except FileExistsError as exc:
603
+ msg = f"{root} was sealed by another process while this seal ran, and an edition is never rewritten"
604
+ raise ManifestError(msg) from exc
602
605
  return manifest
603
606
 
604
607
 
@@ -16,7 +16,10 @@ statcatlib owns the writer. sdmxlib holds no blob client: the reader takes a
16
16
  `StructureSource` and `PartialRecord`. `encode` writes one; `decode_catalog`,
17
17
  `decode_current`, `decode_root` and `decode_leaf` read one, refusing
18
18
  another major format with `InventoryError`; `validate_root` and
19
- `validate_leaf` check the format's own rules. `root_path(seq)`,
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)`,
20
23
  `leaf_path(sha256)` and `sha256_hex` name and address them.
21
24
  `INVENTORY_FORMAT` and `CATALOG_FORMAT` are `"1.0"`.
22
25
  - `schema(document)` (`__init__.py`): the shipped JSON Schema of `catalog`,
@@ -24,7 +27,8 @@ statcatlib owns the writer. sdmxlib holds no blob client: the reader takes a
24
27
  - Rules (`_rules.py`): `head`, `record`, `release`, `due`, `release_due`,
25
28
  `cancel`, `supersede_pending`, `rollback`, `retire`, `reinstate`,
26
29
  `leaf_ref` and `next_root`. Each takes a product's current leaf and
27
- returns the next, or raises `TransitionError` with its `rule`.
30
+ returns the next, or raises `TransitionError` with its `rule`, a `Rule`
31
+ (exported, GH-339).
28
32
  - Reading (`_reader.py`): `LiveInventory(fetch, schema_version=...)` and
29
33
  `FullInventory(fetch)`, each with `refresh()`, `seq`, `restore_epoch` and
30
34
  `skipped`; `LiveInventory.editions()`, `products()` and `head(product)`
@@ -54,6 +58,9 @@ statcatlib owns the writer. sdmxlib holds no blob client: the reader takes a
54
58
  `restore_epoch` changed; it verifies the root `CURRENT` names, falls back
55
59
  on a mismatch, probes `seq + 1` onward without listing, and skips an
56
60
  invalid root into `skipped`. A leaf must hash to its name.
61
+ - A reader accepts any `event.kind` within format 1.x; `next_root` and
62
+ `validate_root` refuse a kind outside `EventKind`, and the shipped root
63
+ schema keeps that enum (GH-338).
57
64
  - `LiveInventory` holds only `live` entries at its schema version and
58
65
  exposes no leaf, so a public reader has nothing embargoed to filter.
59
66
 
@@ -12,7 +12,7 @@ validation, the state-transition rules and a reader; statcatlib writes it.
12
12
  `supersede_pending`, `rollback`, `retire`, `reinstate`, `repairable`,
13
13
  `next_root`):
14
14
  pure functions over a product's leaf that return the next one or raise
15
- `TransitionError`, naming the rule.
15
+ `TransitionError`, naming the `Rule`.
16
16
  - **Reading** (`LiveInventory`, `FullInventory`): the read protocol over a
17
17
  ``fetch(path) -> bytes | None`` callable, since sdmxlib holds no blob
18
18
  client. `LiveInventory` holds only live entries; `FullInventory` every
@@ -55,6 +55,7 @@ from sdmxlib.inventory._format import (
55
55
  )
56
56
  from sdmxlib.inventory._reader import Fetch, FullInventory, LiveEdition, LiveInventory, local_fetch
57
57
  from sdmxlib.inventory._rules import (
58
+ Rule,
58
59
  TransitionError,
59
60
  cancel,
60
61
  due,
@@ -92,6 +93,7 @@ __all__ = [
92
93
  "LiveInventory",
93
94
  "PartialRecord",
94
95
  "Root",
96
+ "Rule",
95
97
  "State",
96
98
  "StructureSource",
97
99
  "Tombstone",
@@ -13,7 +13,7 @@ refuses another major version.
13
13
 
14
14
  import hashlib
15
15
  from datetime import datetime
16
- from typing import Literal
16
+ from typing import Annotated, Literal, get_args
17
17
 
18
18
  import msgspec
19
19
 
@@ -34,8 +34,16 @@ LEAVES_DIR = "inventory/leaves"
34
34
  #: An entry's state (spec §6.4). Retirement is a tombstone in the root, never a state.
35
35
  type State = Literal["embargoed", "live", "superseded", "withdrawn"]
36
36
 
37
- #: What an Inventory version records it was written for. The set is frozen in 1.0.
38
- type EventKind = Literal["seal", "release", "rollback", "withdraw", "retire", "embargo-change", "restore", "correct"]
37
+ #: What an Inventory version records it was written for (spec §6.2). ``describe`` records a
38
+ #: change to the catalog description in ``extensions.statcat`` and nothing else. A writer
39
+ #: records one of these (`next_root` and `validate_root` refuse any other); a reader accepts
40
+ #: any string within format 1.x, so adding a kind is a minor-version change (GH-338).
41
+ type EventKind = Literal[
42
+ "seal", "release", "rollback", "withdraw", "retire", "embargo-change", "restore", "correct", "describe"
43
+ ]
44
+
45
+ #: The kinds a writer may record, as a set.
46
+ EVENT_KINDS: frozenset[str] = frozenset(get_args(EventKind.__value__))
39
47
 
40
48
  #: A product holding observations, or one holding only full structures (spec §8).
41
49
  type Kind = Literal["data", "structure"]
@@ -83,12 +91,16 @@ class Event(msgspec.Struct, frozen=True, kw_only=True):
83
91
  Attributes:
84
92
  actor: The acting principal, from the writer's identity, never from a caller.
85
93
  reason: Why, in the actor's words.
86
- kind: What the version records.
94
+ kind: What the version records. A writer records an `EventKind`; a
95
+ root read back may carry a kind added in a later 1.x format, which
96
+ an audit or alerting consumer treats as other.
87
97
  """
88
98
 
89
99
  actor: str
90
100
  reason: str
91
- kind: EventKind
101
+ # A `str` so a reader takes a kind added after this build; the shipped schema keeps the
102
+ # enum, which is what a writer meets.
103
+ kind: Annotated[str, msgspec.Meta(extra_json_schema={"enum": sorted(EVENT_KINDS)})]
92
104
 
93
105
 
94
106
  class LeafRef(msgspec.Struct, frozen=True, kw_only=True):
@@ -292,13 +304,16 @@ def decode_current(raw: bytes) -> Current:
292
304
 
293
305
 
294
306
  def decode_root(raw: bytes) -> Root:
295
- """A root from its bytes, validated (`validate_root`).
307
+ """A root from its bytes, validated as a reader validates it.
308
+
309
+ A reader checks every rule `validate_root` checks except the event kind:
310
+ it accepts any ``event.kind`` within format 1.x (spec §6.2).
296
311
 
297
312
  Raises:
298
313
  InventoryError: If it is malformed, of another major format, or breaks a rule.
299
314
  """
300
315
  root = _decode(raw, Root, INVENTORY_FORMAT, "an Inventory root")
301
- validate_root(root)
316
+ _check_root(root)
302
317
  return root
303
318
 
304
319
 
@@ -314,13 +329,34 @@ def decode_leaf(raw: bytes) -> Leaf:
314
329
 
315
330
 
316
331
  def validate_root(root: Root) -> None:
317
- """Refuse a root that breaks the format's own rules.
332
+ """Refuse a root that breaks the format's own rules, as a writer must meet them.
318
333
 
319
334
  Raises:
320
335
  InventoryError: If ``seq`` is below 1, ``previous_inventory`` is not
321
336
  None for version 1 or not below ``seq`` for a later one, a product's
322
- leaf path does not name its hash, or a tombstone repeats.
337
+ leaf path does not name its hash, a tombstone repeats, or
338
+ ``event.kind`` is not an `EventKind`.
339
+ """
340
+ _check_root(root)
341
+ check_event_kind(root.event, root.seq)
342
+
343
+
344
+ def check_event_kind(event: Event, seq: int) -> None:
345
+ """Refuse an event whose kind is not an `EventKind`: the writer's half of spec §6.2.
346
+
347
+ Raises:
348
+ InventoryError: If it is not, naming the version `seq` and the kinds a writer records.
323
349
  """
350
+ if event.kind not in EVENT_KINDS:
351
+ msg = (
352
+ f"Inventory version {seq}: event kind {event.kind!r} is not one a writer records "
353
+ f"({', '.join(sorted(EVENT_KINDS))})"
354
+ )
355
+ raise InventoryError(msg)
356
+
357
+
358
+ def _check_root(root: Root) -> None:
359
+ """The rules a reader and a writer share: every one `validate_root` checks but the event kind."""
324
360
  if root.seq < 1:
325
361
  msg = f"Inventory version {root.seq}: seq starts at 1"
326
362
  raise InventoryError(msg)
@@ -37,6 +37,7 @@ from sdmxlib.inventory._format import (
37
37
  State,
38
38
  StructureSource,
39
39
  Tombstone,
40
+ check_event_kind,
40
41
  encode,
41
42
  leaf_path,
42
43
  sha256_hex,
@@ -44,8 +45,19 @@ from sdmxlib.inventory._format import (
44
45
  )
45
46
  from sdmxlib.storage._manifest import JsonValue, Producer
46
47
 
47
- #: The rule a refused transition breaks.
48
48
  type Rule = Literal["fast-forward", "if-live", "not-due", "state", "tombstone", "duplicate", "unknown", "kind"]
49
+ """The rule a refused transition breaks: `TransitionError.rule`.
50
+
51
+ - ``fast-forward``: the edition is not built on the live edition at its
52
+ schema, or on the same base as the edition it supersedes.
53
+ - ``if-live``: the live edition is not the one a rollback names.
54
+ - ``not-due``: an embargoed edition's ``release_at`` has not passed.
55
+ - ``state``: the entry is not in a state the operation moves from.
56
+ - ``tombstone``: the edition is retired, or `reinstate` names one that is not.
57
+ - ``duplicate``: the edition is recorded already.
58
+ - ``unknown``: the product records no such edition.
59
+ - ``kind``: the product's kind differs from the one recorded.
60
+ """
49
61
 
50
62
 
51
63
  class TransitionError(InventoryError):
@@ -486,9 +498,13 @@ def next_root(
486
498
 
487
499
  Returns:
488
500
  The root, numbered ``previous.seq + 1``.
501
+
502
+ Raises:
503
+ InventoryError: If ``event.kind`` is not an `EventKind`.
489
504
  """
490
505
  now = _aware(now)
491
506
  seq = 1 if previous is None else previous.seq + 1
507
+ check_event_kind(event, seq)
492
508
  return Root(
493
509
  format_version=INVENTORY_FORMAT,
494
510
  seq=seq,
@@ -130,7 +130,7 @@
130
130
  },
131
131
  "Event": {
132
132
  "title": "Event",
133
- "description": "Who wrote an Inventory version, and why.\n\nAttributes:\n actor: The acting principal, from the writer's identity, never from a caller.\n reason: Why, in the actor's words.\n kind: What the version records.",
133
+ "description": "Who wrote an Inventory version, and why.\n\nAttributes:\n actor: The acting principal, from the writer's identity, never from a caller.\n reason: Why, in the actor's words.\n kind: What the version records. A writer records an `EventKind`; a\n root read back may carry a kind added in a later 1.x format, which\n an audit or alerting consumer treats as other.",
134
134
  "type": "object",
135
135
  "properties": {
136
136
  "actor": {
@@ -142,6 +142,7 @@
142
142
  "kind": {
143
143
  "enum": [
144
144
  "correct",
145
+ "describe",
145
146
  "embargo-change",
146
147
  "release",
147
148
  "restore",
@@ -149,7 +150,8 @@
149
150
  "rollback",
150
151
  "seal",
151
152
  "withdraw"
152
- ]
153
+ ],
154
+ "type": "string"
153
155
  }
154
156
  },
155
157
  "required": [
@@ -24,12 +24,15 @@ plane: it attaches the catalogs, serves observation reads and takes writes.
24
24
  rebuild a store on another schema version; `target=` names a format from
25
25
  `formats.gaps.TARGETS`, and `add` then refuses content that format cannot
26
26
  represent.
27
- - `EditionRegistry.bundle(...)` (`registry.py`): opens a sealed edition
27
+ - `EditionRegistry.edition(...)` (`registry.py`): opens a sealed edition
28
28
  read-only and attaches its lake on first use. It reads the manifest first
29
29
  and refuses a schema-version mismatch (`StoreSchemaError`) and a DuckDB
30
30
  storage or DuckLake format newer than this build reads (`StoreFormatError`,
31
- through `refuse_engine_mismatch`). It returns a `EditionRegistry`, also when
32
- called as `LocalRegistry.edition`.
31
+ through `refuse_engine_mismatch`). With `manifest_sha256=` it hashes the
32
+ `manifest.json` bytes before parsing them and refuses a digest other than
33
+ the one given (`ManifestError`, naming the edition and both digests;
34
+ GH-336). It returns a `EditionRegistry`, also when called as
35
+ `LocalRegistry.edition`.
33
36
  - `EditionRegistry.from_connection(...)` (`registry.py`): wraps a DuckDB
34
37
  connection the caller owns. The caller keeps its lifecycle.
35
38
  - `LocalRegistry` (`registry.py`): `EditionRegistry` plus writes: `add`,
@@ -129,7 +129,9 @@ class DuckDBDataStore(SessionFactory):
129
129
  * ``{"account_name": ..., "tenant_id": ..., "client_id": ...,
130
130
  "client_secret": ...}`` → ``PROVIDER 'service_principal'``.
131
131
  * ``{"chain": "cli"}`` (or ``"env"``, ``"managed_identity"``) →
132
- ``PROVIDER 'credential_chain'`` with the named chain.
132
+ ``PROVIDER 'credential_chain'`` with the named chain. A
133
+ ``managed_identity`` chain fails on any query over 5 or more files
134
+ ([duckdb-azure#171](https://github.com/duckdb/duckdb-azure/issues/171)).
133
135
 
134
136
  When ``azure_credentials`` is set, or any ATTACH spec contains
135
137
  ``abfss://``, the ``azure`` extension is auto-INSTALL+LOADed so
@@ -87,10 +87,15 @@ class StoreSecret:
87
87
  own; its documentation lists each type's providers and options.
88
88
 
89
89
  Example:
90
- A pod on Azure reading with its workload identity, and a bucket on an
91
- S3-compatible server:
90
+ An Azure account read with a SAS token, and a bucket on an
91
+ S3-compatible server. DuckDB's ``credential_chain`` provider fails on
92
+ Azure with a managed identity on any query over 5 or more files
93
+ ([duckdb-azure#171](https://github.com/duckdb/duckdb-azure/issues/171)):
92
94
 
93
- sl.StoreSecret("azure", provider="credential_chain", options={"account_name": "acct"})
95
+ sl.StoreSecret(
96
+ "azure",
97
+ options={"connection_string": "BlobEndpoint=https://acct.blob.core.windows.net;SharedAccessSignature=…"},
98
+ )
94
99
  sl.StoreSecret(
95
100
  "s3",
96
101
  options={"key_id": "…", "secret": "…", "endpoint": "minio:9000", "url_style": "path", "use_ssl": False},
@@ -31,6 +31,7 @@ stashes the URI; the DuckDB connection is opened by ``open()`` /
31
31
  """
32
32
 
33
33
  import functools
34
+ import hashlib
34
35
  import logging
35
36
  import re
36
37
  import shutil
@@ -112,7 +113,9 @@ from sdmxlib.storage._manifest import (
112
113
  TABLES_NAME,
113
114
  Manifest,
114
115
  ManifestError,
116
+ decode_manifest,
115
117
  read_manifest,
118
+ read_manifest_bytes,
116
119
  refuse_engine_mismatch,
117
120
  )
118
121
  from sdmxlib.storage._trim import restore
@@ -1456,6 +1459,7 @@ class EditionRegistry(SessionFactory):
1456
1459
  remote: str | None = None,
1457
1460
  engine: EditionEngine | None = None,
1458
1461
  resolve_cache_items: int = DEFAULT_RESOLVE_CACHE_ITEMS,
1462
+ manifest_sha256: str | None = None,
1459
1463
  ) -> EditionRegistry:
1460
1464
  """Open a sealed edition, read-only: artefacts and observations together.
1461
1465
 
@@ -1478,16 +1482,13 @@ class EditionRegistry(SessionFactory):
1478
1482
  ``data_path`` is resolved against it, so nothing in the edition names
1479
1483
  a location::
1480
1484
 
1485
+ connection = "BlobEndpoint=https://acct.blob.core.windows.net;SharedAccessSignature=…"
1481
1486
  engine = sl.EditionEngine(
1482
- secrets=[
1483
- sl.StoreSecret(
1484
- "azure", provider="credential_chain", options={"account_name": "acct"}
1485
- )
1486
- ]
1487
+ secrets=[sl.StoreSecret("azure", options={"connection_string": connection})]
1487
1488
  )
1488
1489
  reg = sl.LocalRegistry.edition(
1489
1490
  "/var/bundles/census/019a…/",
1490
- remote="abfss://c@acct.dfs.core.windows.net/bundles/census/019a…/",
1491
+ remote="az://c/bundles/census/019a…/",
1491
1492
  engine=engine,
1492
1493
  )
1493
1494
 
@@ -1502,6 +1503,19 @@ class EditionRegistry(SessionFactory):
1502
1503
  edition is refused without the file being touched. It is `manifest`
1503
1504
  afterwards, whose ``token`` is what a cache keys on.
1504
1505
 
1506
+ **The Inventory's digest.** A server routed to an edition by the
1507
+ Inventory passes the entry's ``manifest_sha256``
1508
+ (`sdmxlib.inventory.LiveEdition.manifest_sha256`). The bytes of
1509
+ ``manifest.json`` are hashed before they are parsed, and an edition
1510
+ whose manifest is not the one the Inventory recorded is refused: a
1511
+ restored backup, a sync tool's conflict copy or a hand edit leaves a
1512
+ manifest that is valid on its own (the sharded catalog spec §6.3)::
1513
+
1514
+ live = inventory.head("census-2021-cpt")
1515
+ reg = sl.LocalRegistry.edition(
1516
+ product / live.edition_id, engine=engine, manifest_sha256=live.manifest_sha256
1517
+ )
1518
+
1505
1519
  **Read-only.** ``metadata.duckdb`` opens with DuckDB's
1506
1520
  ``read_only`` and the lake attaches ``READ_ONLY``, so any number of
1507
1521
  processes may hold one edition open at once, and a checker can run
@@ -1528,6 +1542,9 @@ class EditionRegistry(SessionFactory):
1528
1542
  beside `path` when None.
1529
1543
  engine: The engine to attach into; one of its own when None.
1530
1544
  resolve_cache_items: As the `LocalRegistry` constructor.
1545
+ manifest_sha256: The SHA-256 of ``manifest.json`` the Inventory
1546
+ records, as lowercase hex; the manifest is not checked
1547
+ against one when None.
1531
1548
 
1532
1549
  Returns:
1533
1550
  An open, read-only registry over the edition.
@@ -1536,12 +1553,24 @@ class EditionRegistry(SessionFactory):
1536
1553
  StoreSchemaError: If the edition was built on another schema version.
1537
1554
  StoreFormatError: If its DuckDB storage version or its DuckLake
1538
1555
  format is newer than this build reads.
1539
- ManifestError: If there is no manifest, or it is malformed or in a
1540
- format this build cannot read.
1556
+ ManifestError: If there is no manifest, it is malformed or in a
1557
+ format this build cannot read, or its SHA-256 is not
1558
+ `manifest_sha256`.
1541
1559
  ValueError: If `remote` is not a URI DuckDB reads.
1542
1560
  """
1543
1561
  root = Path(path)
1544
- manifest = read_manifest(root)
1562
+ raw = read_manifest_bytes(root)
1563
+ if manifest_sha256 is not None:
1564
+ found = hashlib.sha256(raw).hexdigest()
1565
+ if found != manifest_sha256:
1566
+ msg = (
1567
+ f"edition {root.name} ({root}) was not opened: its {MANIFEST_NAME} has SHA-256 {found}, "
1568
+ f"and the Inventory records {manifest_sha256}. The directory holds another manifest than "
1569
+ f"the one recorded (a restored backup, a sync conflict copy or an edit); copy the edition "
1570
+ f"again from its source."
1571
+ )
1572
+ raise ManifestError(msg)
1573
+ manifest = decode_manifest(raw, root / MANIFEST_NAME)
1545
1574
  if manifest.schema_version != SCHEMA_VERSION:
1546
1575
  msg = (
1547
1576
  f"{root} is an edition on store schema {manifest.schema_version} (its manifest says so), "
@@ -60,7 +60,9 @@ of the store that edition ships (`_trim.py`).
60
60
  missing.
61
61
  - `Manifest`, `read_manifest`, `encode_manifest`, `refuse_engine_mismatch` and
62
62
  `storage_version_of` (`_manifest.py`): the msgspec edition manifest and the
63
- DuckDB storage-version checks. The module also defines `ManifestError`,
63
+ DuckDB storage-version checks. `read_manifest` is `read_manifest_bytes`
64
+ then `decode_manifest`, split so `LocalRegistry.edition` hashes the bytes
65
+ it parses. The module also defines `ManifestError`,
64
66
  `StoreFormatError`, `MANIFEST_NAME`, `FORMAT_VERSION`, `DATA_PATH`,
65
67
  `DUCKLAKE_SPEC_VERSION`, `edition_storage_version`,
66
68
  `engine_storage_version` and `generate_schema` (the manifest's JSON Schema).
@@ -77,6 +79,18 @@ of the store that edition ships (`_trim.py`).
77
79
  - `unresolved_references` and `Unresolved` (`_references.py`): find dangling
78
80
  references between artefacts. `code_map` (`_projections.py`): code-to-label
79
81
  projection.
82
+ - `create_exclusive(path, data)` (`_files.py`, exported): creates a file
83
+ complete before it is visible: staged beside `path`, fsynced, hard-linked
84
+ to `path` (`FileExistsError` when another writer created it first), the
85
+ staged file unlinked, the directory fsynced (spec §6.6, GH-335).
86
+ `replace_durably` does the same with a replacing rename, for a file meant
87
+ to be overwritten. `fsync_file`, `fsync_directory` and `is_staged` are the
88
+ steps; `fsync_directory` does nothing on Windows, which cannot open a
89
+ directory for fsync.
90
+ - `JsonValue` (`_manifest.py`, exported, GH-339): the type of a free-form
91
+ JSON value in a manifest's `producer_fields` and `extensions` and an
92
+ Inventory root's `extensions`. `unlisted(path)` (`_manifest.py`): whether
93
+ the manifest never lists a file of the edition directory.
80
94
  - `_layout.py`: a product directory's editions. `list_editions`,
81
95
  `discard` and `refuse_second_unsealed` (which `LocalRegistry.build` calls);
82
96
  the seal journal, `write_journal`, `read_journal` and `clear_journal`
@@ -124,8 +138,12 @@ of the store that edition ships (`_trim.py`).
124
138
  temporary directory on every call (`engine_storage_version`).
125
139
  - `readers.py`, `lazy.py` and `resolve.py` run only `SELECT`s.
126
140
  - `compact_for_publication` attaches the store read-only, copies it through
127
- `.trim` and `.new` files, replaces the original `metadata.duckdb`, and deletes the
128
- temporary file.
141
+ `.trim` and `.new` files, fsyncs the `.new` file, replaces the original
142
+ `metadata.duckdb` with it, fsyncs the directory, and deletes the temporary
143
+ file.
144
+ - `create_exclusive` and `replace_durably` write a staged
145
+ `.<name>.<pid>.<random>.tmp` file and unlink it, and fsync the file and its
146
+ directory. `write_journal` writes through `replace_durably`.
129
147
  - `restore` rebuilds tables and runs `CREATE INDEX` on an open store when the
130
148
  trimmed keys or indexes are missing.
131
149
 
@@ -5,6 +5,11 @@ for codelists, DSDs, dataflows, constraints, mappings, and all other
5
5
  SDMX artefact types. Used internally by ``Registry`` and
6
6
  importable by cataloglib for shared-database workflows.
7
7
 
8
+ `create_exclusive` creates a file complete before it is visible and fsynced,
9
+ for the manifest, the Inventory's documents and any writer that must never
10
+ replace a file another created. `JsonValue` is the type of a free-form JSON
11
+ value in a manifest or an Inventory root.
12
+
8
13
  Example:
9
14
  import duckdb
10
15
  from sdmxlib.storage import schema, writers, readers
@@ -16,9 +21,13 @@ Example:
16
21
  """
17
22
 
18
23
  from sdmxlib.storage import lazy, readers, schema, writers
24
+ from sdmxlib.storage._files import create_exclusive
25
+ from sdmxlib.storage._manifest import JsonValue
19
26
  from sdmxlib.storage.schema import create_schema
20
27
 
21
28
  __all__ = [
29
+ "JsonValue",
30
+ "create_exclusive",
22
31
  "create_schema",
23
32
  "lazy",
24
33
  "readers",