torque-http 0.6.0__tar.gz → 0.7.0__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.
- torque_http-0.7.0/LICENSE +230 -0
- {torque_http-0.6.0 → torque_http-0.7.0}/PKG-INFO +18 -17
- {torque_http-0.6.0 → torque_http-0.7.0}/README.md +110 -110
- {torque_http-0.6.0 → torque_http-0.7.0}/pyproject.toml +3 -2
- {torque_http-0.6.0 → torque_http-0.7.0}/src/torque_http/__init__.py +1 -1
- {torque_http-0.6.0 → torque_http-0.7.0}/src/torque_http/client.py +1 -3
- {torque_http-0.6.0 → torque_http-0.7.0}/src/torque_http/models.py +0 -2
- {torque_http-0.6.0 → torque_http-0.7.0}/src/torque_http/tcp.py +2 -18
- torque_http-0.6.0/LICENSE +0 -196
- {torque_http-0.6.0 → torque_http-0.7.0}/.gitignore +0 -0
- {torque_http-0.6.0 → torque_http-0.7.0}/src/torque_http/exceptions.py +0 -0
- {torque_http-0.6.0 → torque_http-0.7.0}/src/torque_http/py.typed +0 -0
- {torque_http-0.6.0 → torque_http-0.7.0}/tests/test_client.py +0 -0
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
This package is dual-licensed: you may use it under either the MIT license or the Apache
|
|
2
|
+
License 2.0, at your option. Both texts follow.
|
|
3
|
+
|
|
4
|
+
-------------------------------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2025-2026 The Intelligence Company AB (publ)
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
-------------------------------------------------------------------------------
|
|
29
|
+
|
|
30
|
+
Apache License
|
|
31
|
+
Version 2.0, January 2004
|
|
32
|
+
http://www.apache.org/licenses/
|
|
33
|
+
|
|
34
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
35
|
+
|
|
36
|
+
1. Definitions.
|
|
37
|
+
|
|
38
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
39
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
40
|
+
|
|
41
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
42
|
+
the copyright owner that is granting the License.
|
|
43
|
+
|
|
44
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
45
|
+
other entities that control, are controlled by, or are under common
|
|
46
|
+
control with that entity. For the purposes of this definition,
|
|
47
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
48
|
+
direction or management of such entity, whether by contract or
|
|
49
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
50
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
51
|
+
|
|
52
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
53
|
+
exercising permissions granted by this License.
|
|
54
|
+
|
|
55
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
56
|
+
including but not limited to software source code, documentation
|
|
57
|
+
source, and configuration files.
|
|
58
|
+
|
|
59
|
+
"Object" form shall mean any form resulting from mechanical
|
|
60
|
+
transformation or translation of a Source form, including but
|
|
61
|
+
not limited to compiled object code, generated documentation,
|
|
62
|
+
and conversions to other media types.
|
|
63
|
+
|
|
64
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
65
|
+
Object form, made available under the License, as indicated by a
|
|
66
|
+
copyright notice that is included in or attached to the work
|
|
67
|
+
(an example is provided in the Appendix below).
|
|
68
|
+
|
|
69
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
70
|
+
form, that is based on (or derived from) the Work and for which the
|
|
71
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
72
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
73
|
+
of this License, Derivative Works shall not include works that remain
|
|
74
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
75
|
+
the Work and Derivative Works thereof.
|
|
76
|
+
|
|
77
|
+
"Contribution" shall mean any work of authorship, including
|
|
78
|
+
the original version of the Work and any modifications or additions
|
|
79
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
80
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
81
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
82
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
83
|
+
means any form of electronic, verbal, or written communication sent
|
|
84
|
+
to the Licensor or its representatives, including but not limited to
|
|
85
|
+
communication on electronic mailing lists, source code control systems,
|
|
86
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
87
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
88
|
+
excluding communication that is conspicuously marked or otherwise
|
|
89
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
90
|
+
|
|
91
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
92
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
93
|
+
subsequently incorporated within the Work.
|
|
94
|
+
|
|
95
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
96
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
97
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
98
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
99
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
100
|
+
Work and such Derivative Works in Source or Object form.
|
|
101
|
+
|
|
102
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
103
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
104
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
105
|
+
(except as stated in this section) patent license to make, have made,
|
|
106
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
107
|
+
where such license applies only to those patent claims licensable
|
|
108
|
+
by such Contributor that are necessarily infringed by their
|
|
109
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
110
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
111
|
+
institute patent litigation against any entity (including a
|
|
112
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
113
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
114
|
+
or contributory patent infringement, then any patent licenses
|
|
115
|
+
granted to You under this License for that Work shall terminate
|
|
116
|
+
as of the date such litigation is filed.
|
|
117
|
+
|
|
118
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
119
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
120
|
+
modifications, and in Source or Object form, provided that You
|
|
121
|
+
meet the following conditions:
|
|
122
|
+
|
|
123
|
+
(a) You must give any other recipients of the Work or
|
|
124
|
+
Derivative Works a copy of this License; and
|
|
125
|
+
|
|
126
|
+
(b) You must cause any modified files to carry prominent notices
|
|
127
|
+
stating that You changed the files; and
|
|
128
|
+
|
|
129
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
130
|
+
that You distribute, all copyright, patent, trademark, and
|
|
131
|
+
attribution notices from the Source form of the Work,
|
|
132
|
+
excluding those notices that do not pertain to any part of
|
|
133
|
+
the Derivative Works; and
|
|
134
|
+
|
|
135
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
136
|
+
distribution, then any Derivative Works that You distribute must
|
|
137
|
+
include a readable copy of the attribution notices contained
|
|
138
|
+
within such NOTICE file, excluding those notices that do not
|
|
139
|
+
pertain to any part of the Derivative Works, in at least one
|
|
140
|
+
of the following places: within a NOTICE text file distributed
|
|
141
|
+
as part of the Derivative Works; within the Source form or
|
|
142
|
+
documentation, if provided along with the Derivative Works; or,
|
|
143
|
+
within a display generated by the Derivative Works, if and
|
|
144
|
+
wherever such third-party notices normally appear. The contents
|
|
145
|
+
of the NOTICE file are for informational purposes only and
|
|
146
|
+
do not modify the License. You may add Your own attribution
|
|
147
|
+
notices within Derivative Works that You distribute, alongside
|
|
148
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
149
|
+
that such additional attribution notices cannot be construed
|
|
150
|
+
as modifying the License.
|
|
151
|
+
|
|
152
|
+
You may add Your own copyright statement to Your modifications and
|
|
153
|
+
may provide additional or different license terms and conditions
|
|
154
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
155
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
156
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
157
|
+
the conditions stated in this License.
|
|
158
|
+
|
|
159
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
160
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
161
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
162
|
+
this License, without any additional terms or conditions.
|
|
163
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
164
|
+
the terms of any separate license agreement you may have executed
|
|
165
|
+
with Licensor regarding such Contributions.
|
|
166
|
+
|
|
167
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
168
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
169
|
+
except as required for reasonable and customary use in describing the
|
|
170
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
171
|
+
|
|
172
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
173
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
174
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
175
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
176
|
+
implied, including, without limitation, any warranties or conditions
|
|
177
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
178
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
179
|
+
appropriateness of using or redistributing the Work and assume any
|
|
180
|
+
risks associated with Your exercise of permissions under this License.
|
|
181
|
+
|
|
182
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
183
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
184
|
+
unless required by applicable law (such as deliberate and grossly
|
|
185
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
186
|
+
liable to You for damages, including any direct, indirect, special,
|
|
187
|
+
incidental, or consequential damages of any character arising as a
|
|
188
|
+
result of this License or out of the use or inability to use the
|
|
189
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
190
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
191
|
+
other commercial damages or losses), even if such Contributor
|
|
192
|
+
has been advised of the possibility of such damages.
|
|
193
|
+
|
|
194
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
195
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
196
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
197
|
+
or other liability obligations and/or rights consistent with this
|
|
198
|
+
License. However, in accepting such obligations, You may act only
|
|
199
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
200
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
201
|
+
defend, and hold each Contributor harmless for any liability
|
|
202
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
203
|
+
of your accepting any such warranty or additional liability.
|
|
204
|
+
|
|
205
|
+
END OF TERMS AND CONDITIONS
|
|
206
|
+
|
|
207
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
208
|
+
|
|
209
|
+
To apply the Apache License to your work, attach the following
|
|
210
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
211
|
+
replaced with your own identifying information. (Don't include
|
|
212
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
213
|
+
comment syntax for the file format. We also recommend that a
|
|
214
|
+
file or class name and description of purpose be included on the
|
|
215
|
+
same "printed page" as the copyright notice for easier
|
|
216
|
+
identification within third-party archives.
|
|
217
|
+
|
|
218
|
+
Copyright 2025-2026 The Intelligence Company AB (publ)
|
|
219
|
+
|
|
220
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
221
|
+
you may not use this file except in compliance with the License.
|
|
222
|
+
You may obtain a copy of the License at
|
|
223
|
+
|
|
224
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
225
|
+
|
|
226
|
+
Unless required by applicable law or agreed to in writing, software
|
|
227
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
228
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
229
|
+
See the License for the specific language governing permissions and
|
|
230
|
+
limitations under the License.
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: torque-http
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Summary: Official Python client for Torque — Truespar's in-memory search engine with a Typesense v30.1 compatible API. Zero external dependencies.
|
|
5
5
|
Project-URL: Homepage, https://truespar.com/torque/docs
|
|
6
6
|
Project-URL: Documentation, https://truespar.com/torque/docs
|
|
7
|
+
Project-URL: Repository, https://github.com/truespar/torque
|
|
7
8
|
Author: Truespar
|
|
8
|
-
License-Expression:
|
|
9
|
+
License-Expression: MIT OR Apache-2.0
|
|
9
10
|
License-File: LICENSE
|
|
10
11
|
Keywords: search,torque,truespar,typesense,vector-search
|
|
11
12
|
Classifier: Development Status :: 4 - Beta
|
|
@@ -21,13 +22,13 @@ Description-Content-Type: text/markdown
|
|
|
21
22
|
|
|
22
23
|
# torque-http
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
The Python client for [Torque](https://truespar.com/torque/docs), an in-memory search engine with a Typesense-compatible API.
|
|
25
26
|
|
|
26
|
-
-
|
|
27
|
-
- **HTTP API
|
|
28
|
-
- **TCP
|
|
29
|
-
- **
|
|
30
|
-
-
|
|
27
|
+
- Standard library only, no dependencies
|
|
28
|
+
- **HTTP API**: search, collections, documents, keys, aliases
|
|
29
|
+
- **TCP ingest** (`TorqueIngestClient`) for streaming documents
|
|
30
|
+
- **Binary import files** (`TorqueBinaryFileWriter`) for bulk loads
|
|
31
|
+
- Several nodes, with failover and retries
|
|
31
32
|
- Typed search parameters and response models
|
|
32
33
|
- Python 3.10+
|
|
33
34
|
|
|
@@ -37,7 +38,7 @@ Official Python client for [Torque](https://truespar.com/torque/docs) — Truesp
|
|
|
37
38
|
pip install torque-http
|
|
38
39
|
```
|
|
39
40
|
|
|
40
|
-
## Quick
|
|
41
|
+
## Quick start
|
|
41
42
|
|
|
42
43
|
```python
|
|
43
44
|
from torque_http import TorqueHttpClient, SearchParameters
|
|
@@ -59,7 +60,7 @@ params = SearchParameters(
|
|
|
59
60
|
results = client.search("products", params)
|
|
60
61
|
```
|
|
61
62
|
|
|
62
|
-
##
|
|
63
|
+
## Several nodes
|
|
63
64
|
|
|
64
65
|
```python
|
|
65
66
|
client = TorqueHttpClient(
|
|
@@ -69,7 +70,7 @@ client = TorqueHttpClient(
|
|
|
69
70
|
)
|
|
70
71
|
```
|
|
71
72
|
|
|
72
|
-
##
|
|
73
|
+
## Collections and documents
|
|
73
74
|
|
|
74
75
|
```python
|
|
75
76
|
schema = {
|
|
@@ -87,9 +88,9 @@ client.create_document("products", {
|
|
|
87
88
|
})
|
|
88
89
|
```
|
|
89
90
|
|
|
90
|
-
##
|
|
91
|
+
## TCP ingest
|
|
91
92
|
|
|
92
|
-
For
|
|
93
|
+
For large loads, stream over the TCP ingest protocol:
|
|
93
94
|
|
|
94
95
|
```python
|
|
95
96
|
from torque_http import TorqueIngestClient, DocumentEncoder
|
|
@@ -107,9 +108,9 @@ with TorqueIngestClient() as tcp:
|
|
|
107
108
|
tcp.commit()
|
|
108
109
|
```
|
|
109
110
|
|
|
110
|
-
##
|
|
111
|
+
## Binary import file
|
|
111
112
|
|
|
112
|
-
|
|
113
|
+
Write the documents to a compressed file, then upload it in one request:
|
|
113
114
|
|
|
114
115
|
```python
|
|
115
116
|
from torque_http import TorqueBinaryFileWriter, DocumentEncoder
|
|
@@ -128,4 +129,4 @@ client.import_binary("products", "data.tqbf")
|
|
|
128
129
|
|
|
129
130
|
## License
|
|
130
131
|
|
|
131
|
-
|
|
132
|
+
MIT OR Apache-2.0, at your option. See [LICENSE](LICENSE). Copyright 2025-2026 The Intelligence Company AB (publ).
|
|
@@ -1,110 +1,110 @@
|
|
|
1
|
-
# torque-http
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
- **HTTP API
|
|
7
|
-
- **TCP
|
|
8
|
-
- **
|
|
9
|
-
-
|
|
10
|
-
- Typed search parameters and response models
|
|
11
|
-
- Python 3.10+
|
|
12
|
-
|
|
13
|
-
## Installation
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
pip install torque-http
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Quick
|
|
20
|
-
|
|
21
|
-
```python
|
|
22
|
-
from torque_http import TorqueHttpClient, SearchParameters
|
|
23
|
-
|
|
24
|
-
client = TorqueHttpClient("http://localhost:8108", api_key="your-key")
|
|
25
|
-
|
|
26
|
-
# Search
|
|
27
|
-
results = client.search("products", q="laptop", query_by="title")
|
|
28
|
-
for hit in results.hits:
|
|
29
|
-
print(hit.document["title"])
|
|
30
|
-
|
|
31
|
-
# Typed parameters
|
|
32
|
-
params = SearchParameters(
|
|
33
|
-
q="laptop",
|
|
34
|
-
query_by="title,description",
|
|
35
|
-
filter_by="price:>100",
|
|
36
|
-
per_page=20,
|
|
37
|
-
)
|
|
38
|
-
results = client.search("products", params)
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
##
|
|
42
|
-
|
|
43
|
-
```python
|
|
44
|
-
client = TorqueHttpClient(
|
|
45
|
-
["http://node1:8108", "http://node2:8108"],
|
|
46
|
-
api_key="your-key",
|
|
47
|
-
num_retries=5,
|
|
48
|
-
)
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
##
|
|
52
|
-
|
|
53
|
-
```python
|
|
54
|
-
schema = {
|
|
55
|
-
"name": "products",
|
|
56
|
-
"fields": [
|
|
57
|
-
{"name": "title", "type": "string"},
|
|
58
|
-
{"name": "price", "type": "float", "sort": True},
|
|
59
|
-
{"name": "brand", "type": "string", "facet": True},
|
|
60
|
-
],
|
|
61
|
-
}
|
|
62
|
-
client.create_collection(schema)
|
|
63
|
-
|
|
64
|
-
client.create_document("products", {
|
|
65
|
-
"id": "1", "title": "Laptop Pro", "price": 1299.99, "brand": "Acme",
|
|
66
|
-
})
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
##
|
|
70
|
-
|
|
71
|
-
For
|
|
72
|
-
|
|
73
|
-
```python
|
|
74
|
-
from torque_http import TorqueIngestClient, DocumentEncoder
|
|
75
|
-
|
|
76
|
-
schema = {"fields": [
|
|
77
|
-
{"name": "title", "type": "string"},
|
|
78
|
-
{"name": "price", "type": "float"},
|
|
79
|
-
]}
|
|
80
|
-
encoder = DocumentEncoder(schema)
|
|
81
|
-
|
|
82
|
-
with TorqueIngestClient() as tcp:
|
|
83
|
-
tcp.connect("localhost", 8109)
|
|
84
|
-
tcp.start_ingest("products")
|
|
85
|
-
tcp.send_batch(documents, encoder)
|
|
86
|
-
tcp.commit()
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
##
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
```python
|
|
94
|
-
from torque_http import TorqueBinaryFileWriter, DocumentEncoder
|
|
95
|
-
|
|
96
|
-
encoder = DocumentEncoder(schema)
|
|
97
|
-
with TorqueBinaryFileWriter("data.tqbf", encoder) as writer:
|
|
98
|
-
for doc in source:
|
|
99
|
-
writer.write(doc)
|
|
100
|
-
|
|
101
|
-
client.import_binary("products", "data.tqbf")
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
## Documentation
|
|
105
|
-
|
|
106
|
-
- [Torque documentation](https://truespar.com/torque/docs)
|
|
107
|
-
|
|
108
|
-
## License
|
|
109
|
-
|
|
110
|
-
|
|
1
|
+
# torque-http
|
|
2
|
+
|
|
3
|
+
The Python client for [Torque](https://truespar.com/torque/docs), an in-memory search engine with a Typesense-compatible API.
|
|
4
|
+
|
|
5
|
+
- Standard library only, no dependencies
|
|
6
|
+
- **HTTP API**: search, collections, documents, keys, aliases
|
|
7
|
+
- **TCP ingest** (`TorqueIngestClient`) for streaming documents
|
|
8
|
+
- **Binary import files** (`TorqueBinaryFileWriter`) for bulk loads
|
|
9
|
+
- Several nodes, with failover and retries
|
|
10
|
+
- Typed search parameters and response models
|
|
11
|
+
- Python 3.10+
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install torque-http
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quick start
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
from torque_http import TorqueHttpClient, SearchParameters
|
|
23
|
+
|
|
24
|
+
client = TorqueHttpClient("http://localhost:8108", api_key="your-key")
|
|
25
|
+
|
|
26
|
+
# Search
|
|
27
|
+
results = client.search("products", q="laptop", query_by="title")
|
|
28
|
+
for hit in results.hits:
|
|
29
|
+
print(hit.document["title"])
|
|
30
|
+
|
|
31
|
+
# Typed parameters
|
|
32
|
+
params = SearchParameters(
|
|
33
|
+
q="laptop",
|
|
34
|
+
query_by="title,description",
|
|
35
|
+
filter_by="price:>100",
|
|
36
|
+
per_page=20,
|
|
37
|
+
)
|
|
38
|
+
results = client.search("products", params)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Several nodes
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
client = TorqueHttpClient(
|
|
45
|
+
["http://node1:8108", "http://node2:8108"],
|
|
46
|
+
api_key="your-key",
|
|
47
|
+
num_retries=5,
|
|
48
|
+
)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Collections and documents
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
schema = {
|
|
55
|
+
"name": "products",
|
|
56
|
+
"fields": [
|
|
57
|
+
{"name": "title", "type": "string"},
|
|
58
|
+
{"name": "price", "type": "float", "sort": True},
|
|
59
|
+
{"name": "brand", "type": "string", "facet": True},
|
|
60
|
+
],
|
|
61
|
+
}
|
|
62
|
+
client.create_collection(schema)
|
|
63
|
+
|
|
64
|
+
client.create_document("products", {
|
|
65
|
+
"id": "1", "title": "Laptop Pro", "price": 1299.99, "brand": "Acme",
|
|
66
|
+
})
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## TCP ingest
|
|
70
|
+
|
|
71
|
+
For large loads, stream over the TCP ingest protocol:
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
from torque_http import TorqueIngestClient, DocumentEncoder
|
|
75
|
+
|
|
76
|
+
schema = {"fields": [
|
|
77
|
+
{"name": "title", "type": "string"},
|
|
78
|
+
{"name": "price", "type": "float"},
|
|
79
|
+
]}
|
|
80
|
+
encoder = DocumentEncoder(schema)
|
|
81
|
+
|
|
82
|
+
with TorqueIngestClient() as tcp:
|
|
83
|
+
tcp.connect("localhost", 8109)
|
|
84
|
+
tcp.start_ingest("products")
|
|
85
|
+
tcp.send_batch(documents, encoder)
|
|
86
|
+
tcp.commit()
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Binary import file
|
|
90
|
+
|
|
91
|
+
Write the documents to a compressed file, then upload it in one request:
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
from torque_http import TorqueBinaryFileWriter, DocumentEncoder
|
|
95
|
+
|
|
96
|
+
encoder = DocumentEncoder(schema)
|
|
97
|
+
with TorqueBinaryFileWriter("data.tqbf", encoder) as writer:
|
|
98
|
+
for doc in source:
|
|
99
|
+
writer.write(doc)
|
|
100
|
+
|
|
101
|
+
client.import_binary("products", "data.tqbf")
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Documentation
|
|
105
|
+
|
|
106
|
+
- [Torque documentation](https://truespar.com/torque/docs)
|
|
107
|
+
|
|
108
|
+
## License
|
|
109
|
+
|
|
110
|
+
MIT OR Apache-2.0, at your option. See [LICENSE](LICENSE). Copyright 2025-2026 The Intelligence Company AB (publ).
|
|
@@ -4,10 +4,10 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "torque-http"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.7.0"
|
|
8
8
|
description = "Official Python client for Torque — Truespar's in-memory search engine with a Typesense v30.1 compatible API. Zero external dependencies."
|
|
9
9
|
readme = "README.md"
|
|
10
|
-
license = "
|
|
10
|
+
license = "MIT OR Apache-2.0"
|
|
11
11
|
license-files = ["LICENSE"]
|
|
12
12
|
requires-python = ">=3.10"
|
|
13
13
|
authors = [{ name = "Truespar" }]
|
|
@@ -26,6 +26,7 @@ classifiers = [
|
|
|
26
26
|
[project.urls]
|
|
27
27
|
Homepage = "https://truespar.com/torque/docs"
|
|
28
28
|
Documentation = "https://truespar.com/torque/docs"
|
|
29
|
+
Repository = "https://github.com/truespar/torque"
|
|
29
30
|
|
|
30
31
|
[tool.hatch.build.targets.wheel]
|
|
31
32
|
packages = ["src/torque_http"]
|
|
@@ -301,14 +301,12 @@ class TorqueHttpClient:
|
|
|
301
301
|
"""Get server health status.
|
|
302
302
|
|
|
303
303
|
Returns:
|
|
304
|
-
HealthResponse with server version
|
|
304
|
+
HealthResponse with server version.
|
|
305
305
|
"""
|
|
306
306
|
d = self._get("/health")
|
|
307
307
|
return HealthResponse(
|
|
308
308
|
ok=d.get("ok", False),
|
|
309
309
|
version=d.get("version", ""),
|
|
310
|
-
license=d.get("license", {}),
|
|
311
|
-
update=d.get("update"),
|
|
312
310
|
)
|
|
313
311
|
|
|
314
312
|
def stats(self) -> AdminStats:
|
|
@@ -319,8 +319,6 @@ class HealthResponse:
|
|
|
319
319
|
"""Server health response."""
|
|
320
320
|
ok: bool = False
|
|
321
321
|
version: str = ""
|
|
322
|
-
license: dict[str, Any] = field(default_factory=dict)
|
|
323
|
-
update: dict[str, Any] | None = None
|
|
324
322
|
|
|
325
323
|
|
|
326
324
|
# ── Admin ────────────────────────────────────────────────────────────────
|
|
@@ -15,7 +15,6 @@ from io import BytesIO
|
|
|
15
15
|
from dataclasses import dataclass
|
|
16
16
|
from typing import Any
|
|
17
17
|
|
|
18
|
-
|
|
19
18
|
# ── Protocol Constants ──────────────────────────────────────────────────
|
|
20
19
|
|
|
21
20
|
# Client -> Server message types
|
|
@@ -30,7 +29,6 @@ RESP_COMMIT_RESULT = 0x11
|
|
|
30
29
|
RESP_ERROR = 0x12
|
|
31
30
|
RESP_BACKPRESSURE = 0x13
|
|
32
31
|
|
|
33
|
-
|
|
34
32
|
# ── Response Models ─────────────────────────────────────────────────────
|
|
35
33
|
|
|
36
34
|
@dataclass
|
|
@@ -38,14 +36,12 @@ class BatchAck:
|
|
|
38
36
|
batch_seq: int
|
|
39
37
|
docs_received: int
|
|
40
38
|
|
|
41
|
-
|
|
42
39
|
@dataclass
|
|
43
40
|
class CommitResult:
|
|
44
41
|
success: bool
|
|
45
42
|
docs_indexed: int
|
|
46
43
|
build_ms: int
|
|
47
44
|
|
|
48
|
-
|
|
49
45
|
# ── Exceptions ──────────────────────────────────────────────────────────
|
|
50
46
|
|
|
51
47
|
class TorqueProtocolError(Exception):
|
|
@@ -53,18 +49,15 @@ class TorqueProtocolError(Exception):
|
|
|
53
49
|
super().__init__(f"[code={code}] {message}")
|
|
54
50
|
self.code = code
|
|
55
51
|
|
|
56
|
-
|
|
57
52
|
class TorqueConnectionError(Exception):
|
|
58
53
|
pass
|
|
59
54
|
|
|
60
|
-
|
|
61
55
|
# ── Frame Codec ─────────────────────────────────────────────────────────
|
|
62
56
|
|
|
63
57
|
def _write_frame(sock: socket.socket, payload: bytes) -> None:
|
|
64
58
|
header = struct.pack("!I", len(payload))
|
|
65
59
|
sock.sendall(header + payload)
|
|
66
60
|
|
|
67
|
-
|
|
68
61
|
def _read_exact(sock: socket.socket, n: int) -> bytes:
|
|
69
62
|
buf = bytearray()
|
|
70
63
|
while len(buf) < n:
|
|
@@ -74,7 +67,6 @@ def _read_exact(sock: socket.socket, n: int) -> bytes:
|
|
|
74
67
|
buf.extend(chunk)
|
|
75
68
|
return bytes(buf)
|
|
76
69
|
|
|
77
|
-
|
|
78
70
|
def _read_frame(sock: socket.socket) -> bytes:
|
|
79
71
|
header = _read_exact(sock, 4)
|
|
80
72
|
length = struct.unpack("!I", header)[0]
|
|
@@ -82,7 +74,6 @@ def _read_frame(sock: socket.socket) -> bytes:
|
|
|
82
74
|
return b""
|
|
83
75
|
return _read_exact(sock, length)
|
|
84
76
|
|
|
85
|
-
|
|
86
77
|
# ── Response Decoder ────────────────────────────────────────────────────
|
|
87
78
|
|
|
88
79
|
def _decode_response(data: bytes) -> BatchAck | CommitResult:
|
|
@@ -126,7 +117,6 @@ def _decode_response(data: bytes) -> BatchAck | CommitResult:
|
|
|
126
117
|
else:
|
|
127
118
|
raise TorqueProtocolError(0, f"Unknown server message type: 0x{msg_type:02X}")
|
|
128
119
|
|
|
129
|
-
|
|
130
120
|
# ── Document Flattener ─────────────────────────────────────────────────
|
|
131
121
|
|
|
132
122
|
def flatten_document(doc: dict[str, Any]) -> dict[str, Any]:
|
|
@@ -140,7 +130,6 @@ def flatten_document(doc: dict[str, Any]) -> dict[str, Any]:
|
|
|
140
130
|
"""
|
|
141
131
|
return _flatten_inner(doc, 0)
|
|
142
132
|
|
|
143
|
-
|
|
144
133
|
def _flatten_inner(obj: dict[str, Any], depth: int) -> dict[str, Any]:
|
|
145
134
|
|
|
146
135
|
result: dict[str, Any] = {}
|
|
@@ -178,7 +167,6 @@ def _flatten_inner(obj: dict[str, Any], depth: int) -> dict[str, Any]:
|
|
|
178
167
|
|
|
179
168
|
return result
|
|
180
169
|
|
|
181
|
-
|
|
182
170
|
# ── Document Encoder ────────────────────────────────────────────────────
|
|
183
171
|
|
|
184
172
|
# Type name -> encoder key mapping
|
|
@@ -195,7 +183,6 @@ _TYPE_MAP = {
|
|
|
195
183
|
"float[]": "float[]",
|
|
196
184
|
}
|
|
197
185
|
|
|
198
|
-
|
|
199
186
|
class DocumentEncoder:
|
|
200
187
|
"""Encodes Python dicts into Torque binary wire format.
|
|
201
188
|
|
|
@@ -365,7 +352,6 @@ class DocumentEncoder:
|
|
|
365
352
|
for item in arr:
|
|
366
353
|
buf.write(struct.pack("!f", float(item)))
|
|
367
354
|
|
|
368
|
-
|
|
369
355
|
# ── TCP Ingest Client ───────────────────────────────────────────────────
|
|
370
356
|
|
|
371
357
|
class TorqueIngestClient:
|
|
@@ -495,7 +481,6 @@ class TorqueIngestClient:
|
|
|
495
481
|
if self._sock is None:
|
|
496
482
|
raise RuntimeError("Not connected. Call connect() first.")
|
|
497
483
|
|
|
498
|
-
|
|
499
484
|
# ── TQBF Binary File Writer ────────────────────────────────────────────
|
|
500
485
|
|
|
501
486
|
class TorqueBinaryFileWriter:
|
|
@@ -512,9 +497,8 @@ class TorqueBinaryFileWriter:
|
|
|
512
497
|
[8 bytes] uncompressed_size: u64 (LE) ← v2 only
|
|
513
498
|
[N bytes] payload: ZLib-compressed concatenated binary documents
|
|
514
499
|
|
|
515
|
-
The uncompressed_size field lets the server
|
|
516
|
-
|
|
517
|
-
silicon unikernel's contiguous bitmap allocator on large imports.
|
|
500
|
+
The uncompressed_size field lets the server size its decompression
|
|
501
|
+
buffer exactly once.
|
|
518
502
|
|
|
519
503
|
The torque server still accepts v1 files (16-byte header, no size field)
|
|
520
504
|
via the read_to_end fallback, so older clients keep working.
|
torque_http-0.6.0/LICENSE
DELETED
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
TORQUE END-USER LICENSE AGREEMENT (EULA)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025-2026 Truespar. All rights reserved.
|
|
4
|
-
|
|
5
|
-
IMPORTANT — READ CAREFULLY: This End-User License Agreement ("Agreement") is a
|
|
6
|
-
legal agreement between you (either an individual or a single entity, "Licensee")
|
|
7
|
-
and Truespar ("Licensor") for the Torque software,
|
|
8
|
-
including all source code, binaries, documentation, and associated files
|
|
9
|
-
(collectively, the "Software").
|
|
10
|
-
|
|
11
|
-
By downloading, installing, copying, or otherwise using the Software, you agree
|
|
12
|
-
to be bound by the terms of this Agreement. If you do not agree, do not use the
|
|
13
|
-
Software.
|
|
14
|
-
|
|
15
|
-
1. GRANT OF LICENSE
|
|
16
|
-
|
|
17
|
-
Subject to the terms of this Agreement, Licensor grants Licensee a limited,
|
|
18
|
-
non-exclusive, non-transferable, revocable license to:
|
|
19
|
-
|
|
20
|
-
(a) Use the Software for internal purposes, including evaluation, development,
|
|
21
|
-
and production deployment.
|
|
22
|
-
|
|
23
|
-
(b) Create applications and services that interface with the Software through
|
|
24
|
-
its published APIs (Bolt protocol, FFI bindings, gRPC, and CLI).
|
|
25
|
-
|
|
26
|
-
2. RESTRICTIONS
|
|
27
|
-
|
|
28
|
-
Licensee shall NOT:
|
|
29
|
-
|
|
30
|
-
(a) Modify, adapt, alter, translate, or create derivative works of the
|
|
31
|
-
Software or any part thereof.
|
|
32
|
-
|
|
33
|
-
(b) Reverse engineer, disassemble, decompile, or otherwise attempt to derive
|
|
34
|
-
the source code, underlying ideas, algorithms, data structures, or
|
|
35
|
-
non-public APIs of the Software. To the extent that applicable law
|
|
36
|
-
(including EU Directive 2009/24/EC) grants a non-waivable right to
|
|
37
|
-
decompile for interoperability purposes, Licensee must first provide
|
|
38
|
-
thirty (30) days' prior written notice to Licensor and may exercise such
|
|
39
|
-
right only to the minimum extent necessary to achieve interoperability
|
|
40
|
-
with independently created software.
|
|
41
|
-
|
|
42
|
-
(c) Redistribute, sublicense, lease, rent, loan, sell, or otherwise transfer
|
|
43
|
-
the Software or any rights therein to any third party.
|
|
44
|
-
|
|
45
|
-
(d) Remove, alter, or obscure any proprietary notices, labels, or marks on
|
|
46
|
-
the Software.
|
|
47
|
-
|
|
48
|
-
(e) Use the Software to operate a service bureau, outsourcing service, or
|
|
49
|
-
managed-service offering for the benefit of third parties, or to provide
|
|
50
|
-
database-as-a-service offerings based on the Software, without a separate
|
|
51
|
-
commercial agreement with the Licensor.
|
|
52
|
-
|
|
53
|
-
(f) Use the Software to build a product or service that competes with the
|
|
54
|
-
Software.
|
|
55
|
-
|
|
56
|
-
(g) Publish benchmark results, performance comparisons, or similar evaluations
|
|
57
|
-
of the Software without prior written consent of the Licensor.
|
|
58
|
-
|
|
59
|
-
3. INTELLECTUAL PROPERTY
|
|
60
|
-
|
|
61
|
-
The Software is the intellectual property of the Licensor and is protected by
|
|
62
|
-
copyright law and international treaties. Licensor retains all right, title,
|
|
63
|
-
and interest in and to the Software, including all intellectual property rights
|
|
64
|
-
therein. This Agreement does not convey any ownership interest in the Software.
|
|
65
|
-
|
|
66
|
-
4. FEEDBACK
|
|
67
|
-
|
|
68
|
-
If Licensee provides suggestions, ideas, enhancement requests, or other
|
|
69
|
-
feedback regarding the Software ("Feedback"), Licensor may freely use,
|
|
70
|
-
incorporate, modify, license, and distribute such Feedback without restriction,
|
|
71
|
-
attribution, or compensation to Licensee. Licensee hereby assigns to Licensor
|
|
72
|
-
all right, title, and interest in and to any Feedback.
|
|
73
|
-
|
|
74
|
-
5. CONFIDENTIALITY
|
|
75
|
-
|
|
76
|
-
(a) "Confidential Information" means the source code, object code, algorithms,
|
|
77
|
-
data structures, architecture, internal APIs, performance characteristics,
|
|
78
|
-
and any other non-public technical or business information of the Licensor
|
|
79
|
-
disclosed to or accessed by Licensee, whether in written, electronic, or
|
|
80
|
-
other form.
|
|
81
|
-
|
|
82
|
-
(b) Licensee shall hold all Confidential Information in strict confidence,
|
|
83
|
-
using at least the same degree of care it uses to protect its own
|
|
84
|
-
confidential information, but no less than reasonable care.
|
|
85
|
-
|
|
86
|
-
(c) Licensee shall not disclose Confidential Information to any third party
|
|
87
|
-
without the prior written consent of Licensor, except to Licensee's
|
|
88
|
-
employees or contractors who have a need to know and are bound by
|
|
89
|
-
confidentiality obligations at least as protective as those herein.
|
|
90
|
-
|
|
91
|
-
(d) The obligations in this section do not apply to information that:
|
|
92
|
-
(i) is or becomes publicly available through no fault of Licensee;
|
|
93
|
-
(ii) was rightfully known to Licensee prior to disclosure by Licensor;
|
|
94
|
-
(iii) is independently developed by Licensee without use of or reference
|
|
95
|
-
to the Confidential Information; or (iv) is required to be disclosed by
|
|
96
|
-
law, provided Licensee gives Licensor prompt written notice and
|
|
97
|
-
cooperates to limit the scope of disclosure.
|
|
98
|
-
|
|
99
|
-
(e) These confidentiality obligations survive termination of this Agreement
|
|
100
|
-
for a period of five (5) years, or indefinitely for trade secrets for as
|
|
101
|
-
long as they remain trade secrets under applicable law.
|
|
102
|
-
|
|
103
|
-
6. THIRD-PARTY COMPONENTS
|
|
104
|
-
|
|
105
|
-
The Software incorporates open-source components licensed under permissive
|
|
106
|
-
licenses (MIT, Apache-2.0, BSD, and similar). These components retain their
|
|
107
|
-
original licenses. A list of third-party components and their licenses is
|
|
108
|
-
provided in the THIRD-PARTY-NOTICES file included with the Software.
|
|
109
|
-
|
|
110
|
-
Nothing in this Agreement restricts, limits, or otherwise affects any rights
|
|
111
|
-
Licensee may have under the licenses of such third-party components.
|
|
112
|
-
|
|
113
|
-
7. NO WARRANTY
|
|
114
|
-
|
|
115
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
116
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
117
|
-
FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
118
|
-
LICENSOR BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN
|
|
119
|
-
ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN
|
|
120
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
121
|
-
|
|
122
|
-
8. LIMITATION OF LIABILITY
|
|
123
|
-
|
|
124
|
-
(a) IN NO EVENT SHALL LICENSOR'S TOTAL AGGREGATE LIABILITY TO LICENSEE FOR
|
|
125
|
-
ALL CLAIMS ARISING UNDER OR IN CONNECTION WITH THIS AGREEMENT EXCEED THE
|
|
126
|
-
GREATER OF: (I) THE TOTAL AMOUNT OF FEES ACTUALLY PAID BY LICENSEE TO
|
|
127
|
-
LICENSOR FOR THE SOFTWARE DURING THE TWELVE (12) MONTHS IMMEDIATELY
|
|
128
|
-
PRECEDING THE EVENT GIVING RISE TO THE CLAIM; OR (II) FIFTY US DOLLARS
|
|
129
|
-
(USD $50.00).
|
|
130
|
-
|
|
131
|
-
(b) IN NO EVENT SHALL LICENSOR BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
|
|
132
|
-
SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES, INCLUDING BUT NOT LIMITED TO
|
|
133
|
-
LOSS OF PROFITS, DATA, BUSINESS, OR GOODWILL, REGARDLESS OF THE CAUSE OF
|
|
134
|
-
ACTION OR THE THEORY OF LIABILITY, EVEN IF LICENSOR HAS BEEN ADVISED OF
|
|
135
|
-
THE POSSIBILITY OF SUCH DAMAGES.
|
|
136
|
-
|
|
137
|
-
(c) THE LIMITATIONS IN SUBSECTIONS (a) AND (b) ABOVE SHALL NOT APPLY TO
|
|
138
|
-
LIABILITY ARISING FROM: (I) FRAUD OR FRAUDULENT MISREPRESENTATION;
|
|
139
|
-
(II) GROSS NEGLIGENCE OR WILLFUL MISCONDUCT; (III) LICENSEE'S BREACH OF
|
|
140
|
-
SECTIONS 2 (RESTRICTIONS) OR 5 (CONFIDENTIALITY); OR (IV) EITHER PARTY'S
|
|
141
|
-
INDEMNIFICATION OBLIGATIONS UNDER SECTION 9.
|
|
142
|
-
|
|
143
|
-
9. INDEMNIFICATION
|
|
144
|
-
|
|
145
|
-
(a) Licensee shall defend, indemnify, and hold harmless Licensor and its
|
|
146
|
-
officers, directors, employees, and agents from and against any and all
|
|
147
|
-
third-party claims, damages, losses, liabilities, costs, and expenses
|
|
148
|
-
(including reasonable attorneys' fees) arising out of or related to:
|
|
149
|
-
(i) Licensee's breach of this Agreement, including but not limited to the
|
|
150
|
-
restrictions in Section 2 and the confidentiality obligations in
|
|
151
|
-
Section 5; (ii) Licensee's use of the Software in violation of applicable
|
|
152
|
-
law; or (iii) Licensee's gross negligence or willful misconduct.
|
|
153
|
-
|
|
154
|
-
(b) Licensor shall promptly notify Licensee of any such claim and provide
|
|
155
|
-
reasonable cooperation at Licensee's expense. Licensee shall have sole
|
|
156
|
-
control of the defense and settlement, provided that any settlement
|
|
157
|
-
requiring Licensor to admit liability or pay money shall require
|
|
158
|
-
Licensor's prior written consent.
|
|
159
|
-
|
|
160
|
-
10. TERMINATION
|
|
161
|
-
|
|
162
|
-
(a) This Agreement is effective until terminated.
|
|
163
|
-
|
|
164
|
-
(b) Licensor may terminate this Agreement immediately upon written notice if
|
|
165
|
-
Licensee breaches Section 2 (Restrictions), Section 5 (Confidentiality),
|
|
166
|
-
or Section 9 (Indemnification).
|
|
167
|
-
|
|
168
|
-
(c) For any other material breach, the non-breaching party may terminate this
|
|
169
|
-
Agreement if the breaching party fails to cure such breach within thirty
|
|
170
|
-
(30) days of receiving written notice thereof.
|
|
171
|
-
|
|
172
|
-
(d) Upon termination, Licensee must immediately cease all use of the Software
|
|
173
|
-
and destroy all copies (including backups) in its possession or control
|
|
174
|
-
within five (5) business days. Upon Licensor's request, Licensee shall
|
|
175
|
-
certify such destruction in writing.
|
|
176
|
-
|
|
177
|
-
(e) Sections 2, 3, 4, 5, 7, 8, 9, 11, and 12 survive termination of this
|
|
178
|
-
Agreement.
|
|
179
|
-
|
|
180
|
-
11. GOVERNING LAW
|
|
181
|
-
|
|
182
|
-
This Agreement shall be governed by and construed in accordance with the laws
|
|
183
|
-
of the State of Delaware, United States, without regard to its conflict-of-law
|
|
184
|
-
provisions. The United Nations Convention on Contracts for the International
|
|
185
|
-
Sale of Goods is expressly excluded. Any disputes arising under this Agreement
|
|
186
|
-
shall be resolved exclusively in the state or federal courts located in the
|
|
187
|
-
State of Delaware. Notwithstanding the foregoing, Licensor may seek injunctive
|
|
188
|
-
or other equitable relief in any court of competent jurisdiction to protect its
|
|
189
|
-
intellectual property rights or Confidential Information.
|
|
190
|
-
|
|
191
|
-
12. ENTIRE AGREEMENT
|
|
192
|
-
|
|
193
|
-
This Agreement constitutes the entire agreement between the parties with
|
|
194
|
-
respect to the Software and supersedes all prior negotiations, representations,
|
|
195
|
-
or agreements relating thereto. No modification of this Agreement shall be
|
|
196
|
-
binding unless in writing and signed by both parties.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|