zlmdb 25.12.3__cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl

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 (78) hide show
  1. zlmdb/__init__.py +416 -0
  2. zlmdb/_database.py +990 -0
  3. zlmdb/_errors.py +31 -0
  4. zlmdb/_flatc/__init__.py +112 -0
  5. zlmdb/_flatc/bin/flatc +0 -0
  6. zlmdb/_lmdb_vendor/__init__.py +37 -0
  7. zlmdb/_lmdb_vendor/__main__.py +25 -0
  8. zlmdb/_lmdb_vendor/_config.py +10 -0
  9. zlmdb/_lmdb_vendor/_lmdb_cffi.cpython-312-aarch64-linux-gnu.so +0 -0
  10. zlmdb/_lmdb_vendor/cffi.py +2606 -0
  11. zlmdb/_lmdb_vendor/tool.py +670 -0
  12. zlmdb/_meta.py +27 -0
  13. zlmdb/_pmap.py +1667 -0
  14. zlmdb/_schema.py +137 -0
  15. zlmdb/_transaction.py +181 -0
  16. zlmdb/_types.py +1596 -0
  17. zlmdb/_version.py +27 -0
  18. zlmdb/cli.py +41 -0
  19. zlmdb/flatbuffers/__init__.py +60 -0
  20. zlmdb/flatbuffers/_git_version.py +24 -0
  21. zlmdb/flatbuffers/_version.py +17 -0
  22. zlmdb/flatbuffers/builder.py +824 -0
  23. zlmdb/flatbuffers/compat.py +89 -0
  24. zlmdb/flatbuffers/encode.py +43 -0
  25. zlmdb/flatbuffers/flexbuffers.py +1570 -0
  26. zlmdb/flatbuffers/number_types.py +182 -0
  27. zlmdb/flatbuffers/packer.py +42 -0
  28. zlmdb/flatbuffers/reflection/AdvancedFeatures.py +10 -0
  29. zlmdb/flatbuffers/reflection/BaseType.py +25 -0
  30. zlmdb/flatbuffers/reflection/Enum.py +252 -0
  31. zlmdb/flatbuffers/reflection/EnumVal.py +144 -0
  32. zlmdb/flatbuffers/reflection/Field.py +325 -0
  33. zlmdb/flatbuffers/reflection/KeyValue.py +84 -0
  34. zlmdb/flatbuffers/reflection/Object.py +260 -0
  35. zlmdb/flatbuffers/reflection/RPCCall.py +195 -0
  36. zlmdb/flatbuffers/reflection/Schema.py +301 -0
  37. zlmdb/flatbuffers/reflection/SchemaFile.py +112 -0
  38. zlmdb/flatbuffers/reflection/Service.py +213 -0
  39. zlmdb/flatbuffers/reflection/Type.py +148 -0
  40. zlmdb/flatbuffers/reflection/__init__.py +0 -0
  41. zlmdb/flatbuffers/reflection.bfbs +0 -0
  42. zlmdb/flatbuffers/reflection.fbs +156 -0
  43. zlmdb/flatbuffers/table.py +129 -0
  44. zlmdb/flatbuffers/util.py +47 -0
  45. zlmdb/py.typed +0 -0
  46. zlmdb/tests/conftest.py +9 -0
  47. zlmdb/tests/lmdb/__init__.py +0 -0
  48. zlmdb/tests/lmdb/address_book.py +287 -0
  49. zlmdb/tests/lmdb/crash_test.py +339 -0
  50. zlmdb/tests/lmdb/cursor_test.py +333 -0
  51. zlmdb/tests/lmdb/env_test.py +919 -0
  52. zlmdb/tests/lmdb/getmulti_test.py +92 -0
  53. zlmdb/tests/lmdb/iteration_test.py +258 -0
  54. zlmdb/tests/lmdb/package_test.py +70 -0
  55. zlmdb/tests/lmdb/test_lmdb.py +188 -0
  56. zlmdb/tests/lmdb/testlib.py +185 -0
  57. zlmdb/tests/lmdb/tool_test.py +60 -0
  58. zlmdb/tests/lmdb/txn_test.py +575 -0
  59. zlmdb/tests/orm/MNodeLog.py +853 -0
  60. zlmdb/tests/orm/__init__.py +0 -0
  61. zlmdb/tests/orm/_schema_fbs.py +215 -0
  62. zlmdb/tests/orm/_schema_mnode_log.py +1202 -0
  63. zlmdb/tests/orm/_schema_py2.py +250 -0
  64. zlmdb/tests/orm/_schema_py3.py +307 -0
  65. zlmdb/tests/orm/_test_flatbuffers.py +144 -0
  66. zlmdb/tests/orm/_test_serialization.py +144 -0
  67. zlmdb/tests/orm/test_basic.py +217 -0
  68. zlmdb/tests/orm/test_etcd.py +275 -0
  69. zlmdb/tests/orm/test_pmap_indexes.py +466 -0
  70. zlmdb/tests/orm/test_pmap_types.py +90 -0
  71. zlmdb/tests/orm/test_pmaps.py +295 -0
  72. zlmdb/tests/orm/test_select.py +619 -0
  73. zlmdb-25.12.3.dist-info/METADATA +277 -0
  74. zlmdb-25.12.3.dist-info/RECORD +78 -0
  75. zlmdb-25.12.3.dist-info/WHEEL +6 -0
  76. zlmdb-25.12.3.dist-info/entry_points.txt +3 -0
  77. zlmdb-25.12.3.dist-info/licenses/LICENSE +167 -0
  78. zlmdb-25.12.3.dist-info/licenses/NOTICE +41 -0
@@ -0,0 +1,89 @@
1
+ # Copyright 2016 Google Inc. All rights reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ """A tiny version of `six` to help with backwards compability. Also includes
16
+ compatibility helpers for numpy."""
17
+
18
+ import sys
19
+
20
+ PY2 = sys.version_info[0] == 2
21
+ PY26 = sys.version_info[0:2] == (2, 6)
22
+ PY27 = sys.version_info[0:2] == (2, 7)
23
+ PY275 = sys.version_info[0:3] >= (2, 7, 5)
24
+ PY3 = sys.version_info[0] == 3
25
+ PY34 = sys.version_info[0:2] >= (3, 4)
26
+
27
+ if PY3:
28
+ import importlib.machinery
29
+
30
+ string_types = (str,)
31
+ binary_types = (bytes, bytearray)
32
+ range_func = range
33
+ memoryview_type = memoryview
34
+ struct_bool_decl = "?"
35
+ else:
36
+ import imp
37
+
38
+ string_types = (unicode,)
39
+ if PY26 or PY27:
40
+ binary_types = (str, bytearray)
41
+ else:
42
+ binary_types = (str,)
43
+ range_func = xrange
44
+ if PY26 or (PY27 and not PY275):
45
+ memoryview_type = buffer
46
+ struct_bool_decl = "<b"
47
+ else:
48
+ memoryview_type = memoryview
49
+ struct_bool_decl = "?"
50
+
51
+ # Helper functions to facilitate making numpy optional instead of required
52
+
53
+
54
+ def import_numpy():
55
+ """
56
+ Returns the numpy module if it exists on the system,
57
+ otherwise returns None.
58
+ """
59
+ if PY3:
60
+ numpy_exists = importlib.machinery.PathFinder.find_spec("numpy") is not None
61
+ else:
62
+ try:
63
+ imp.find_module("numpy")
64
+ numpy_exists = True
65
+ except ImportError:
66
+ numpy_exists = False
67
+
68
+ if numpy_exists:
69
+ # We do this outside of try/except block in case numpy exists
70
+ # but is not installed correctly. We do not want to catch an
71
+ # incorrect installation which would manifest as an
72
+ # ImportError.
73
+ import numpy as np
74
+ else:
75
+ np = None
76
+
77
+ return np
78
+
79
+
80
+ class NumpyRequiredForThisFeature(RuntimeError):
81
+ """
82
+ Error raised when user tries to use a feature that
83
+ requires numpy without having numpy installed.
84
+ """
85
+
86
+ pass
87
+
88
+
89
+ # NOTE: Future Jython support may require code here (look at `six`).
@@ -0,0 +1,43 @@
1
+ # Copyright 2014 Google Inc. All rights reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ from . import number_types as N
16
+ from . import packer
17
+ from .compat import memoryview_type
18
+ from .compat import import_numpy, NumpyRequiredForThisFeature
19
+
20
+ np = import_numpy()
21
+
22
+ FILE_IDENTIFIER_LENGTH = 4
23
+
24
+
25
+ def Get(packer_type, buf, head):
26
+ """Get decodes a value at buf[head] using `packer_type`."""
27
+ return packer_type.unpack_from(memoryview_type(buf), head)[0]
28
+
29
+
30
+ def GetVectorAsNumpy(numpy_type, buf, count, offset):
31
+ """GetVecAsNumpy decodes values starting at buf[head] as
32
+ `numpy_type`, where `numpy_type` is a numpy dtype."""
33
+ if np is not None:
34
+ # TODO: could set .flags.writeable = False to make users jump through
35
+ # hoops before modifying...
36
+ return np.frombuffer(buf, dtype=numpy_type, count=count, offset=offset)
37
+ else:
38
+ raise NumpyRequiredForThisFeature("Numpy was not found.")
39
+
40
+
41
+ def Write(packer_type, buf, head, n):
42
+ """Write encodes `n` at buf[head] using `packer_type`."""
43
+ packer_type.pack_into(buf, head, n)