dandi 0.76.7__tar.gz → 0.77.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 (167) hide show
  1. {dandi-0.76.7 → dandi-0.77.0}/CHANGELOG.md +40 -0
  2. {dandi-0.76.7/dandi.egg-info → dandi-0.77.0}/PKG-INFO +39 -39
  3. {dandi-0.76.7 → dandi-0.77.0}/dandi/_version.py +3 -3
  4. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/tests/test_service_scripts.py +5 -3
  5. {dandi-0.76.7 → dandi-0.77.0}/dandi/dandiapi.py +189 -24
  6. {dandi-0.76.7 → dandi-0.77.0}/dandi/metadata/util.py +158 -53
  7. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/test_dandiapi.py +244 -0
  8. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/test_metadata.py +125 -7
  9. {dandi-0.76.7 → dandi-0.77.0/dandi.egg-info}/PKG-INFO +39 -39
  10. dandi-0.77.0/dandi.egg-info/requires.txt +68 -0
  11. {dandi-0.76.7 → dandi-0.77.0}/pyproject.toml +51 -39
  12. {dandi-0.76.7 → dandi-0.77.0}/tox.ini +16 -1
  13. dandi-0.76.7/dandi.egg-info/requires.txt +0 -68
  14. {dandi-0.76.7 → dandi-0.77.0}/LICENSE +0 -0
  15. {dandi-0.76.7 → dandi-0.77.0}/MANIFEST.in +0 -0
  16. {dandi-0.76.7 → dandi-0.77.0}/README.md +0 -0
  17. {dandi-0.76.7 → dandi-0.77.0}/dandi/__init__.py +0 -0
  18. {dandi-0.76.7 → dandi-0.77.0}/dandi/bids_validator_deno/__init__.py +0 -0
  19. {dandi-0.76.7 → dandi-0.77.0}/dandi/bids_validator_deno/_models.py +0 -0
  20. {dandi-0.76.7 → dandi-0.77.0}/dandi/bids_validator_deno/_validator.py +0 -0
  21. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/__init__.py +0 -0
  22. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/base.py +0 -0
  23. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/cmd_delete.py +0 -0
  24. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/cmd_digest.py +0 -0
  25. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/cmd_download.py +0 -0
  26. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/cmd_instances.py +0 -0
  27. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/cmd_ls.py +0 -0
  28. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/cmd_move.py +0 -0
  29. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/cmd_organize.py +0 -0
  30. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/cmd_service_scripts.py +0 -0
  31. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/cmd_shell_completion.py +0 -0
  32. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/cmd_upload.py +0 -0
  33. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/cmd_validate.py +0 -0
  34. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/command.py +0 -0
  35. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/formatter.py +0 -0
  36. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/tests/__init__.py +0 -0
  37. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/tests/data/update_dandiset_from_doi/biorxiv.json +0 -0
  38. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/tests/data/update_dandiset_from_doi/biorxiv.vcr.yaml +0 -0
  39. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/tests/data/update_dandiset_from_doi/elife.json +0 -0
  40. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/tests/data/update_dandiset_from_doi/elife.vcr.yaml +0 -0
  41. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/tests/data/update_dandiset_from_doi/jneurosci.json +0 -0
  42. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/tests/data/update_dandiset_from_doi/jneurosci.vcr.yaml +0 -0
  43. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/tests/data/update_dandiset_from_doi/nature.json +0 -0
  44. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/tests/data/update_dandiset_from_doi/nature.vcr.yaml +0 -0
  45. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/tests/data/update_dandiset_from_doi/neuron.json +0 -0
  46. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/tests/data/update_dandiset_from_doi/neuron.vcr.yaml +0 -0
  47. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/tests/test_base.py +0 -0
  48. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/tests/test_cmd_ls.py +0 -0
  49. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/tests/test_cmd_validate.py +0 -0
  50. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/tests/test_command.py +0 -0
  51. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/tests/test_digest.py +0 -0
  52. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/tests/test_download.py +0 -0
  53. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/tests/test_formatter.py +0 -0
  54. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/tests/test_instances.py +0 -0
  55. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/tests/test_move.py +0 -0
  56. {dandi-0.76.7 → dandi-0.77.0}/dandi/cli/tests/test_shell_completion.py +0 -0
  57. {dandi-0.76.7 → dandi-0.77.0}/dandi/consts.py +0 -0
  58. {dandi-0.76.7 → dandi-0.77.0}/dandi/dandiarchive.py +0 -0
  59. {dandi-0.76.7 → dandi-0.77.0}/dandi/dandiset.py +0 -0
  60. {dandi-0.76.7 → dandi-0.77.0}/dandi/delete.py +0 -0
  61. {dandi-0.76.7 → dandi-0.77.0}/dandi/download.py +0 -0
  62. {dandi-0.76.7 → dandi-0.77.0}/dandi/due.py +0 -0
  63. {dandi-0.76.7 → dandi-0.77.0}/dandi/exceptions.py +0 -0
  64. {dandi-0.76.7 → dandi-0.77.0}/dandi/files/__init__.py +0 -0
  65. {dandi-0.76.7 → dandi-0.77.0}/dandi/files/_private.py +0 -0
  66. {dandi-0.76.7 → dandi-0.77.0}/dandi/files/bases.py +0 -0
  67. {dandi-0.76.7 → dandi-0.77.0}/dandi/files/bids.py +0 -0
  68. {dandi-0.76.7 → dandi-0.77.0}/dandi/files/zarr.py +0 -0
  69. {dandi-0.76.7 → dandi-0.77.0}/dandi/keyring_utils.py +0 -0
  70. {dandi-0.76.7 → dandi-0.77.0}/dandi/metadata/__init__.py +0 -0
  71. {dandi-0.76.7 → dandi-0.77.0}/dandi/metadata/core.py +0 -0
  72. {dandi-0.76.7 → dandi-0.77.0}/dandi/metadata/nwb.py +0 -0
  73. {dandi-0.76.7 → dandi-0.77.0}/dandi/misctypes.py +0 -0
  74. {dandi-0.76.7 → dandi-0.77.0}/dandi/move.py +0 -0
  75. {dandi-0.76.7 → dandi-0.77.0}/dandi/organize.py +0 -0
  76. {dandi-0.76.7 → dandi-0.77.0}/dandi/pynwb_utils.py +0 -0
  77. {dandi-0.76.7 → dandi-0.77.0}/dandi/pytest_plugin.py +0 -0
  78. {dandi-0.76.7 → dandi-0.77.0}/dandi/support/__init__.py +0 -0
  79. {dandi-0.76.7 → dandi-0.77.0}/dandi/support/digests.py +0 -0
  80. {dandi-0.76.7 → dandi-0.77.0}/dandi/support/iterators.py +0 -0
  81. {dandi-0.76.7 → dandi-0.77.0}/dandi/support/pyout.py +0 -0
  82. {dandi-0.76.7 → dandi-0.77.0}/dandi/support/tests/__init__.py +0 -0
  83. {dandi-0.76.7 → dandi-0.77.0}/dandi/support/tests/test_digests.py +0 -0
  84. {dandi-0.76.7 → dandi-0.77.0}/dandi/support/tests/test_iterators.py +0 -0
  85. {dandi-0.76.7 → dandi-0.77.0}/dandi/support/threaded_walk.py +0 -0
  86. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/__init__.py +0 -0
  87. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/dandiarchive-docker/docker-compose.yml +0 -0
  88. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/metadata/dandimeta_migration.new.json +0 -0
  89. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/metadata/metadata2asset.json +0 -0
  90. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/metadata/metadata2asset_3.json +0 -0
  91. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/metadata/metadata2asset_cellline.json +0 -0
  92. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/metadata/metadata2asset_simple1.json +0 -0
  93. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/array_v3_corrupt_zarr_json.zarr/c/0/0 +0 -0
  94. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/array_v3_corrupt_zarr_json.zarr/c/0/1 +0 -0
  95. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/array_v3_corrupt_zarr_json.zarr/c/1/0 +0 -0
  96. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/array_v3_corrupt_zarr_json.zarr/c/1/1 +0 -0
  97. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/array_v3_corrupt_zarr_json.zarr/zarr.json +0 -0
  98. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/arrays_in_groups_missing_zarr_json.zarr/foo/bar/z/zarr.json +0 -0
  99. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/arrays_in_groups_missing_zarr_json.zarr/foo/bar/zarr.json +0 -0
  100. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/arrays_in_groups_missing_zarr_json.zarr/foo/zarr.json +0 -0
  101. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/arrays_in_groups_missing_zarr_json.zarr/foo1/bar1/z1/zarr.json +0 -0
  102. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/arrays_in_groups_missing_zarr_json.zarr/foo1/bar1/zarr.json +0 -0
  103. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/arrays_in_groups_missing_zarr_json.zarr/foo1/zarr.json +0 -0
  104. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/arrays_in_groups_node_type_problem.zarr/foo/bar/z/zarr.json +0 -0
  105. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/arrays_in_groups_node_type_problem.zarr/foo/bar/zarr.json +0 -0
  106. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/arrays_in_groups_node_type_problem.zarr/foo/zarr.json +0 -0
  107. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/arrays_in_groups_node_type_problem.zarr/foo1/bar1/z1/zarr.json +0 -0
  108. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/arrays_in_groups_node_type_problem.zarr/foo1/bar1/zarr.json +0 -0
  109. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/arrays_in_groups_node_type_problem.zarr/foo1/zarr.json +0 -0
  110. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/arrays_in_groups_node_type_problem.zarr/zarr.json +0 -0
  111. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/single_array_missing_zarr_json.zarr/c/0/0 +0 -0
  112. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/single_array_missing_zarr_json.zarr/c/0/1 +0 -0
  113. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/single_array_missing_zarr_json.zarr/c/1/0 +0 -0
  114. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/single_array_missing_zarr_json.zarr/c/1/1 +0 -0
  115. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/single_array_node_type_problem.zarr/c/0/0 +0 -0
  116. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/single_array_node_type_problem.zarr/c/0/1 +0 -0
  117. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/single_array_node_type_problem.zarr/c/1/0 +0 -0
  118. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/single_array_node_type_problem.zarr/c/1/1 +0 -0
  119. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/invalid_stores/single_array_node_type_problem.zarr/zarr.json +0 -0
  120. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/valid_stores/arrays_in_groups.zarr/foo/bar/z/zarr.json +0 -0
  121. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/valid_stores/arrays_in_groups.zarr/foo/bar/zarr.json +0 -0
  122. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/valid_stores/arrays_in_groups.zarr/foo/zarr.json +0 -0
  123. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/valid_stores/arrays_in_groups.zarr/foo1/bar1/z1/zarr.json +0 -0
  124. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/valid_stores/arrays_in_groups.zarr/foo1/bar1/zarr.json +0 -0
  125. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/valid_stores/arrays_in_groups.zarr/foo1/zarr.json +0 -0
  126. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/valid_stores/arrays_in_groups.zarr/zarr.json +0 -0
  127. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/valid_stores/single_array.zarr/c/0/0 +0 -0
  128. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/valid_stores/single_array.zarr/c/0/1 +0 -0
  129. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/valid_stores/single_array.zarr/c/1/0 +0 -0
  130. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/valid_stores/single_array.zarr/c/1/1 +0 -0
  131. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/data/zarr3_stores/valid_stores/single_array.zarr/zarr.json +0 -0
  132. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/fixtures.py +0 -0
  133. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/skip.py +0 -0
  134. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/test_bids_validator_deno/test_validator.py +0 -0
  135. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/test_dandiarchive.py +0 -0
  136. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/test_dandiset.py +0 -0
  137. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/test_delete.py +0 -0
  138. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/test_download.py +0 -0
  139. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/test_files.py +0 -0
  140. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/test_fixtures.py +0 -0
  141. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/test_helpers.py +0 -0
  142. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/test_helptext.py +0 -0
  143. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/test_keyring.py +0 -0
  144. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/test_move.py +0 -0
  145. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/test_organize.py +0 -0
  146. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/test_pynwb_utils.py +0 -0
  147. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/test_upload.py +0 -0
  148. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/test_utils.py +0 -0
  149. {dandi-0.76.7 → dandi-0.77.0}/dandi/tests/xfail.py +0 -0
  150. {dandi-0.76.7 → dandi-0.77.0}/dandi/upload.py +0 -0
  151. {dandi-0.76.7 → dandi-0.77.0}/dandi/utils.py +0 -0
  152. {dandi-0.76.7 → dandi-0.77.0}/dandi/validate/__init__.py +0 -0
  153. {dandi-0.76.7 → dandi-0.77.0}/dandi/validate/_core.py +0 -0
  154. {dandi-0.76.7 → dandi-0.77.0}/dandi/validate/_io.py +0 -0
  155. {dandi-0.76.7 → dandi-0.77.0}/dandi/validate/_types.py +0 -0
  156. {dandi-0.76.7 → dandi-0.77.0}/dandi/validate/tests/__init__.py +0 -0
  157. {dandi-0.76.7 → dandi-0.77.0}/dandi/validate/tests/test_core.py +0 -0
  158. {dandi-0.76.7 → dandi-0.77.0}/dandi/validate/tests/test_io.py +0 -0
  159. {dandi-0.76.7 → dandi-0.77.0}/dandi/validate/tests/test_types.py +0 -0
  160. {dandi-0.76.7 → dandi-0.77.0}/dandi.egg-info/SOURCES.txt +0 -0
  161. {dandi-0.76.7 → dandi-0.77.0}/dandi.egg-info/dependency_links.txt +0 -0
  162. {dandi-0.76.7 → dandi-0.77.0}/dandi.egg-info/entry_points.txt +0 -0
  163. {dandi-0.76.7 → dandi-0.77.0}/dandi.egg-info/not-zip-safe +0 -0
  164. {dandi-0.76.7 → dandi-0.77.0}/dandi.egg-info/top_level.txt +0 -0
  165. {dandi-0.76.7 → dandi-0.77.0}/setup.cfg +0 -0
  166. {dandi-0.76.7 → dandi-0.77.0}/setup.py +0 -0
  167. {dandi-0.76.7 → dandi-0.77.0}/versioneer.py +0 -0
@@ -1,3 +1,43 @@
1
+ # 0.77.0 (Sat Aug 08 2026)
2
+
3
+ #### 🚀 Enhancement
4
+
5
+ - Make a SpeciesRecord dataclass for species_map records [#1899](https://github.com/dandi/dandi-cli/pull/1899) ([@adityasingh2400](https://github.com/adityasingh2400))
6
+ - Downgrade outgoing metadata to server's schema version on upload [#1898](https://github.com/dandi/dandi-cli/pull/1898) ([@yarikoptic](https://github.com/yarikoptic))
7
+
8
+ #### 📝 Documentation
9
+
10
+ - docs: expand DEVELOPMENT.md with architecture and testing guide [#1902](https://github.com/dandi/dandi-cli/pull/1902) ([@claude](https://github.com/claude) [@yarikoptic-gitmate](https://github.com/yarikoptic-gitmate))
11
+
12
+ #### 🧪 Tests
13
+
14
+ - Add py3-lowest tox env and CI mode; tighten dependency lower bounds [#1897](https://github.com/dandi/dandi-cli/pull/1897) ([@yarikoptic](https://github.com/yarikoptic))
15
+
16
+ #### Authors: 4
17
+
18
+ - Aditya Singh ([@adityasingh2400](https://github.com/adityasingh2400))
19
+ - Claude ([@claude](https://github.com/claude))
20
+ - GitMate for @yarikoptic ([@yarikoptic-gitmate](https://github.com/yarikoptic-gitmate))
21
+ - Yaroslav Halchenko ([@yarikoptic](https://github.com/yarikoptic))
22
+
23
+ ---
24
+
25
+ # 0.76.8 (Tue Jul 28 2026)
26
+
27
+ #### 📝 Documentation
28
+
29
+ - Document validation caveats of the `get_metadata` methods [#1892](https://github.com/dandi/dandi-cli/pull/1892) ([@candleindark](https://github.com/candleindark))
30
+
31
+ #### 🧪 Tests
32
+
33
+ - Build expected metadata with the server's DANDI schema version [#1894](https://github.com/dandi/dandi-cli/pull/1894) ([@candleindark](https://github.com/candleindark))
34
+
35
+ #### Authors: 1
36
+
37
+ - Isaac To ([@candleindark](https://github.com/candleindark))
38
+
39
+ ---
40
+
1
41
  # 0.76.7 (Fri Jul 10 2026)
2
42
 
3
43
  #### 🐛 Bug Fix
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dandi
3
- Version: 0.76.7
3
+ Version: 0.77.0
4
4
  Summary: Command line client for interaction with DANDI instances
5
5
  Author-email: DANDI developers <team@dandiarchive.org>
6
6
  Maintainer-email: DANDI developers <team@dandiarchive.org>
@@ -227,55 +227,55 @@ License-File: LICENSE
227
227
  Requires-Dist: bidsschematools~=1.0
228
228
  Requires-Dist: bids-validator-deno>=2.0.5
229
229
  Requires-Dist: click>=8.2
230
- Requires-Dist: click-didyoumean
231
- Requires-Dist: dandischema~=0.12.0
230
+ Requires-Dist: click-didyoumean>=0.3.1
231
+ Requires-Dist: dandischema!=0.13.0,<0.15.0,>=0.12.0
232
232
  Requires-Dist: etelemetry>=0.2.2
233
- Requires-Dist: fasteners
233
+ Requires-Dist: fasteners>=0.19
234
234
  Requires-Dist: fscacher>=0.3.0
235
- Requires-Dist: hdmf!=3.14.4,!=3.5.0
236
- Requires-Dist: humanize
235
+ Requires-Dist: hdmf>=4.1.0
236
+ Requires-Dist: humanize>=4.5.0
237
237
  Requires-Dist: interleave~=0.3
238
- Requires-Dist: joblib
239
- Requires-Dist: keyring!=23.9.0
240
- Requires-Dist: keyrings.alt
241
- Requires-Dist: packaging
242
- Requires-Dist: platformdirs
243
- Requires-Dist: pycryptodomex
244
- Requires-Dist: pydantic~=2.0
245
- Requires-Dist: pynwb!=1.1.0,!=2.3.0,>=1.0.3
246
- Requires-Dist: numcodecs
238
+ Requires-Dist: joblib>=1.3.0
239
+ Requires-Dist: keyring>=23.10.0
240
+ Requires-Dist: keyrings.alt>=5.0.0
241
+ Requires-Dist: packaging>=22.0
242
+ Requires-Dist: platformdirs>=4.1.0
243
+ Requires-Dist: pycryptodomex>=3.16.0
244
+ Requires-Dist: pydantic~=2.9
245
+ Requires-Dist: pynwb>=3.1.0
246
+ Requires-Dist: numcodecs>=0.11.0
247
247
  Requires-Dist: nwbinspector>=0.7.0
248
- Requires-Dist: pyout!=0.6.0,>=0.5
249
- Requires-Dist: python-dateutil
250
- Requires-Dist: requests~=2.20
251
- Requires-Dist: ruamel.yaml<1,>=0.15
252
- Requires-Dist: semantic-version
253
- Requires-Dist: tenacity
254
- Requires-Dist: tensorstore
255
- Requires-Dist: urllib3>=2.0.0
256
- Requires-Dist: yarl~=1.9
257
- Requires-Dist: zarr<=3.1.5,>=2.10
248
+ Requires-Dist: pyout>=0.7.3
249
+ Requires-Dist: python-dateutil>=2.9.0
250
+ Requires-Dist: requests~=2.30
251
+ Requires-Dist: ruamel.yaml<1,>=0.16.0
252
+ Requires-Dist: semantic-version>=2.10.0
253
+ Requires-Dist: tenacity>=8.2.0
254
+ Requires-Dist: tensorstore>=0.1.62
255
+ Requires-Dist: urllib3>=2.0.2
256
+ Requires-Dist: yarl<2,>=1.9.1
257
+ Requires-Dist: zarr<=3.1.5,>=2.18.0
258
258
  Requires-Dist: zarr_checksum~=0.4.0
259
259
  Provides-Extra: extensions
260
260
  Requires-Dist: allensdk; extra == "extensions"
261
261
  Requires-Dist: ndx-hed; extra == "extensions"
262
262
  Requires-Dist: ndx-events; extra == "extensions"
263
263
  Provides-Extra: extras
264
- Requires-Dist: duecredit>=0.6.0; extra == "extras"
265
- Requires-Dist: fsspec[http]; extra == "extras"
264
+ Requires-Dist: duecredit>=0.9.2; extra == "extras"
265
+ Requires-Dist: fsspec[http]>=2022.11.0; extra == "extras"
266
266
  Provides-Extra: test
267
- Requires-Dist: aiohttp<3.14; extra == "test"
268
- Requires-Dist: anys~=0.2; extra == "test"
269
- Requires-Dist: coverage; extra == "test"
270
- Requires-Dist: opencv-python<4.13; (sys_platform == "darwin" and platform_machine != "arm64") and extra == "test"
271
- Requires-Dist: opencv-python; (sys_platform != "darwin" or platform_machine == "arm64") and extra == "test"
272
- Requires-Dist: pytest; extra == "test"
273
- Requires-Dist: pytest-cov; extra == "test"
274
- Requires-Dist: pytest-mock; extra == "test"
275
- Requires-Dist: pytest-rerunfailures; extra == "test"
276
- Requires-Dist: pytest-timeout; extra == "test"
277
- Requires-Dist: responses!=0.24.0,!=0.25.5; extra == "test"
278
- Requires-Dist: vcrpy; extra == "test"
267
+ Requires-Dist: aiohttp<3.14,>=3.8.4; extra == "test"
268
+ Requires-Dist: anys~=0.3; extra == "test"
269
+ Requires-Dist: coverage>=7.0.0; extra == "test"
270
+ Requires-Dist: opencv-python<4.13,>=4.10.0.84; (sys_platform == "darwin" and platform_machine != "arm64") and extra == "test"
271
+ Requires-Dist: opencv-python>=4.10.0.84; (sys_platform != "darwin" or platform_machine == "arm64") and extra == "test"
272
+ Requires-Dist: pytest>=7.2.0; extra == "test"
273
+ Requires-Dist: pytest-cov>=4.1.0; extra == "test"
274
+ Requires-Dist: pytest-mock>=3.11.0; extra == "test"
275
+ Requires-Dist: pytest-rerunfailures>=10.3; extra == "test"
276
+ Requires-Dist: pytest-timeout>=2.2.0; extra == "test"
277
+ Requires-Dist: responses!=0.24.0,!=0.25.5,>=0.23.0; extra == "test"
278
+ Requires-Dist: vcrpy>=5.0.0; extra == "test"
279
279
  Provides-Extra: tools
280
280
  Requires-Dist: boto3; extra == "tools"
281
281
  Provides-Extra: all
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2026-07-10T19:01:24+0000",
11
+ "date": "2026-08-08T01:08:07+0000",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "0698b7d0ecace38828391de55c259fdd5a93e2ba",
15
- "version": "0.76.7"
14
+ "full-revisionid": "e982b3bc3c34a8ec3b7c6949a671cbe10fd0a296",
15
+ "version": "0.77.0"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -9,7 +9,6 @@ import sys
9
9
 
10
10
  import anys
11
11
  from click.testing import CliRunner
12
- from dandischema.consts import DANDI_SCHEMA_VERSION
13
12
  from dandischema.models import ID_PATTERN
14
13
  import pytest
15
14
 
@@ -104,18 +103,21 @@ def test_update_dandiset_from_doi(
104
103
  )
105
104
  assert r.exit_code == 0
106
105
  metadata = new_dandiset.dandiset.get_raw_metadata()
106
+ # The DANDI schema version in the metadata under test is the server's,
107
+ # not this client's.
108
+ server_schema_version = new_dandiset.client.get("/info/")["schema_version"]
107
109
  with (DATA_DIR / "update_dandiset_from_doi" / f"{name}.json").open() as fp:
108
110
  expected = json.load(fp)
109
111
  expected["id"] = anys.AnyFullmatch(rf"{ID_PATTERN}:{dandiset_id}/draft")
110
112
  expected["url"] = f"{repository}/dandiset/{dandiset_id}/draft"
111
113
  expected["@context"] = (
112
114
  "https://raw.githubusercontent.com/dandi/schema/master/releases"
113
- f"/{DANDI_SCHEMA_VERSION}/context.json"
115
+ f"/{server_schema_version}/context.json"
114
116
  )
115
117
  expected["identifier"] = anys.AnyFullmatch(rf"{ID_PATTERN}:{dandiset_id}")
116
118
  expected["repository"] = repository
117
119
  expected["dateCreated"] = anys.ANY_AWARE_DATETIME_STR
118
- expected["schemaVersion"] = DANDI_SCHEMA_VERSION
120
+ expected["schemaVersion"] = server_schema_version
119
121
  expected["wasGeneratedBy"][0]["id"] = anys.AnyFullmatch(
120
122
  r"urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
121
123
  )
@@ -19,6 +19,7 @@ from dataclasses import dataclass
19
19
  from datetime import datetime
20
20
  from enum import Enum
21
21
  from fnmatch import fnmatchcase
22
+ from functools import cached_property
22
23
  import json
23
24
  import os.path
24
25
  from pathlib import Path, PurePosixPath
@@ -26,11 +27,12 @@ import posixpath
26
27
  import re
27
28
  from time import sleep, time
28
29
  from types import TracebackType
29
- from typing import TYPE_CHECKING, Any, Dict, List, Optional
30
+ from typing import TYPE_CHECKING, Any, Dict, List, Optional, cast
30
31
 
31
32
  import click
32
33
  from dandischema import models
33
34
  import dandischema.consts
35
+ from dandischema.metadata import migrate
34
36
  from packaging.version import Version as PackagingVersion
35
37
  from pydantic import BaseModel, Field, PrivateAttr
36
38
  import requests
@@ -709,13 +711,8 @@ class DandiAPIClient(RESTFullAPIClient):
709
711
  """
710
712
  if schema_version is None:
711
713
  schema_version = models.get_schema_version()
712
- server_info = self.get("/info/")
713
- server_schema_version = server_info.get("schema_version")
714
- if not server_schema_version:
715
- raise RuntimeError(
716
- "Server did not provide schema_version in /info/;"
717
- f" returned {server_info!r}"
718
- )
714
+ server_info = self.server_info
715
+ server_schema_version = self.server_schema_version
719
716
  server_ver, our_ver = PackagingVersion(server_schema_version), PackagingVersion(
720
717
  schema_version
721
718
  )
@@ -737,28 +734,178 @@ class DandiAPIClient(RESTFullAPIClient):
737
734
  # TODO: check current server behavior which is likely to just not care!
738
735
  # So that is where server might need to provide support for upgrades upon
739
736
  # providing metadata.
740
- elif (
741
- server_ver.major == 0 and server_ver.release[:2] != our_ver.release[:2]
742
- ) or (
743
- server_ver.major != our_ver.major
744
- ): # MAJOR, MINOR within 0.x.y and MAJOR within 1.x.y
745
- raise SchemaVersionError(
746
- f"Server uses older incompatible schema version {server_schema_version};"
747
- f" client supports {schema_version}."
748
- )
749
737
  elif server_ver < our_ver:
750
- # Compatible older server version -- all good, but inform the user
751
- # TODO: potentially downgrade the record to match the schema,
752
- # see https://github.com/dandi/dandi-schema/issues/343
738
+ # Server is older. If dandischema knows a downgrade path
739
+ # (`_maybe_downgrade_metadata` will use it on upload) OR if the
740
+ # versions are within the same MAJOR.MINOR (0.x.y) / MAJOR (1.x.y)
741
+ # compatibility band, just warn; otherwise raise as incompatible.
742
+ can_downgrade = (
743
+ server_schema_version in dandischema.consts.ALLOWED_TARGET_SCHEMAS
744
+ )
745
+ if not can_downgrade and (
746
+ (
747
+ server_ver.major == 0
748
+ and server_ver.release[:2] != our_ver.release[:2]
749
+ )
750
+ or (server_ver.major != our_ver.major)
751
+ ):
752
+ raise SchemaVersionError(
753
+ f"Server uses older incompatible schema version {server_schema_version};"
754
+ f" client supports {schema_version}."
755
+ )
756
+ if can_downgrade:
757
+ msg_downgrade = (
758
+ "Library will attempt (but might fail) to downgrade outgoing "
759
+ "metadata to this schema version on upload. "
760
+ )
761
+ else:
762
+ msg_downgrade = (
763
+ "Library DOES NOT support downgrade to this schema version. "
764
+ )
753
765
  lgr.warning(
754
- "Server uses schema version %s older than client's %s (dandischema library %s). "
755
- "Server might fail to validate such assets and you might not be able to "
756
- "publish this dandiset until server is upgraded. "
757
- "Alternatively, you may downgrade dandischema and reupload.",
766
+ "Server uses schema version %s older than client's %s "
767
+ "(dandischema library %s). "
768
+ "%s"
769
+ "Server might fail to validate "
770
+ "such assets and you might not be able to publish this dandiset "
771
+ "until server is upgraded. Alternatively, you may downgrade "
772
+ "dandischema and reupload.",
758
773
  server_ver,
759
774
  our_ver,
760
775
  dandischema.__version__,
776
+ msg_downgrade,
777
+ )
778
+
779
+ @cached_property
780
+ def server_info(self) -> dict[str, Any]:
781
+ """
782
+ Cached response from the server's ``/info/`` endpoint.
783
+ """
784
+ info = self.get("/info/")
785
+ assert isinstance(info, dict)
786
+ return info
787
+
788
+ @cached_property
789
+ def server_schema_version(self) -> str:
790
+ """
791
+ The DANDI schema version reported by the server's ``/info/`` endpoint.
792
+ """
793
+ schema_version = self.server_info.get("schema_version")
794
+ if not schema_version:
795
+ raise RuntimeError(
796
+ f"Server did not provide schema_version in /info/; "
797
+ f"returned {self.server_info!r}"
798
+ )
799
+ assert isinstance(schema_version, str)
800
+ return schema_version
801
+
802
+ def _maybe_downgrade_metadata(self, metadata: dict[str, Any]) -> dict[str, Any]:
803
+ """
804
+ If the server reports an older ``schema_version`` than the one embedded
805
+ in ``metadata``, and dandischema knows how to migrate down to that
806
+ version (i.e. it is in
807
+ ``dandischema.consts.ALLOWED_TARGET_SCHEMAS``), return a downgraded
808
+ copy of the metadata. Otherwise return ``metadata`` unchanged.
809
+
810
+ If the downgrade path exists but ``dandischema.metadata.migrate``
811
+ refuses (e.g. a field added post-server-version is populated and
812
+ cannot be simply stripped), log a warning and return the original
813
+ metadata — the server will then decide.
814
+
815
+ Ref: https://github.com/dandi/dandi-schema/issues/343
816
+ """
817
+ obj_ver = metadata.get("schemaVersion")
818
+ if not obj_ver:
819
+ return metadata
820
+ server_ver_str = self.server_schema_version
821
+ if (
822
+ PackagingVersion(server_ver_str) >= PackagingVersion(obj_ver)
823
+ or server_ver_str not in dandischema.consts.ALLOWED_TARGET_SCHEMAS
824
+ ):
825
+ return metadata
826
+ try:
827
+ downgraded = migrate(
828
+ metadata, to_version=server_ver_str, skip_validation=True
829
+ )
830
+ except ValueError as exc:
831
+ lgr.warning(
832
+ "Could not downgrade metadata from schema version %s to server's "
833
+ "%s: %s. Sending original metadata; server may reject it.",
834
+ obj_ver,
835
+ server_ver_str,
836
+ exc,
761
837
  )
838
+ return metadata
839
+ return cast(Dict[str, Any], downgraded)
840
+
841
+ def _maybe_downgrade_request_metadata(self, body: Any) -> Any:
842
+ """
843
+ Intercept an outgoing request body: if it wraps a DANDI metadata
844
+ dict under the ``"metadata"`` key, downgrade that dict to the
845
+ server's schema version via ``_maybe_downgrade_metadata``.
846
+
847
+ A body is treated as carrying DANDI metadata iff it is a
848
+ ``dict`` whose ``"metadata"`` value is itself a ``dict`` with
849
+ both ``schemaKey`` (a str, e.g. ``"Dandiset"``, ``"BareAsset"``)
850
+ and ``schemaVersion`` (a str) — this is the invariant shape of
851
+ every DANDI-metadata payload the archive accepts. Bodies that
852
+ don't match are passed through unchanged.
853
+
854
+ Called from `request()`, so every metadata-sending endpoint
855
+ (``create_dandiset``, ``*.set_raw_metadata``, ``iter_upload``
856
+ asset-create/replace, plus any future ones) gets the downgrade
857
+ automatically without spot-patching.
858
+ """
859
+ if not isinstance(body, dict):
860
+ return body
861
+ md = body.get("metadata")
862
+ if not (
863
+ isinstance(md, dict)
864
+ and isinstance(md.get("schemaKey"), str)
865
+ and isinstance(md.get("schemaVersion"), str)
866
+ ):
867
+ return body
868
+ downgraded = self._maybe_downgrade_metadata(md)
869
+ if downgraded is md:
870
+ return body
871
+ return {**body, "metadata": downgraded}
872
+
873
+ def request(
874
+ self,
875
+ method: str,
876
+ path: str,
877
+ params: dict | None = None,
878
+ data: Any = None,
879
+ files: dict | None = None,
880
+ json: Any = None,
881
+ headers: dict | None = None,
882
+ json_resp: bool = True,
883
+ retry_statuses: Sequence[int] = (),
884
+ retry_if: Callable[[requests.Response], Any] | None = None,
885
+ **kwargs: Any,
886
+ ) -> Any:
887
+ """
888
+ Override of `RESTFullAPIClient.request` that runs
889
+ `_maybe_downgrade_request_metadata` over the outgoing ``json``
890
+ body so DANDI metadata gets downgraded to the server's schema
891
+ version on the way out. See that method's docstring for the
892
+ shape check used and the ref to dandi-schema#343.
893
+ """
894
+ if json is not None:
895
+ json = self._maybe_downgrade_request_metadata(json)
896
+ return super().request(
897
+ method,
898
+ path,
899
+ params=params,
900
+ data=data,
901
+ files=files,
902
+ json=json,
903
+ headers=headers,
904
+ json_resp=json_resp,
905
+ retry_statuses=retry_statuses,
906
+ retry_if=retry_if,
907
+ **kwargs,
908
+ )
762
909
 
763
910
  def get_asset(self, asset_id: str) -> BaseRemoteAsset:
764
911
  """
@@ -1167,6 +1314,15 @@ class RemoteDandiset:
1167
1314
  Only published Dandiset versions can be expected to have valid
1168
1315
  metadata. Consider using `get_raw_metadata()` instead in order to
1169
1316
  fetch unstructured, possibly-invalid metadata.
1317
+
1318
+ Even a published version's metadata can fail to validate. The
1319
+ fetched metadata is validated against the `Dandiset` model of the installed
1320
+ `dandischema`, not against the version of `Dandiset` model that the metadata
1321
+ was published under, so drift between the two can render
1322
+ previously-valid metadata invalid.
1323
+
1324
+ :raises pydantic.ValidationError: if the fetched metadata does not
1325
+ validate against `dandischema.models.Dandiset`
1170
1326
  """
1171
1327
  return models.Dandiset.model_validate(self.get_raw_metadata())
1172
1328
 
@@ -1575,6 +1731,15 @@ class BaseRemoteAsset(ABC, APIBase):
1575
1731
  Only assets in published Dandiset versions can be expected to have
1576
1732
  valid metadata. Consider using `get_raw_metadata()` instead in
1577
1733
  order to fetch unstructured, possibly-invalid metadata.
1734
+
1735
+ Even a published version's asset metadata can fail to validate. The
1736
+ fetched metadata is validated against the `Asset` model of the installed
1737
+ `dandischema`, not against the version of `Asset` model that the metadata
1738
+ was published under, so drift between the two can render
1739
+ previously-valid metadata invalid.
1740
+
1741
+ :raises pydantic.ValidationError: if the fetched metadata does not
1742
+ validate against `dandischema.models.Asset`
1578
1743
  """
1579
1744
  return models.Asset.model_validate(self.get_raw_metadata())
1580
1745