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
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,112 @@
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 the package.
28
+
29
+ This module provides access to the flatc binary that is bundled with the package,
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 <package>._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
+ Note: This file is shared across WAMP ecosystem projects via wamp-cicd.
48
+ Source: wamp-cicd/scripts/flatc/_flatc.py
49
+ Projects copy this file to: src/<package>/_flatc/__init__.py
50
+ """
51
+
52
+ import os
53
+ import subprocess
54
+ import sys
55
+ from pathlib import Path
56
+ from typing import List, Optional
57
+
58
+
59
+ def get_flatc_path() -> Path:
60
+ """
61
+ Get the path to the bundled flatc executable.
62
+
63
+ :returns: Path to the flatc binary
64
+ :raises FileNotFoundError: If flatc binary is not found
65
+ """
66
+ exe_name = "flatc.exe" if os.name == "nt" else "flatc"
67
+ flatc_path = Path(__file__).parent / "bin" / exe_name
68
+
69
+ if not flatc_path.exists():
70
+ # Determine package name from module path for helpful error message
71
+ module_parts = __name__.split(".")
72
+ pkg_name = module_parts[0] if module_parts else "package"
73
+ raise FileNotFoundError(
74
+ f"flatc binary not found at {flatc_path}. "
75
+ f"This may indicate a corrupted installation. "
76
+ f"Try reinstalling: pip install --force-reinstall {pkg_name}"
77
+ )
78
+
79
+ return flatc_path
80
+
81
+
82
+ def run_flatc(args: List[str], cwd: Optional[str] = None) -> int:
83
+ """
84
+ Run the bundled flatc with the given arguments.
85
+
86
+ :param args: Command line arguments to pass to flatc
87
+ :param cwd: Working directory for flatc execution
88
+ :returns: Return code from flatc
89
+ """
90
+ flatc_path = get_flatc_path()
91
+ return subprocess.call([str(flatc_path)] + args, cwd=cwd)
92
+
93
+
94
+ def main() -> None:
95
+ """
96
+ Entry point for the flatc console script.
97
+
98
+ Forwards all CLI arguments to the bundled flatc binary.
99
+ """
100
+ try:
101
+ flatc_path = get_flatc_path()
102
+ except FileNotFoundError as e:
103
+ print(str(e), file=sys.stderr)
104
+ raise SystemExit(1)
105
+
106
+ # Forward all CLI arguments to flatc
107
+ ret = subprocess.call([str(flatc_path)] + sys.argv[1:])
108
+ raise SystemExit(ret)
109
+
110
+
111
+ if __name__ == "__main__":
112
+ main()
zlmdb/_flatc/bin/flatc ADDED
Binary file
@@ -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
+ }