zlmdb 25.12.2__cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_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 (76) 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 +105 -0
  5. zlmdb/_lmdb_vendor/__init__.py +37 -0
  6. zlmdb/_lmdb_vendor/__main__.py +25 -0
  7. zlmdb/_lmdb_vendor/_config.py +10 -0
  8. zlmdb/_lmdb_vendor/_lmdb_cffi.cpython-314t-aarch64-linux-gnu.so +0 -0
  9. zlmdb/_lmdb_vendor/cffi.py +2606 -0
  10. zlmdb/_lmdb_vendor/tool.py +670 -0
  11. zlmdb/_meta.py +27 -0
  12. zlmdb/_pmap.py +1667 -0
  13. zlmdb/_schema.py +137 -0
  14. zlmdb/_transaction.py +181 -0
  15. zlmdb/_types.py +1596 -0
  16. zlmdb/_version.py +27 -0
  17. zlmdb/cli.py +41 -0
  18. zlmdb/flatbuffers/__init__.py +60 -0
  19. zlmdb/flatbuffers/_git_version.py +24 -0
  20. zlmdb/flatbuffers/_version.py +17 -0
  21. zlmdb/flatbuffers/builder.py +824 -0
  22. zlmdb/flatbuffers/compat.py +89 -0
  23. zlmdb/flatbuffers/encode.py +43 -0
  24. zlmdb/flatbuffers/flexbuffers.py +1570 -0
  25. zlmdb/flatbuffers/number_types.py +182 -0
  26. zlmdb/flatbuffers/packer.py +42 -0
  27. zlmdb/flatbuffers/reflection/AdvancedFeatures.py +10 -0
  28. zlmdb/flatbuffers/reflection/BaseType.py +25 -0
  29. zlmdb/flatbuffers/reflection/Enum.py +252 -0
  30. zlmdb/flatbuffers/reflection/EnumVal.py +144 -0
  31. zlmdb/flatbuffers/reflection/Field.py +325 -0
  32. zlmdb/flatbuffers/reflection/KeyValue.py +84 -0
  33. zlmdb/flatbuffers/reflection/Object.py +260 -0
  34. zlmdb/flatbuffers/reflection/RPCCall.py +195 -0
  35. zlmdb/flatbuffers/reflection/Schema.py +301 -0
  36. zlmdb/flatbuffers/reflection/SchemaFile.py +112 -0
  37. zlmdb/flatbuffers/reflection/Service.py +213 -0
  38. zlmdb/flatbuffers/reflection/Type.py +148 -0
  39. zlmdb/flatbuffers/reflection/__init__.py +0 -0
  40. zlmdb/flatbuffers/reflection.fbs +156 -0
  41. zlmdb/flatbuffers/table.py +129 -0
  42. zlmdb/flatbuffers/util.py +47 -0
  43. zlmdb/py.typed +0 -0
  44. zlmdb/tests/conftest.py +9 -0
  45. zlmdb/tests/lmdb/__init__.py +0 -0
  46. zlmdb/tests/lmdb/address_book.py +287 -0
  47. zlmdb/tests/lmdb/crash_test.py +339 -0
  48. zlmdb/tests/lmdb/cursor_test.py +333 -0
  49. zlmdb/tests/lmdb/env_test.py +919 -0
  50. zlmdb/tests/lmdb/getmulti_test.py +92 -0
  51. zlmdb/tests/lmdb/iteration_test.py +258 -0
  52. zlmdb/tests/lmdb/package_test.py +70 -0
  53. zlmdb/tests/lmdb/test_lmdb.py +188 -0
  54. zlmdb/tests/lmdb/testlib.py +185 -0
  55. zlmdb/tests/lmdb/tool_test.py +60 -0
  56. zlmdb/tests/lmdb/txn_test.py +575 -0
  57. zlmdb/tests/orm/MNodeLog.py +853 -0
  58. zlmdb/tests/orm/__init__.py +0 -0
  59. zlmdb/tests/orm/_schema_fbs.py +215 -0
  60. zlmdb/tests/orm/_schema_mnode_log.py +1202 -0
  61. zlmdb/tests/orm/_schema_py2.py +250 -0
  62. zlmdb/tests/orm/_schema_py3.py +307 -0
  63. zlmdb/tests/orm/_test_flatbuffers.py +144 -0
  64. zlmdb/tests/orm/_test_serialization.py +144 -0
  65. zlmdb/tests/orm/test_basic.py +217 -0
  66. zlmdb/tests/orm/test_etcd.py +275 -0
  67. zlmdb/tests/orm/test_pmap_indexes.py +466 -0
  68. zlmdb/tests/orm/test_pmap_types.py +90 -0
  69. zlmdb/tests/orm/test_pmaps.py +295 -0
  70. zlmdb/tests/orm/test_select.py +619 -0
  71. zlmdb-25.12.2.dist-info/METADATA +280 -0
  72. zlmdb-25.12.2.dist-info/RECORD +76 -0
  73. zlmdb-25.12.2.dist-info/WHEEL +7 -0
  74. zlmdb-25.12.2.dist-info/entry_points.txt +3 -0
  75. zlmdb-25.12.2.dist-info/licenses/LICENSE +167 -0
  76. zlmdb-25.12.2.dist-info/licenses/NOTICE +41 -0
zlmdb/_errors.py ADDED
@@ -0,0 +1,31 @@
1
+ ###############################################################################
2
+ #
3
+ # The MIT License (MIT)
4
+ #
5
+ # Copyright (c) typedef int GmbH
6
+ #
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in
15
+ # all copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ # THE SOFTWARE.
24
+ #
25
+ ###############################################################################
26
+
27
+
28
+ class NullValueConstraint(RuntimeError):
29
+ """
30
+ Null value in indexed column violates not-null constraint.
31
+ """
@@ -0,0 +1,105 @@
1
+ ###############################################################################
2
+ #
3
+ # The MIT License (MIT)
4
+ #
5
+ # Copyright (c) typedef int GmbH
6
+ #
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in
15
+ # all copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ # THE SOFTWARE.
24
+ #
25
+ ###############################################################################
26
+ """
27
+ FlatBuffers compiler (flatc) bundled with zlmdb.
28
+
29
+ This module provides access to the flatc binary that is bundled with zlmdb,
30
+ ensuring version compatibility with the vendored FlatBuffers runtime.
31
+
32
+ Usage from command line::
33
+
34
+ flatc --version
35
+ flatc --python -o output/ schema.fbs
36
+
37
+ Usage from Python::
38
+
39
+ from zlmdb._flatc import get_flatc_path, run_flatc
40
+
41
+ # Get path to flatc binary
42
+ flatc_path = get_flatc_path()
43
+
44
+ # Run flatc with arguments
45
+ returncode = run_flatc(["--version"])
46
+ """
47
+
48
+ import os
49
+ import subprocess
50
+ import sys
51
+ from pathlib import Path
52
+ from typing import List, Optional
53
+
54
+
55
+ def get_flatc_path() -> Path:
56
+ """
57
+ Get the path to the bundled flatc executable.
58
+
59
+ :returns: Path to the flatc binary
60
+ :raises FileNotFoundError: If flatc binary is not found
61
+ """
62
+ exe_name = "flatc.exe" if os.name == "nt" else "flatc"
63
+ flatc_path = Path(__file__).parent / "bin" / exe_name
64
+
65
+ if not flatc_path.exists():
66
+ raise FileNotFoundError(
67
+ f"flatc binary not found at {flatc_path}. "
68
+ f"This may indicate a corrupted installation. "
69
+ f"Try reinstalling zlmdb: pip install --force-reinstall zlmdb"
70
+ )
71
+
72
+ return flatc_path
73
+
74
+
75
+ def run_flatc(args: List[str], cwd: Optional[str] = None) -> int:
76
+ """
77
+ Run the bundled flatc with the given arguments.
78
+
79
+ :param args: Command line arguments to pass to flatc
80
+ :param cwd: Working directory for flatc execution
81
+ :returns: Return code from flatc
82
+ """
83
+ flatc_path = get_flatc_path()
84
+ return subprocess.call([str(flatc_path)] + args, cwd=cwd)
85
+
86
+
87
+ def main() -> None:
88
+ """
89
+ Entry point for the flatc console script.
90
+
91
+ Forwards all CLI arguments to the bundled flatc binary.
92
+ """
93
+ try:
94
+ flatc_path = get_flatc_path()
95
+ except FileNotFoundError as e:
96
+ print(str(e), file=sys.stderr)
97
+ raise SystemExit(1)
98
+
99
+ # Forward all CLI arguments to flatc
100
+ ret = subprocess.call([str(flatc_path)] + sys.argv[1:])
101
+ raise SystemExit(ret)
102
+
103
+
104
+ if __name__ == "__main__":
105
+ main()
@@ -0,0 +1,37 @@
1
+ # Copyright 2013-2025 The py-lmdb authors, all rights reserved.
2
+ #
3
+ # Redistribution and use in source and binary forms, with or without
4
+ # modification, are permitted only as authorized by the OpenLDAP
5
+ # Public License.
6
+ #
7
+ # A copy of this license is available in the file LICENSE in the
8
+ # top-level directory of the distribution or, alternatively, at
9
+ # <http://www.OpenLDAP.org/license.html>.
10
+ #
11
+ # OpenLDAP is a registered trademark of the OpenLDAP Foundation.
12
+ #
13
+ # Individual files and/or contributed packages may be copyright by
14
+ # other parties and/or subject to additional restrictions.
15
+ #
16
+ # This work also contains materials derived from public sources.
17
+ #
18
+ # Additional information about OpenLDAP can be obtained at
19
+ # <http://www.openldap.org/>.
20
+
21
+ """
22
+ Python wrapper for OpenLDAP's "Lightning" MDB database.
23
+
24
+ Please see https://lmdb.readthedocs.io/
25
+ """
26
+
27
+
28
+ def _reading_docs():
29
+ """Return True if Sphinx is currently parsing this file."""
30
+ return "sphinx" in __import__("sys").modules
31
+
32
+
33
+ # CFFI-only mode (bundled with zlmdb)
34
+ from zlmdb._lmdb_vendor.cffi import *
35
+ from zlmdb._lmdb_vendor.cffi import open
36
+ from zlmdb._lmdb_vendor.cffi import __all__
37
+ from zlmdb._lmdb_vendor.cffi import __doc__
@@ -0,0 +1,25 @@
1
+ # Copyright 2013-2024 The py-lmdb authors, all rights reserved.
2
+ #
3
+ # Redistribution and use in source and binary forms, with or without
4
+ # modification, are permitted only as authorized by the OpenLDAP
5
+ # Public License.
6
+ #
7
+ # A copy of this license is available in the file LICENSE in the
8
+ # top-level directory of the distribution or, alternatively, at
9
+ # <http://www.OpenLDAP.org/license.html>.
10
+ #
11
+ # OpenLDAP is a registered trademark of the OpenLDAP Foundation.
12
+ #
13
+ # Individual files and/or contributed packages may be copyright by
14
+ # other parties and/or subject to additional restrictions.
15
+ #
16
+ # This work also contains materials derived from public sources.
17
+ #
18
+ # Additional information about OpenLDAP can be obtained at
19
+ # <http://www.openldap.org/>.
20
+
21
+ # Hack to support Python >=v2.6 'python -m zlmdb._lmdb_vendor'
22
+ from __future__ import absolute_import
23
+ from . import tool # type: ignore[import-not-found]
24
+
25
+ tool.main()
@@ -0,0 +1,10 @@
1
+ # Auto-generated by build_lmdb.py
2
+ # DO NOT EDIT - regenerated on each build
3
+
4
+ CONFIG = {
5
+ 'extra_compile_args': ['-UNDEBUG', '-DHAVE_PATCHED_LMDB=1', '-w'],
6
+ 'extra_sources': ['build/lmdb-src/mdb.c', 'build/lmdb-src/midl.c'],
7
+ 'extra_library_dirs': [],
8
+ 'extra_include_dirs': ['build/lmdb-src', 'lmdb-patches'],
9
+ 'libraries': [],
10
+ }