dol 0.4.0__tar.gz → 0.4.2__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 (128) hide show
  1. {dol-0.4.0 → dol-0.4.2}/PKG-INFO +32 -2
  2. {dol-0.4.0 → dol-0.4.2}/README.md +31 -1
  3. dol-0.4.2/dol/tests/test_fsspec_recipe.py +48 -0
  4. {dol-0.4.0 → dol-0.4.2}/pyproject.toml +1 -1
  5. {dol-0.4.0 → dol-0.4.2}/.claude/commands/add-codec.md +0 -0
  6. {dol-0.4.0 → dol-0.4.2}/.claude/commands/explain-store.md +0 -0
  7. {dol-0.4.0 → dol-0.4.2}/.claude/commands/new-store.md +0 -0
  8. {dol-0.4.0 → dol-0.4.2}/.claude/rules/dol-conventions.md +0 -0
  9. {dol-0.4.0 → dol-0.4.2}/.claude/skills/dol-dev-portability/SKILL.md +0 -0
  10. {dol-0.4.0 → dol-0.4.2}/.claude/skills/dol-dev-wrap-kvs/SKILL.md +0 -0
  11. {dol-0.4.0 → dol-0.4.2}/.claude/skills/dol-facade-authoring/SKILL.md +0 -0
  12. {dol-0.4.0 → dol-0.4.2}/.claude/skills/dol-facade-authoring/references/skeleton.md +0 -0
  13. {dol-0.4.0 → dol-0.4.2}/.claude/skills/dol-store-building/SKILL.md +0 -0
  14. {dol-0.4.0 → dol-0.4.2}/.gitattributes +0 -0
  15. {dol-0.4.0 → dol-0.4.2}/.github/workflows/ci.yml +0 -0
  16. {dol-0.4.0 → dol-0.4.2}/.gitignore +0 -0
  17. {dol-0.4.0 → dol-0.4.2}/CLAUDE.md +0 -0
  18. {dol-0.4.0 → dol-0.4.2}/LICENSE +0 -0
  19. {dol-0.4.0 → dol-0.4.2}/dol/__init__.py +0 -0
  20. {dol-0.4.0 → dol-0.4.2}/dol/_codecs_core.py +0 -0
  21. {dol-0.4.0 → dol-0.4.2}/dol/_interface_wrap.py +0 -0
  22. {dol-0.4.0 → dol-0.4.2}/dol/_paths_core.py +0 -0
  23. {dol-0.4.0 → dol-0.4.2}/dol/_relocated.py +0 -0
  24. {dol-0.4.0 → dol-0.4.2}/dol/appendable.py +0 -0
  25. {dol-0.4.0 → dol-0.4.2}/dol/atomic.py +0 -0
  26. {dol-0.4.0 → dol-0.4.2}/dol/base.py +0 -0
  27. {dol-0.4.0 → dol-0.4.2}/dol/cache_keys.py +0 -0
  28. {dol-0.4.0 → dol-0.4.2}/dol/caching.py +0 -0
  29. {dol-0.4.0 → dol-0.4.2}/dol/content.py +0 -0
  30. {dol-0.4.0 → dol-0.4.2}/dol/dig.py +0 -0
  31. {dol-0.4.0 → dol-0.4.2}/dol/errors.py +0 -0
  32. {dol-0.4.0 → dol-0.4.2}/dol/explicit.py +0 -0
  33. {dol-0.4.0 → dol-0.4.2}/dol/filesys.py +0 -0
  34. {dol-0.4.0 → dol-0.4.2}/dol/gitignore.py +0 -0
  35. {dol-0.4.0 → dol-0.4.2}/dol/kv_codecs.py +0 -0
  36. {dol-0.4.0 → dol-0.4.2}/dol/misc.py +0 -0
  37. {dol-0.4.0 → dol-0.4.2}/dol/mixins.py +0 -0
  38. {dol-0.4.0 → dol-0.4.2}/dol/naming.py +0 -0
  39. {dol-0.4.0 → dol-0.4.2}/dol/paths.py +0 -0
  40. {dol-0.4.0 → dol-0.4.2}/dol/py.typed +0 -0
  41. {dol-0.4.0 → dol-0.4.2}/dol/recipes.py +0 -0
  42. {dol-0.4.0 → dol-0.4.2}/dol/records.py +0 -0
  43. {dol-0.4.0 → dol-0.4.2}/dol/scrap/__init__.py +0 -0
  44. {dol-0.4.0 → dol-0.4.2}/dol/scrap/new_store_wrap.py +0 -0
  45. {dol-0.4.0 → dol-0.4.2}/dol/scrap/store_factories.py +0 -0
  46. {dol-0.4.0 → dol-0.4.2}/dol/sig_builtins.py +0 -0
  47. {dol-0.4.0 → dol-0.4.2}/dol/sig_compare.py +0 -0
  48. {dol-0.4.0 → dol-0.4.2}/dol/sig_recipes.py +0 -0
  49. {dol-0.4.0 → dol-0.4.2}/dol/signatures.py +0 -0
  50. {dol-0.4.0 → dol-0.4.2}/dol/sources.py +0 -0
  51. {dol-0.4.0 → dol-0.4.2}/dol/store_addons.py +0 -0
  52. {dol-0.4.0 → dol-0.4.2}/dol/store_caching.py +0 -0
  53. {dol-0.4.0 → dol-0.4.2}/dol/tests/__init__.py +0 -0
  54. {dol-0.4.0 → dol-0.4.2}/dol/tests/base_test.py +0 -0
  55. {dol-0.4.0 → dol-0.4.2}/dol/tests/pickability_test.py +0 -0
  56. {dol-0.4.0 → dol-0.4.2}/dol/tests/scrap.py +0 -0
  57. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_app_folder.py +0 -0
  58. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_appendable.py +0 -0
  59. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_atomic.py +0 -0
  60. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_caching.py +0 -0
  61. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_confirm_overwrite.py +0 -0
  62. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_content.py +0 -0
  63. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_dig.py +0 -0
  64. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_dol_tools.py +0 -0
  65. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_edge_cases.py +0 -0
  66. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_errors.py +0 -0
  67. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_fanout_stores.py +0 -0
  68. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_file_lock.py +0 -0
  69. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_filesys.py +0 -0
  70. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_gitignore.py +0 -0
  71. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_interface_wrap.py +0 -0
  72. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_kv_codecs.py +0 -0
  73. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_mk_dirs_if_missing.py +0 -0
  74. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_on_overwrite.py +0 -0
  75. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_packaging_hygiene.py +0 -0
  76. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_path_writethrough.py +0 -0
  77. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_paths.py +0 -0
  78. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_records.py +0 -0
  79. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_relocated.py +0 -0
  80. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_split_back_compat.py +0 -0
  81. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_trans.py +0 -0
  82. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_update_json.py +0 -0
  83. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_walk_permissions.py +0 -0
  84. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_wrapped_class_attrs.py +0 -0
  85. {dol-0.4.0 → dol-0.4.2}/dol/tests/test_x_of_y_deprecation.py +0 -0
  86. {dol-0.4.0 → dol-0.4.2}/dol/tests/utils_for_tests.py +0 -0
  87. {dol-0.4.0 → dol-0.4.2}/dol/tools.py +0 -0
  88. {dol-0.4.0 → dol-0.4.2}/dol/trans.py +0 -0
  89. {dol-0.4.0 → dol-0.4.2}/dol/trash.py +0 -0
  90. {dol-0.4.0 → dol-0.4.2}/dol/util.py +0 -0
  91. {dol-0.4.0 → dol-0.4.2}/dol/zipfiledol.py +0 -0
  92. {dol-0.4.0 → dol-0.4.2}/llms-full.txt +0 -0
  93. {dol-0.4.0 → dol-0.4.2}/llms.txt +0 -0
  94. {dol-0.4.0 → dol-0.4.2}/misc/TIPS.md +0 -0
  95. {dol-0.4.0 → dol-0.4.2}/misc/codemods/__init__.py +0 -0
  96. {dol-0.4.0 → dol-0.4.2}/misc/codemods/x_of_y_kwargs.py +0 -0
  97. {dol-0.4.0 → dol-0.4.2}/misc/docs/CHANGELOG.md +0 -0
  98. {dol-0.4.0 → dol-0.4.2}/misc/docs/README.md +0 -0
  99. {dol-0.4.0 → dol-0.4.2}/misc/docs/code-quality-improvements.md +0 -0
  100. {dol-0.4.0 → dol-0.4.2}/misc/docs/dol_architecture_map.md +0 -0
  101. {dol-0.4.0 → dol-0.4.2}/misc/docs/dol_content_metadata_bifurcation.md +0 -0
  102. {dol-0.4.0 → dol-0.4.2}/misc/docs/dol_design.md +0 -0
  103. {dol-0.4.0 → dol-0.4.2}/misc/docs/dol_flat_model.md +0 -0
  104. {dol-0.4.0 → dol-0.4.2}/misc/docs/dol_issue10_design.md +0 -0
  105. {dol-0.4.0 → dol-0.4.2}/misc/docs/dol_issue16_design.md +0 -0
  106. {dol-0.4.0 → dol-0.4.2}/misc/docs/dol_issue18_design.md +0 -0
  107. {dol-0.4.0 → dol-0.4.2}/misc/docs/dol_issue83_design.md +0 -0
  108. {dol-0.4.0 → dol-0.4.2}/misc/docs/dol_issue86_design.md +0 -0
  109. {dol-0.4.0 → dol-0.4.2}/misc/docs/dol_issues_report.md +0 -0
  110. {dol-0.4.0 → dol-0.4.2}/misc/docs/dol_roadmap.md +0 -0
  111. {dol-0.4.0 → dol-0.4.2}/misc/docs/frontend_dol_ideas.md +0 -0
  112. {dol-0.4.0 → dol-0.4.2}/misc/docs/general_design.md +0 -0
  113. {dol-0.4.0 → dol-0.4.2}/misc/docs/generate_llms_txt_instruction.md +0 -0
  114. {dol-0.4.0 → dol-0.4.2}/misc/docs/issues_and_discussions.md +0 -0
  115. {dol-0.4.0 → dol-0.4.2}/misc/fleet_ledger/README.md +0 -0
  116. {dol-0.4.0 → dol-0.4.2}/misc/fleet_ledger/__init__.py +0 -0
  117. {dol-0.4.0 → dol-0.4.2}/misc/fleet_ledger/__main__.py +0 -0
  118. {dol-0.4.0 → dol-0.4.2}/misc/fleet_ledger/astscan.py +0 -0
  119. {dol-0.4.0 → dol-0.4.2}/misc/fleet_ledger/baseline.py +0 -0
  120. {dol-0.4.0 → dol-0.4.2}/misc/fleet_ledger/fleet.py +0 -0
  121. {dol-0.4.0 → dol-0.4.2}/misc/fleet_ledger/pins.py +0 -0
  122. {dol-0.4.0 → dol-0.4.2}/misc/fleet_ledger/report.py +0 -0
  123. {dol-0.4.0 → dol-0.4.2}/misc/fleet_ledger/scan.py +0 -0
  124. {dol-0.4.0 → dol-0.4.2}/misc/fleet_ledger/store.py +0 -0
  125. {dol-0.4.0 → dol-0.4.2}/misc/fleet_ledger/surface.py +0 -0
  126. {dol-0.4.0 → dol-0.4.2}/misc/fleet_ledger/tests/__init__.py +0 -0
  127. {dol-0.4.0 → dol-0.4.2}/misc/fleet_ledger/tests/test_astscan.py +0 -0
  128. {dol-0.4.0 → dol-0.4.2}/misc/fleet_ledger/tests/test_ledger.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: dol
3
- Version: 0.4.0
3
+ Version: 0.4.2
4
4
  Summary: Base builtin tools make and transform data object layers (dols).
5
5
  Project-URL: Homepage, https://github.com/i2mint/dol
6
6
  License-Expression: Apache-2.0
@@ -23,7 +23,11 @@ But simply put, what `dol` provides is tools to make your interface with data be
23
23
 
24
24
  The package is light-weight: Pure python; no third-party dependencies.
25
25
 
26
- To install: ```pip install dol```
26
+ To install:
27
+
28
+ ```
29
+ pip install dol
30
+ ```
27
31
 
28
32
  [Documentation here](https://i2mint.github.io/dol/)
29
33
 
@@ -123,6 +127,32 @@ But you could do this with AWS S3 using tools from
123
127
  [mongodol](https://github.com/i2mint/mongodol),
124
128
  github with [hubcap](https://github.com/thorwhalen/hubcap), and so on...
125
129
 
130
+ ### Any fsspec URL is a dol store
131
+
132
+ For a backend that has no `*dol` package of its own (GCS, HTTP, SFTP, a zip, ...), use [fsspec](https://filesystem-spec.readthedocs.io/) as the transport. `fsspec.get_mapper(url)` already returns a `MutableMapping`, so dol's codecs wrap it directly, and dol itself still needs no dependency:
133
+
134
+ ```python
135
+ import fsspec
136
+ from dol import Pipe, ValueCodecs, KeyCodecs
137
+
138
+ store = Pipe(
139
+ ValueCodecs.str_to_bytes(), # fsspec stores bytes
140
+ ValueCodecs.json(),
141
+ KeyCodecs.suffixed(".json"),
142
+ )(fsspec.get_mapper("gcs://my-bucket/prefix"))
143
+
144
+ store["config"] = {"a": 1} # written as config.json
145
+ store["config"] # {'a': 1}
146
+ ```
147
+
148
+ Three things to know:
149
+
150
+ 1. Put an explicit bytes codec (`ValueCodecs.str_to_bytes()`, `pickle`, ...) under any codec that produces `str`: fsspec mappers store bytes, and backends disagree on `str` values (`memory://` raises `TypeError`, `s3://` silently encodes).
151
+ 2. Keys are paths under the root, and nested keys (`sub/b`) are listed recursively.
152
+ 3. A missing key raises `KeyError`, but a missing bucket raises `FileNotFoundError` when you list the store.
153
+
154
+ For S3, prefer [s3dol](https://github.com/i2mint/s3dol): it adds bucket management, provider presets, an error taxonomy and large-object support that a plain fsspec mapper does not have.
155
+
126
156
  All of these extensions provide adapters from various data sources/targets to the
127
157
  dict-like interface (called "Mapping" in python typing).
128
158
  What `dol` provides are base tools to make a path from these to the interface
@@ -11,7 +11,11 @@ But simply put, what `dol` provides is tools to make your interface with data be
11
11
 
12
12
  The package is light-weight: Pure python; no third-party dependencies.
13
13
 
14
- To install: ```pip install dol```
14
+ To install:
15
+
16
+ ```
17
+ pip install dol
18
+ ```
15
19
 
16
20
  [Documentation here](https://i2mint.github.io/dol/)
17
21
 
@@ -111,6 +115,32 @@ But you could do this with AWS S3 using tools from
111
115
  [mongodol](https://github.com/i2mint/mongodol),
112
116
  github with [hubcap](https://github.com/thorwhalen/hubcap), and so on...
113
117
 
118
+ ### Any fsspec URL is a dol store
119
+
120
+ For a backend that has no `*dol` package of its own (GCS, HTTP, SFTP, a zip, ...), use [fsspec](https://filesystem-spec.readthedocs.io/) as the transport. `fsspec.get_mapper(url)` already returns a `MutableMapping`, so dol's codecs wrap it directly, and dol itself still needs no dependency:
121
+
122
+ ```python
123
+ import fsspec
124
+ from dol import Pipe, ValueCodecs, KeyCodecs
125
+
126
+ store = Pipe(
127
+ ValueCodecs.str_to_bytes(), # fsspec stores bytes
128
+ ValueCodecs.json(),
129
+ KeyCodecs.suffixed(".json"),
130
+ )(fsspec.get_mapper("gcs://my-bucket/prefix"))
131
+
132
+ store["config"] = {"a": 1} # written as config.json
133
+ store["config"] # {'a': 1}
134
+ ```
135
+
136
+ Three things to know:
137
+
138
+ 1. Put an explicit bytes codec (`ValueCodecs.str_to_bytes()`, `pickle`, ...) under any codec that produces `str`: fsspec mappers store bytes, and backends disagree on `str` values (`memory://` raises `TypeError`, `s3://` silently encodes).
139
+ 2. Keys are paths under the root, and nested keys (`sub/b`) are listed recursively.
140
+ 3. A missing key raises `KeyError`, but a missing bucket raises `FileNotFoundError` when you list the store.
141
+
142
+ For S3, prefer [s3dol](https://github.com/i2mint/s3dol): it adds bucket management, provider presets, an error taxonomy and large-object support that a plain fsspec mapper does not have.
143
+
114
144
  All of these extensions provide adapters from various data sources/targets to the
115
145
  dict-like interface (called "Mapping" in python typing).
116
146
  What `dol` provides are base tools to make a path from these to the interface
@@ -0,0 +1,48 @@
1
+ """The README's "Any fsspec URL is a dol store" recipe (#217).
2
+
3
+ Skipped when fsspec is not installed: dol itself never depends on it.
4
+ """
5
+
6
+ import uuid
7
+
8
+ import pytest
9
+
10
+ fsspec = pytest.importorskip("fsspec")
11
+
12
+ from dol import KeyCodecs, Pipe, ValueCodecs
13
+
14
+
15
+ def _json_store(mapper):
16
+ return Pipe(
17
+ ValueCodecs.str_to_bytes(), ValueCodecs.json(), KeyCodecs.suffixed(".json")
18
+ )(mapper)
19
+
20
+
21
+ @pytest.fixture
22
+ def mapper():
23
+ return fsspec.get_mapper(f"memory://dol-recipe-{uuid.uuid4().hex}")
24
+
25
+
26
+ def test_round_trip_through_an_fsspec_mapper(mapper):
27
+ store = _json_store(mapper)
28
+ store["config"] = {"a": 1}
29
+ store["sub/b"] = [1, 2]
30
+ assert store["config"] == {"a": 1}
31
+ assert "config" in store
32
+ assert sorted(store) == ["config", "sub/b"]
33
+ assert sorted(mapper) == ["config.json", "sub/b.json"]
34
+ assert mapper["config.json"] == b'{"a": 1}'
35
+ del store["config"]
36
+ assert list(store) == ["sub/b"]
37
+
38
+
39
+ def test_a_missing_key_raises_key_error(mapper):
40
+ store = _json_store(mapper)
41
+ with pytest.raises(KeyError):
42
+ store["nope"]
43
+
44
+
45
+ def test_the_bytes_codec_is_needed_under_json(mapper):
46
+ store = Pipe(ValueCodecs.json(), KeyCodecs.suffixed(".json"))(mapper)
47
+ with pytest.raises(TypeError):
48
+ store["config"] = {"a": 1}
@@ -15,7 +15,7 @@ artifacts = ["dol/py.typed"]
15
15
 
16
16
  [project]
17
17
  name = "dol"
18
- version = "0.4.0"
18
+ version = "0.4.2"
19
19
  description = "Base builtin tools make and transform data object layers (dols)."
20
20
  license = "Apache-2.0"
21
21
  readme = "README.md"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes