indexify 0.0.13__py3-none-any.whl → 0.0.14__py3-none-any.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.
- indexify/client.py +66 -4
- {indexify-0.0.13.dist-info → indexify-0.0.14.dist-info}/METADATA +1 -1
- {indexify-0.0.13.dist-info → indexify-0.0.14.dist-info}/RECORD +5 -5
- {indexify-0.0.13.dist-info → indexify-0.0.14.dist-info}/LICENSE.txt +0 -0
- {indexify-0.0.13.dist-info → indexify-0.0.14.dist-info}/WHEEL +0 -0
indexify/client.py
CHANGED
@@ -153,12 +153,40 @@ class IndexifyClient:
|
|
153
153
|
return self._request("POST", url=f"{self._service_url}/{endpoint}", **kwargs)
|
154
154
|
|
155
155
|
def put(self, endpoint: str, **kwargs) -> httpx.Response:
|
156
|
-
|
157
|
-
|
156
|
+
"""
|
157
|
+
Make a PUT request to the Indexify service.
|
158
|
+
|
159
|
+
:param endpoint: The endpoint to make the request to.
|
160
|
+
|
161
|
+
Example usage:
|
162
|
+
|
163
|
+
```
|
164
|
+
from indexify import IndexifyClient
|
158
165
|
|
166
|
+
client = IndexifyClient()
|
167
|
+
response = client.put("namespaces", json={"name": "my-repo"})
|
168
|
+
print(response.json())
|
169
|
+
```
|
170
|
+
"""
|
171
|
+
return self._request("PUT", url=f"{self._service_url}/{endpoint}", **kwargs)
|
172
|
+
|
159
173
|
def delete(self, endpoint: str, **kwargs) -> httpx.Response:
|
160
|
-
|
161
|
-
|
174
|
+
"""
|
175
|
+
Make a DELETE request to the Indexify service.
|
176
|
+
|
177
|
+
:param endpoint: The endpoint to make the request to.
|
178
|
+
|
179
|
+
Example usage:
|
180
|
+
|
181
|
+
```
|
182
|
+
from indexify import IndexifyClient
|
183
|
+
|
184
|
+
client = IndexifyClient()
|
185
|
+
response = client.delete("namespaces")
|
186
|
+
print(response.json())
|
187
|
+
```
|
188
|
+
"""
|
189
|
+
return self._request("DELETE", url=f"{self._service_url}/{endpoint}", **kwargs)
|
162
190
|
|
163
191
|
def close(self):
|
164
192
|
"""
|
@@ -399,6 +427,32 @@ class IndexifyClient:
|
|
399
427
|
)
|
400
428
|
response.raise_for_status()
|
401
429
|
|
430
|
+
def delete_documents(self, document_ids: List[str]) -> None:
|
431
|
+
"""
|
432
|
+
Delete documents from current namespace.
|
433
|
+
|
434
|
+
Args:
|
435
|
+
- document_ids (List[str]): list of document ids to delete
|
436
|
+
"""
|
437
|
+
req = {"content_ids": document_ids}
|
438
|
+
response = self.delete(
|
439
|
+
f"namespaces/{self.namespace}/content",
|
440
|
+
json=req,
|
441
|
+
headers={"Content-Type": "application/json"},
|
442
|
+
)
|
443
|
+
response.raise_for_status()
|
444
|
+
|
445
|
+
def update_content(self, document_id: str, path: str) -> None:
|
446
|
+
"""
|
447
|
+
Update a piece of content with a new file
|
448
|
+
|
449
|
+
Args:
|
450
|
+
- path (str): relative path to the file to be uploaded
|
451
|
+
"""
|
452
|
+
with open(path, "rb") as f:
|
453
|
+
response = self.put(f"namespaces/{self.namespace}/content/{document_id}", files={"file": f}, timeout=None)
|
454
|
+
response.raise_for_status()
|
455
|
+
|
402
456
|
def get_metadata(self, content_id: str) -> dict:
|
403
457
|
"""
|
404
458
|
Query metadata for a specific content ID in a given index.
|
@@ -443,6 +497,14 @@ class IndexifyClient:
|
|
443
497
|
)
|
444
498
|
response.raise_for_status()
|
445
499
|
|
500
|
+
def list_schemas(self) -> List[str]:
|
501
|
+
"""
|
502
|
+
List all schemas in the current namespace.
|
503
|
+
"""
|
504
|
+
response = self.get(f"namespaces/{self.namespace}/schemas")
|
505
|
+
response.raise_for_status()
|
506
|
+
return response.json()
|
507
|
+
|
446
508
|
def sql_query(self, query: str):
|
447
509
|
"""
|
448
510
|
Execute a SQL query.
|
@@ -1,5 +1,5 @@
|
|
1
1
|
indexify/__init__.py,sha256=Sz6zkAIHsPOi0rG5RM7dVkXGDa0fO2uurD6vS4Qo15E,312
|
2
|
-
indexify/client.py,sha256=
|
2
|
+
indexify/client.py,sha256=sT4tcSuR3wQBF0yYStBRva3xUfe15X6GjZaViiRX2sA,16944
|
3
3
|
indexify/data_containers.py,sha256=r1wxJPtsmXbyKvb17fqxm-dPjKz51oZ62f8A8Zxls1c,361
|
4
4
|
indexify/exceptions.py,sha256=vjd5SPPNFIEW35GorSIodsqvm9RKHQm9kdp8t9gv-WM,111
|
5
5
|
indexify/extraction_policy.py,sha256=vKVHT8jSjzhUaKqWpewOGkYojMBplvGdSm9zoSN9Pcg,750
|
@@ -7,7 +7,7 @@ indexify/extractor.py,sha256=KMcP9xopHJRBzeSxalztGGTBvOzVKRFEsJynV-hLRSc,1175
|
|
7
7
|
indexify/index.py,sha256=RvxYhJXEth-GKvqzlMiz5PuN1eIbZk84pt20piA1Gsw,504
|
8
8
|
indexify/settings.py,sha256=yzWAEZkrTjykSMj3hrFU7l_jUoUCOUsgPVW1nU-qzJQ,46
|
9
9
|
indexify/utils.py,sha256=rDN2lrsAs9noJEIjfx6ukmC2SAIyrlUt7QU-kaBjujM,125
|
10
|
-
indexify-0.0.
|
11
|
-
indexify-0.0.
|
12
|
-
indexify-0.0.
|
13
|
-
indexify-0.0.
|
10
|
+
indexify-0.0.14.dist-info/LICENSE.txt,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
11
|
+
indexify-0.0.14.dist-info/METADATA,sha256=ANdIdnRnC6ISLYc1oTUb-BE-NjdgUg0iEu0dHRmonnI,1714
|
12
|
+
indexify-0.0.14.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
13
|
+
indexify-0.0.14.dist-info/RECORD,,
|
File without changes
|
File without changes
|