kvgit 0.1.7__tar.gz → 0.1.8__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 (35) hide show
  1. {kvgit-0.1.7 → kvgit-0.1.8}/PKG-INFO +1 -1
  2. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/kv/indexeddb.py +10 -3
  3. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit.egg-info/PKG-INFO +1 -1
  4. {kvgit-0.1.7 → kvgit-0.1.8}/pyproject.toml +1 -1
  5. {kvgit-0.1.7 → kvgit-0.1.8}/LICENSE +0 -0
  6. {kvgit-0.1.7 → kvgit-0.1.8}/README.md +0 -0
  7. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/__init__.py +0 -0
  8. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/content_types.py +0 -0
  9. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/encoding.py +0 -0
  10. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/errors.py +0 -0
  11. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/kv/__init__.py +0 -0
  12. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/kv/base.py +0 -0
  13. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/kv/composite.py +0 -0
  14. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/kv/disk.py +0 -0
  15. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/kv/memory.py +0 -0
  16. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/namespaced.py +0 -0
  17. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/py.typed +0 -0
  18. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/staged.py +0 -0
  19. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/store.py +0 -0
  20. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/versioned/__init__.py +0 -0
  21. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/versioned/base.py +0 -0
  22. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/versioned/gp.py +0 -0
  23. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/versioned/helpers.py +0 -0
  24. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/versioned/kv.py +0 -0
  25. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/versioned/merge.py +0 -0
  26. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/versioned/protocol.py +0 -0
  27. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit.egg-info/SOURCES.txt +0 -0
  28. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit.egg-info/dependency_links.txt +0 -0
  29. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit.egg-info/requires.txt +0 -0
  30. {kvgit-0.1.7 → kvgit-0.1.8}/kvgit.egg-info/top_level.txt +0 -0
  31. {kvgit-0.1.7 → kvgit-0.1.8}/setup.cfg +0 -0
  32. {kvgit-0.1.7 → kvgit-0.1.8}/tests/test_content_types.py +0 -0
  33. {kvgit-0.1.7 → kvgit-0.1.8}/tests/test_namespaced.py +0 -0
  34. {kvgit-0.1.7 → kvgit-0.1.8}/tests/test_staged.py +0 -0
  35. {kvgit-0.1.7 → kvgit-0.1.8}/tests/test_store_factory.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kvgit
3
- Version: 0.1.7
3
+ Version: 0.1.8
4
4
  Summary: Versioned key-value store with git-like commit, branch, and merge semantics.
5
5
  Author: ashenfad
6
6
  License: MIT
@@ -117,10 +117,17 @@ async def _idb_tx_complete(tx):
117
117
 
118
118
 
119
119
  def _to_bytes(js_value) -> bytes | None:
120
- """Convert a JS result to bytes, or None if absent."""
120
+ """Convert a JS result to bytes, or None if absent.
121
+
122
+ Uses Uint8Array.to_py() for fast memcpy from JS to WASM memory,
123
+ avoiding the slow element-wise iteration of bytes(js_proxy).
124
+ """
121
125
  if js_value is None or js_value is undefined:
122
126
  return None
123
- return bytes(js_value)
127
+ from js import Uint8Array # type: ignore[import-not-found]
128
+
129
+ arr = Uint8Array.new(js_value)
130
+ return arr.to_py().tobytes()
124
131
 
125
132
 
126
133
  class IndexedDB(KVStore):
@@ -206,7 +213,7 @@ class IndexedDB(KVStore):
206
213
  def on_success(event):
207
214
  cursor = event.target.result
208
215
  if cursor:
209
- results.append((str(cursor.key), bytes(cursor.value)))
216
+ results.append((str(cursor.key), _to_bytes(cursor.value)))
210
217
  cursor.continue_()
211
218
  else:
212
219
  resolve(None)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kvgit
3
- Version: 0.1.7
3
+ Version: 0.1.8
4
4
  Summary: Versioned key-value store with git-like commit, branch, and merge semantics.
5
5
  Author: ashenfad
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "kvgit"
7
- version = "0.1.7"
7
+ version = "0.1.8"
8
8
  description = "Versioned key-value store with git-like commit, branch, and merge semantics."
9
9
  authors = [{ name = "ashenfad" }]
10
10
  requires-python = ">=3.10"
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