lora-python 0.2.0__cp38-abi3-win_amd64.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.
@@ -0,0 +1,138 @@
1
+ Metadata-Version: 2.4
2
+ Name: lora-python
3
+ Version: 0.2.0
4
+ Classifier: Programming Language :: Rust
5
+ Classifier: Programming Language :: Python :: 3
6
+ Classifier: Programming Language :: Python :: 3.8
7
+ Classifier: Programming Language :: Python :: 3.9
8
+ Classifier: Programming Language :: Python :: 3.10
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: Implementation :: CPython
12
+ Classifier: License :: Other/Proprietary License
13
+ Classifier: Operating System :: POSIX :: Linux
14
+ Classifier: Operating System :: MacOS
15
+ Classifier: Operating System :: Microsoft :: Windows
16
+ Classifier: Typing :: Typed
17
+ Classifier: Development Status :: 3 - Alpha
18
+ Requires-Dist: pytest>=8.0 ; extra == 'test'
19
+ Requires-Dist: pytest-asyncio>=0.23 ; extra == 'test'
20
+ Provides-Extra: test
21
+ License-File: LICENSE
22
+ Summary: Python bindings for the Lora in-memory graph database
23
+ Author: LoraDB, Inc.
24
+ License: BUSL-1.1
25
+ Requires-Python: >=3.8
26
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
27
+ Project-URL: Homepage, https://github.com/lora-db/lora
28
+ Project-URL: Issues, https://github.com/lora-db/lora/issues
29
+ Project-URL: Repository, https://github.com/lora-db/lora
30
+
31
+ # lora-python
32
+
33
+ Python bindings for the [Lora](../../README.md) in-memory graph
34
+ engine. Ships both a synchronous PyO3 `Database` class and an
35
+ asyncio-compatible `AsyncDatabase` wrapper that never blocks the event loop.
36
+
37
+ > **Status:** prototype / feasibility check. Not published to PyPI.
38
+
39
+ ## Install (local dev)
40
+
41
+ ```bash
42
+ cd crates/lora-python
43
+ python3 -m venv .venv && source .venv/bin/activate
44
+ pip install -U pip maturin pytest pytest-asyncio
45
+ maturin develop # builds the Rust extension into the venv
46
+ pytest # runs the sync + async smoke tests
47
+ ```
48
+
49
+ `maturin develop` produces a `lora_python/_native.<platform>.so` inside the
50
+ package and makes `import lora_python` work immediately.
51
+
52
+ ## Sync usage
53
+
54
+ ```python
55
+ from lora_python import Database, is_node
56
+
57
+ db = Database.create()
58
+ db.execute("CREATE (:Person {name: $n, age: $a})", {"n": "Alice", "a": 30})
59
+
60
+ res = db.execute("MATCH (n:Person) RETURN n")
61
+ for row in res["rows"]:
62
+ n = row["n"]
63
+ if is_node(n):
64
+ print(n["properties"]["name"])
65
+ ```
66
+
67
+ ## Async usage (non-blocking)
68
+
69
+ ```python
70
+ import asyncio
71
+ from lora_python import AsyncDatabase
72
+
73
+ async def main():
74
+ db = await AsyncDatabase.create()
75
+ await db.execute("CREATE (:Person {name: 'Alice'})")
76
+ r = await db.execute("MATCH (n:Person) RETURN n.name AS name")
77
+ print(r["rows"])
78
+
79
+ asyncio.run(main())
80
+ ```
81
+
82
+ `AsyncDatabase.execute` dispatches the query onto the default asyncio
83
+ thread pool via `asyncio.to_thread`. The PyO3 `Database.execute` releases
84
+ the Python GIL for the duration of engine work, so other coroutines on the
85
+ event loop can progress while a query runs. A dedicated test proves the
86
+ event loop continues ticking during a 2 000-node `MATCH`.
87
+
88
+ ## Typed value model
89
+
90
+ Same conceptual contract as `lora-node` / `lora-wasm`:
91
+
92
+ | Python shape | Lora value |
93
+ |------------------------------------------------------------|----------------------|
94
+ | `None`, `bool`, `int`, `float`, `str` | scalars |
95
+ | `list`, `dict` | collections |
96
+ | `{"kind": "node", "id", "labels", "properties"}` | node |
97
+ | `{"kind": "relationship", "id", …}` | relationship |
98
+ | `{"kind": "path", "nodes": [...], "rels": [...]}` | path |
99
+ | `{"kind": "date", "iso": "YYYY-MM-DD"}` (and `time`, …) | temporal |
100
+ | point dicts — see below | point |
101
+
102
+ Points are returned as dicts keyed on their CRS:
103
+
104
+ | SRID | Dict |
105
+ |------|----------------------------------------------------------------------------------------------------|
106
+ | 7203 | `{"kind": "point", "srid": 7203, "crs": "cartesian", "x", "y"}` |
107
+ | 9157 | `{"kind": "point", "srid": 9157, "crs": "cartesian-3D", "x", "y", "z"}` |
108
+ | 4326 | `{"kind": "point", "srid": 4326, "crs": "WGS-84-2D", "x", "y", "longitude", "latitude"}` |
109
+ | 4979 | `{"kind": "point", "srid": 4979, "crs": "WGS-84-3D", "x", "y", "z", "longitude", "latitude", "height"}` |
110
+
111
+ Constructors and guards are exported from `lora_python.types`:
112
+ `date`, `time`, `localtime`, `datetime`, `localdatetime`, `duration`,
113
+ `cartesian`, `cartesian_3d`, `wgs84`, `wgs84_3d`, `is_node`,
114
+ `is_relationship`, `is_path`, `is_point`, `is_temporal`.
115
+
116
+ > `distance()` on WGS-84-3D points ignores `height` — see
117
+ > [functions reference](../../apps/loradb.com/docs/functions/overview.md) for the full spatial
118
+ > reference and known limitations.
119
+
120
+ ## Errors
121
+
122
+ - `LoraError` — base class
123
+ - `LoraQueryError` — parse / analyze / execute failure
124
+ - `InvalidParamsError` — a parameter value couldn't be mapped
125
+
126
+ All three are available as `lora_python.LoraError`, etc.
127
+
128
+ ## Architecture
129
+
130
+ ```
131
+ lora-database (Rust)
132
+ └── lora-python (crate, cdylib) <- PyO3 bindings
133
+ ├── Database (sync, releases the GIL)
134
+ └── python/lora_python/
135
+ ├── _async.py AsyncDatabase via asyncio.to_thread
136
+ └── types.py typed dicts + constructors + guards
137
+ ```
138
+
@@ -0,0 +1,11 @@
1
+ lora_python/__init__.py,sha256=GTlTTfo-PWuREXxF9TNd7yDb_aIWTmJMz-FNvhySGdI,2930
2
+ lora_python/_async.py,sha256=eZO9UhSZJs86jFTfraHN2SW_9AVtM689cETL-FAwZB4,3980
3
+ lora_python/_native.pyd,sha256=X4BFPqGH3qPDNvhDuE4s1DZPUcaUKCejA2SHeQQ1uqg,2658304
4
+ lora_python/_native.pyi,sha256=PRHdklmHdhVP0B_63E4okYYB-9qG1ke809hWeJK5NkU,1022
5
+ lora_python/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ lora_python/types.py,sha256=8CdNJfiY9qwPLea2AjU9J3UH2clMhq7qow1K3PBVJ38,8099
7
+ lora_python-0.2.0.dist-info/METADATA,sha256=-JQkUhynTR_1OMg-0YdOf8B2HtE5rxNWOKtpuQ8DZ5Q,5528
8
+ lora_python-0.2.0.dist-info/WHEEL,sha256=X8vvqavrCCzME4tEQB46rFZlEGXF4kNwLeRqgaDmIw4,95
9
+ lora_python-0.2.0.dist-info/licenses/LICENSE,sha256=DeqCzu641BanViME_ETS6_mmFsr4Nv4lI3zisnLqxyU,4333
10
+ lora_python-0.2.0.dist-info/sboms/lora-python.cyclonedx.json,sha256=faV3_2elOJJJY7EHOogZkpKun6XIoCHXDFM36-F4g44,85348
11
+ lora_python-0.2.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.13.1)
3
+ Root-Is-Purelib: false
4
+ Tag: cp38-abi3-win_amd64
@@ -0,0 +1,87 @@
1
+ Business Source License 1.1
2
+
3
+ Parameters
4
+
5
+ Licensor: LoraDB, Inc.
6
+ Licensed Work: LoraDB
7
+ Change Date: 2029-04-19
8
+ Change License: Apache License, Version 2.0
9
+
10
+ Additional Use Grant: You may use, copy, modify, create derivative works of,
11
+ distribute, and make production use of the Licensed Work
12
+ for internal business purposes and non-production
13
+ purposes, provided that you do not use the Licensed Work
14
+ to offer, operate, or make available a database-as-a-
15
+ service, hosted API, managed database platform, or any
16
+ substantially similar hosted service for third parties.
17
+
18
+ The Additional Use Grant does not permit using the
19
+ Licensed Work to provide a commercial or non-commercial
20
+ hosted service that allows third parties to access LoraDB
21
+ functionality, including as part of a competing managed
22
+ database platform, backend-as-a-service, application
23
+ platform, developer platform, or resale offering.
24
+
25
+ Business Source License
26
+
27
+ Terms
28
+
29
+ The Licensor hereby grants you the right to copy, modify, create derivative
30
+ works, redistribute, and make non-production use of the Licensed Work. The
31
+ Licensor may make an Additional Use Grant, above, permitting limited production
32
+ use.
33
+
34
+ Effective on the Change Date, or the fourth anniversary of the first publicly
35
+ available distribution of a specific version of the Licensed Work under this
36
+ License, whichever comes first, the Licensor hereby grants you rights under
37
+ the terms of the Change License, and the rights granted in the paragraph
38
+ above terminate.
39
+
40
+ If your use of the Licensed Work does not comply with the requirements
41
+ currently in effect as described in this License, you must purchase a
42
+ commercial license from the Licensor, its affiliated entities, or authorized
43
+ resellers, or you must refrain from using the Licensed Work.
44
+
45
+ All copies of the original and modified Licensed Work, and derivative works
46
+ of the Licensed Work, are subject to this License. This License applies
47
+ separately for each version of the Licensed Work and the Change Date may vary
48
+ for each version of the Licensed Work released by Licensor.
49
+
50
+ You must conspicuously display this License on each original or modified copy
51
+ of the Licensed Work. If you receive the Licensed Work in original or modified
52
+ form from a third party, the terms and conditions set forth in this License
53
+ apply to your use of that work.
54
+
55
+ Any use of the Licensed Work in violation of this License will automatically
56
+ terminate your rights under this License for the current and all other
57
+ versions of the Licensed Work.
58
+
59
+ This License does not grant you any right in any trademark or logo of Licensor
60
+ or its affiliates.
61
+
62
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
63
+ AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
64
+ EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY,
65
+ FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE.
66
+
67
+ MariaDB hereby grants you permission to use this License's text to license
68
+ your works, and to refer to it using the trademark "Business Source License",
69
+ as long as you comply with the Covenants of Licensor below.
70
+
71
+ Covenants of Licensor
72
+
73
+ In consideration of the right to use this License's text and the "Business
74
+ Source License" name and trademark, Licensor covenants to MariaDB, and to all
75
+ other recipients of the licensed work to be provided by Licensor:
76
+
77
+ 1. To specify as the Change License the GPL Version 2.0 or any later version,
78
+ or a license that is compatible with GPL Version 2.0 or a later version,
79
+ where "compatible" means that software provided under the Change License can
80
+ be included in a program with software provided under GPL Version 2.0 or a
81
+ later version. Licensor may specify additional Change Licenses without
82
+ limitation.
83
+ 2. To either: (a) specify an additional grant of rights to use that does not
84
+ impose any additional restriction on the right granted in this License, as
85
+ the Additional Use Grant; or (b) insert the text "None".
86
+ 3. To specify a Change Date.
87
+ 4. Not to modify this License in any other way.