virtuals-binary-codec 0.1.0__tar.gz → 0.1.1__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 (17) hide show
  1. {virtuals_binary_codec-0.1.0/src/virtuals_binary_codec.egg-info → virtuals_binary_codec-0.1.1}/PKG-INFO +1 -1
  2. {virtuals_binary_codec-0.1.0 → virtuals_binary_codec-0.1.1}/pyproject.toml +1 -1
  3. {virtuals_binary_codec-0.1.0 → virtuals_binary_codec-0.1.1}/src/virtuals_binary_codec/binary_codec.pyi +4 -0
  4. {virtuals_binary_codec-0.1.0 → virtuals_binary_codec-0.1.1}/src/virtuals_binary_codec/binary_codec.pyx +18 -0
  5. {virtuals_binary_codec-0.1.0 → virtuals_binary_codec-0.1.1/src/virtuals_binary_codec.egg-info}/PKG-INFO +1 -1
  6. {virtuals_binary_codec-0.1.0 → virtuals_binary_codec-0.1.1}/LICENSE +0 -0
  7. {virtuals_binary_codec-0.1.0 → virtuals_binary_codec-0.1.1}/MANIFEST.in +0 -0
  8. {virtuals_binary_codec-0.1.0 → virtuals_binary_codec-0.1.1}/README.md +0 -0
  9. {virtuals_binary_codec-0.1.0 → virtuals_binary_codec-0.1.1}/setup.cfg +0 -0
  10. {virtuals_binary_codec-0.1.0 → virtuals_binary_codec-0.1.1}/setup.py +0 -0
  11. {virtuals_binary_codec-0.1.0 → virtuals_binary_codec-0.1.1}/src/virtuals_binary_codec/__init__.py +0 -0
  12. {virtuals_binary_codec-0.1.0 → virtuals_binary_codec-0.1.1}/src/virtuals_binary_codec/exceptions.py +0 -0
  13. {virtuals_binary_codec-0.1.0 → virtuals_binary_codec-0.1.1}/src/virtuals_binary_codec.egg-info/SOURCES.txt +0 -0
  14. {virtuals_binary_codec-0.1.0 → virtuals_binary_codec-0.1.1}/src/virtuals_binary_codec.egg-info/dependency_links.txt +0 -0
  15. {virtuals_binary_codec-0.1.0 → virtuals_binary_codec-0.1.1}/src/virtuals_binary_codec.egg-info/not-zip-safe +0 -0
  16. {virtuals_binary_codec-0.1.0 → virtuals_binary_codec-0.1.1}/src/virtuals_binary_codec.egg-info/requires.txt +0 -0
  17. {virtuals_binary_codec-0.1.0 → virtuals_binary_codec-0.1.1}/src/virtuals_binary_codec.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: virtuals-binary-codec
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Cython-optimized binary key codec for Virtuals.
5
5
  Author-email: Gor Arakelyan <gorarkln@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -10,7 +10,7 @@ build-backend = "setuptools.build_meta"
10
10
  # ============================================================================
11
11
  [project]
12
12
  name = "virtuals-binary-codec"
13
- version = "0.1.0"
13
+ version = "0.1.1"
14
14
  description = "Cython-optimized binary key codec for Virtuals."
15
15
  readme = "README.md"
16
16
  license = "Apache-2.0"
@@ -12,3 +12,7 @@ class BinaryKeyCodec:
12
12
  def decode(self, encoded: bytes) -> tuple[str | int, ...]:
13
13
  """Decode binary data back to original tuple key."""
14
14
  ...
15
+
16
+ def upper_bound_of_prefix(self, key: tuple[str | int, ...]) -> bytes:
17
+ r"""Bytes strictly greater than every child key of ``key`` (``encode(key) + b"\xff"``)."""
18
+ ...
@@ -241,6 +241,24 @@ cdef class BinaryKeyCodec:
241
241
 
242
242
  return result
243
243
 
244
+ def upper_bound_of_prefix(self, tuple key):
245
+ """Encoded bytes strictly greater than every child key of ``key``.
246
+
247
+ Appends ``0xFF`` to ``encode(key)``. The trailing 0xFF sorts strictly
248
+ above every valid segment type marker (``TYPE_INT=0x01``, ``TYPE_STR=0x02``),
249
+ so any child key of the form ``key + (segment,)`` compares less than
250
+ the returned bytes. Used by container-side reverse scans to seed
251
+ ``StorageScanOptions.start`` with an inclusive upper bound of the
252
+ child prefix range.
253
+
254
+ Args:
255
+ key: Tuple containing strings and/or integers
256
+
257
+ Returns:
258
+ Binary bytes that sort strictly greater than every child key of ``key``
259
+ """
260
+ return self.encode(key) + b"\xff"
261
+
244
262
  def decode(self, bytes encoded):
245
263
  """Decode binary data back to original tuple key.
246
264
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: virtuals-binary-codec
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Cython-optimized binary key codec for Virtuals.
5
5
  Author-email: Gor Arakelyan <gorarkln@gmail.com>
6
6
  License-Expression: Apache-2.0