python-arango 8.1.5__tar.gz → 8.1.7__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.
- {python_arango-8.1.5 → python_arango-8.1.7}/PKG-INFO +6 -3
- {python_arango-8.1.5 → python_arango-8.1.7}/README.md +3 -1
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/client.py +6 -4
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/collection.py +42 -69
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/database.py +20 -5
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/job.py +3 -3
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/request.py +1 -1
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/utils.py +4 -4
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/async.rst +2 -2
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/certificates.rst +16 -2
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/index.rst +3 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/python_arango.egg-info/PKG-INFO +6 -3
- {python_arango-8.1.5 → python_arango-8.1.7}/.circleci/config.yml +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/.github/workflows/codeql.yaml +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/.github/workflows/docs.yaml +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/.github/workflows/pypi.yaml +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/.gitignore +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/.pre-commit-config.yaml +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/.readthedocs.yaml +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/CONTRIBUTING.md +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/LICENSE +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/MANIFEST.in +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/__init__.py +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/api.py +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/aql.py +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/backup.py +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/cluster.py +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/connection.py +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/cursor.py +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/errno.py +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/exceptions.py +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/executor.py +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/formatter.py +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/foxx.py +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/graph.py +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/http.py +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/pregel.py +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/py.typed +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/replication.py +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/resolver.py +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/response.py +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/result.py +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/typings.py +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/arango/wal.py +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/Makefile +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/admin.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/analyzer.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/aql.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/auth.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/backup.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/batch.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/cluster.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/collection.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/compression.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/conf.py +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/contributing.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/cursor.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/database.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/document.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/errno.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/errors.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/foxx.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/graph.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/http.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/indexes.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/logging.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/make.bat +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/overload.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/overview.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/pregel.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/replication.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/requirements.txt +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/schema.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/serializer.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/simple.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/specs.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/static/logo.png +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/task.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/threading.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/transaction.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/user.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/view.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/docs/wal.rst +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/pyproject.toml +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/python_arango.egg-info/SOURCES.txt +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/python_arango.egg-info/dependency_links.txt +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/python_arango.egg-info/requires.txt +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/python_arango.egg-info/top_level.txt +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/setup.cfg +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/setup.py +0 -0
- {python_arango-8.1.5 → python_arango-8.1.7}/starter.sh +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: python-arango
|
|
3
|
-
Version: 8.1.
|
|
3
|
+
Version: 8.1.7
|
|
4
4
|
Summary: Python Driver for ArangoDB
|
|
5
5
|
Author-email: Joohwan Oh <joohwan.oh@outlook.com>
|
|
6
6
|
Maintainer-email: Joohwan Oh <joohwan.oh@outlook.com>, Alexandru Petenchea <alex.petenchea@gmail.com>, Anthony Mahanna <anthony.mahanna@arangodb.com>
|
|
@@ -62,6 +62,7 @@ Requires-Dist: sphinx; extra == "dev"
|
|
|
62
62
|
Requires-Dist: sphinx_rtd_theme; extra == "dev"
|
|
63
63
|
Requires-Dist: types-requests; extra == "dev"
|
|
64
64
|
Requires-Dist: types-setuptools; extra == "dev"
|
|
65
|
+
Dynamic: license-file
|
|
65
66
|
|
|
66
67
|

|
|
67
68
|
|
|
@@ -72,7 +73,7 @@ Requires-Dist: types-setuptools; extra == "dev"
|
|
|
72
73
|
[](https://github.com/arangodb/python-arango/commits/main)
|
|
73
74
|
|
|
74
75
|
[](https://pypi.org/project/python-arango/)
|
|
75
|
-
[](https://pypi.org/project/python-arango/)
|
|
76
77
|
|
|
77
78
|
[](https://github.com/arangodb/python-arango/blob/main/LICENSE)
|
|
78
79
|
[](https://github.com/psf/black)
|
|
@@ -84,6 +85,8 @@ Requires-Dist: types-setuptools; extra == "dev"
|
|
|
84
85
|
Python driver for [ArangoDB](https://www.arangodb.com), a scalable multi-model
|
|
85
86
|
database natively supporting documents, graphs and search.
|
|
86
87
|
|
|
88
|
+
If you're interested in using asyncio, please check [python-arango-async](https://github.com/arangodb/python-arango-async).
|
|
89
|
+
|
|
87
90
|
## Requirements
|
|
88
91
|
|
|
89
92
|
- ArangoDB version 3.11+
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://github.com/arangodb/python-arango/commits/main)
|
|
8
8
|
|
|
9
9
|
[](https://pypi.org/project/python-arango/)
|
|
10
|
-
[](https://pypi.org/project/python-arango/)
|
|
11
11
|
|
|
12
12
|
[](https://github.com/arangodb/python-arango/blob/main/LICENSE)
|
|
13
13
|
[](https://github.com/psf/black)
|
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
Python driver for [ArangoDB](https://www.arangodb.com), a scalable multi-model
|
|
20
20
|
database natively supporting documents, graphs and search.
|
|
21
21
|
|
|
22
|
+
If you're interested in using asyncio, please check [python-arango-async](https://github.com/arangodb/python-arango-async).
|
|
23
|
+
|
|
22
24
|
## Requirements
|
|
23
25
|
|
|
24
26
|
- ArangoDB version 3.11+
|
|
@@ -79,10 +79,12 @@ class ArangoClient:
|
|
|
79
79
|
:type deserializer: callable
|
|
80
80
|
:param verify_override: Override TLS certificate verification. This will
|
|
81
81
|
override the verify method of the underlying HTTP client.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
|
|
83
|
+
- `None`: Do not change the verification behavior of the
|
|
84
|
+
underlying HTTP client.
|
|
85
|
+
- `True`: Verify TLS certificate using the system CA certificates.
|
|
86
|
+
- `False`: Do not verify TLS certificate.
|
|
87
|
+
- `str`: Path to a custom CA bundle file or directory.
|
|
86
88
|
:type verify_override: Union[bool, str, None]
|
|
87
89
|
:param request_timeout: This is the default request timeout (in seconds)
|
|
88
90
|
for http requests issued by the client if the parameter http_client is
|
|
@@ -566,15 +566,31 @@ class Collection(ApiGroup):
|
|
|
566
566
|
|
|
567
567
|
return self._execute(request, response_handler)
|
|
568
568
|
|
|
569
|
-
def truncate(
|
|
569
|
+
def truncate(
|
|
570
|
+
self,
|
|
571
|
+
sync: Optional[bool] = None,
|
|
572
|
+
compact: Optional[bool] = None,
|
|
573
|
+
) -> Result[bool]:
|
|
570
574
|
"""Delete all documents in the collection.
|
|
571
575
|
|
|
576
|
+
:param sync: Block until deletion operation is synchronized to disk.
|
|
577
|
+
:type sync: bool | None
|
|
578
|
+
:param compact: Whether to compact the collection after truncation.
|
|
579
|
+
:type compact: bool | None
|
|
572
580
|
:return: True if collection was truncated successfully.
|
|
573
581
|
:rtype: bool
|
|
574
582
|
:raise arango.exceptions.CollectionTruncateError: If operation fails.
|
|
575
583
|
"""
|
|
584
|
+
params: Json = {}
|
|
585
|
+
if sync is not None:
|
|
586
|
+
params["waitForSync"] = sync
|
|
587
|
+
if compact is not None:
|
|
588
|
+
params["compact"] = compact
|
|
589
|
+
|
|
576
590
|
request = Request(
|
|
577
|
-
method="put",
|
|
591
|
+
method="put",
|
|
592
|
+
endpoint=f"/_api/collection/{self.name}/truncate",
|
|
593
|
+
params=params,
|
|
578
594
|
)
|
|
579
595
|
|
|
580
596
|
def response_handler(resp: Response) -> bool:
|
|
@@ -1736,6 +1752,7 @@ class Collection(ApiGroup):
|
|
|
1736
1752
|
merge: Optional[bool] = None,
|
|
1737
1753
|
refill_index_caches: Optional[bool] = None,
|
|
1738
1754
|
version_attribute: Optional[str] = None,
|
|
1755
|
+
raise_on_document_error: bool = False,
|
|
1739
1756
|
) -> Result[Union[bool, List[Union[Json, ArangoServerError]]]]:
|
|
1740
1757
|
"""Insert multiple documents.
|
|
1741
1758
|
|
|
@@ -1745,15 +1762,8 @@ class Collection(ApiGroup):
|
|
|
1745
1762
|
returned as an object in the result list. It is up to you to
|
|
1746
1763
|
inspect the list to determine which documents were inserted
|
|
1747
1764
|
successfully (returns document metadata) and which were not
|
|
1748
|
-
(returns exception object).
|
|
1749
|
-
|
|
1750
|
-
.. note::
|
|
1751
|
-
|
|
1752
|
-
In edge/vertex collections, this method does NOT provide the
|
|
1753
|
-
transactional guarantees and validations that single insert
|
|
1754
|
-
operation does for graphs. If these properties are required, see
|
|
1755
|
-
:func:`arango.database.StandardDatabase.begin_batch_execution`
|
|
1756
|
-
for an alternative approach.
|
|
1765
|
+
(returns exception object). Alternatively, you can rely on
|
|
1766
|
+
setting **raise_on_document_error** to True (defaults to False).
|
|
1757
1767
|
|
|
1758
1768
|
:param documents: List of new documents to insert. If they contain the
|
|
1759
1769
|
"_key" or "_id" fields, the values are used as the keys of the new
|
|
@@ -1793,6 +1803,11 @@ class Collection(ApiGroup):
|
|
|
1793
1803
|
:param version_attribute: support for simple external versioning to
|
|
1794
1804
|
document operations.
|
|
1795
1805
|
:type version_attribute: str
|
|
1806
|
+
:param raise_on_document_error: Whether to raise if a DocumentRevisionError
|
|
1807
|
+
or a DocumentInsertError is encountered on an individual document,
|
|
1808
|
+
as opposed to returning the error as an object in the result list.
|
|
1809
|
+
Defaults to False.
|
|
1810
|
+
:type raise_on_document_error: bool
|
|
1796
1811
|
:return: List of document metadata (e.g. document keys, revisions) and
|
|
1797
1812
|
any exception, or True if parameter **silent** was set to True.
|
|
1798
1813
|
:rtype: [dict | ArangoServerError] | bool
|
|
@@ -1845,7 +1860,12 @@ class Collection(ApiGroup):
|
|
|
1845
1860
|
results.append(body)
|
|
1846
1861
|
else:
|
|
1847
1862
|
sub_resp = self._conn.prep_bulk_err_response(resp, body)
|
|
1848
|
-
|
|
1863
|
+
error = DocumentInsertError(sub_resp, request)
|
|
1864
|
+
|
|
1865
|
+
if raise_on_document_error:
|
|
1866
|
+
raise error
|
|
1867
|
+
|
|
1868
|
+
results.append(error)
|
|
1849
1869
|
|
|
1850
1870
|
return results
|
|
1851
1871
|
|
|
@@ -1876,14 +1896,6 @@ class Collection(ApiGroup):
|
|
|
1876
1896
|
(returns exception object). Alternatively, you can rely on
|
|
1877
1897
|
setting **raise_on_document_error** to True (defaults to False).
|
|
1878
1898
|
|
|
1879
|
-
.. note::
|
|
1880
|
-
|
|
1881
|
-
In edge/vertex collections, this method does NOT provide the
|
|
1882
|
-
transactional guarantees and validations that single update
|
|
1883
|
-
operation does for graphs. If these properties are required, see
|
|
1884
|
-
:func:`arango.database.StandardDatabase.begin_batch_execution`
|
|
1885
|
-
for an alternative approach.
|
|
1886
|
-
|
|
1887
1899
|
:param documents: Partial or full documents with the updated values.
|
|
1888
1900
|
They must contain the "_id" or "_key" fields.
|
|
1889
1901
|
:type documents: [dict]
|
|
@@ -1995,14 +2007,6 @@ class Collection(ApiGroup):
|
|
|
1995
2007
|
) -> Result[int]:
|
|
1996
2008
|
"""Update matching documents.
|
|
1997
2009
|
|
|
1998
|
-
.. note::
|
|
1999
|
-
|
|
2000
|
-
In edge/vertex collections, this method does NOT provide the
|
|
2001
|
-
transactional guarantees and validations that single update
|
|
2002
|
-
operation does for graphs. If these properties are required, see
|
|
2003
|
-
:func:`arango.database.StandardDatabase.begin_batch_execution`
|
|
2004
|
-
for an alternative approach.
|
|
2005
|
-
|
|
2006
2010
|
:param filters: Document filters.
|
|
2007
2011
|
:type filters: dict
|
|
2008
2012
|
:param body: Full or partial document body with the updates.
|
|
@@ -2085,14 +2089,6 @@ class Collection(ApiGroup):
|
|
|
2085
2089
|
successfully (returns document metadata) and which were not
|
|
2086
2090
|
(returns exception object).
|
|
2087
2091
|
|
|
2088
|
-
.. note::
|
|
2089
|
-
|
|
2090
|
-
In edge/vertex collections, this method does NOT provide the
|
|
2091
|
-
transactional guarantees and validations that single replace
|
|
2092
|
-
operation does for graphs. If these properties are required, see
|
|
2093
|
-
:func:`arango.database.StandardDatabase.begin_batch_execution`
|
|
2094
|
-
for an alternative approach.
|
|
2095
|
-
|
|
2096
2092
|
:param documents: New documents to replace the old ones with. They must
|
|
2097
2093
|
contain the "_id" or "_key" fields. Edge documents must also have
|
|
2098
2094
|
"_from" and "_to" fields.
|
|
@@ -2187,14 +2183,6 @@ class Collection(ApiGroup):
|
|
|
2187
2183
|
) -> Result[int]:
|
|
2188
2184
|
"""Replace matching documents.
|
|
2189
2185
|
|
|
2190
|
-
.. note::
|
|
2191
|
-
|
|
2192
|
-
In edge/vertex collections, this method does NOT provide the
|
|
2193
|
-
transactional guarantees and validations that single replace
|
|
2194
|
-
operation does for graphs. If these properties are required, see
|
|
2195
|
-
:func:`arango.database.StandardDatabase.begin_batch_execution`
|
|
2196
|
-
for an alternative approach.
|
|
2197
|
-
|
|
2198
2186
|
:param filters: Document filters.
|
|
2199
2187
|
:type filters: dict
|
|
2200
2188
|
:param body: New document body.
|
|
@@ -2252,6 +2240,7 @@ class Collection(ApiGroup):
|
|
|
2252
2240
|
sync: Optional[bool] = None,
|
|
2253
2241
|
silent: bool = False,
|
|
2254
2242
|
refill_index_caches: Optional[bool] = None,
|
|
2243
|
+
raise_on_document_error: bool = False,
|
|
2255
2244
|
) -> Result[Union[bool, List[Union[Json, ArangoServerError]]]]:
|
|
2256
2245
|
"""Delete multiple documents.
|
|
2257
2246
|
|
|
@@ -2263,14 +2252,6 @@ class Collection(ApiGroup):
|
|
|
2263
2252
|
successfully (returns document metadata) and which were not
|
|
2264
2253
|
(returns exception object).
|
|
2265
2254
|
|
|
2266
|
-
.. note::
|
|
2267
|
-
|
|
2268
|
-
In edge/vertex collections, this method does NOT provide the
|
|
2269
|
-
transactional guarantees and validations that single delete
|
|
2270
|
-
operation does for graphs. If these properties are required, see
|
|
2271
|
-
:func:`arango.database.StandardDatabase.begin_batch_execution`
|
|
2272
|
-
for an alternative approach.
|
|
2273
|
-
|
|
2274
2255
|
:param documents: Document IDs, keys or bodies. Document bodies must
|
|
2275
2256
|
contain the "_id" or "_key" fields.
|
|
2276
2257
|
:type documents: [str | dict]
|
|
@@ -2288,6 +2269,11 @@ class Collection(ApiGroup):
|
|
|
2288
2269
|
index caches if document operations affect the edge index or
|
|
2289
2270
|
cache-enabled persistent indexes.
|
|
2290
2271
|
:type refill_index_caches: bool | None
|
|
2272
|
+
:param raise_on_document_error: Whether to raise if a DocumentRevisionError
|
|
2273
|
+
or a DocumentDeleteError is encountered on an individual document,
|
|
2274
|
+
as opposed to returning the error as an object in the result list.
|
|
2275
|
+
Defaults to False.
|
|
2276
|
+
:type raise_on_document_error: bool
|
|
2291
2277
|
:return: List of document metadata (e.g. document keys, revisions) and
|
|
2292
2278
|
any exceptions, or True if parameter **silent** was set to True.
|
|
2293
2279
|
:rtype: [dict | ArangoServerError] | bool
|
|
@@ -2339,6 +2325,10 @@ class Collection(ApiGroup):
|
|
|
2339
2325
|
error = DocumentRevisionError(sub_resp, request)
|
|
2340
2326
|
else:
|
|
2341
2327
|
error = DocumentDeleteError(sub_resp, request)
|
|
2328
|
+
|
|
2329
|
+
if raise_on_document_error:
|
|
2330
|
+
raise error
|
|
2331
|
+
|
|
2342
2332
|
results.append(error)
|
|
2343
2333
|
|
|
2344
2334
|
return results
|
|
@@ -2354,14 +2344,6 @@ class Collection(ApiGroup):
|
|
|
2354
2344
|
) -> Result[int]:
|
|
2355
2345
|
"""Delete matching documents.
|
|
2356
2346
|
|
|
2357
|
-
.. note::
|
|
2358
|
-
|
|
2359
|
-
In edge/vertex collections, this method does NOT provide the
|
|
2360
|
-
transactional guarantees and validations that single delete
|
|
2361
|
-
operation does for graphs. If these properties are required, see
|
|
2362
|
-
:func:`arango.database.StandardDatabase.begin_batch_execution`
|
|
2363
|
-
for an alternative approach.
|
|
2364
|
-
|
|
2365
2347
|
:param filters: Document filters.
|
|
2366
2348
|
:type filters: dict
|
|
2367
2349
|
:param limit: Max number of documents to delete. If the limit is lower
|
|
@@ -2428,14 +2410,6 @@ class Collection(ApiGroup):
|
|
|
2428
2410
|
This method is faster than :func:`arango.collection.Collection.insert_many`
|
|
2429
2411
|
but does not return as many details.
|
|
2430
2412
|
|
|
2431
|
-
.. note::
|
|
2432
|
-
|
|
2433
|
-
In edge/vertex collections, this method does NOT provide the
|
|
2434
|
-
transactional guarantees and validations that single insert
|
|
2435
|
-
operation does for graphs. If these properties are required, see
|
|
2436
|
-
:func:`arango.database.StandardDatabase.begin_batch_execution`
|
|
2437
|
-
for an alternative approach.
|
|
2438
|
-
|
|
2439
2413
|
:param documents: List of new documents to insert. If they contain the
|
|
2440
2414
|
"_key" or "_id" fields, the values are used as the keys of the new
|
|
2441
2415
|
documents (auto-generated otherwise). Any "_rev" field is ignored.
|
|
@@ -2757,7 +2731,6 @@ class StandardCollection(Collection):
|
|
|
2757
2731
|
"returnNew": return_new,
|
|
2758
2732
|
"returnOld": return_old,
|
|
2759
2733
|
"ignoreRevs": not check_rev,
|
|
2760
|
-
"overwrite": not check_rev,
|
|
2761
2734
|
"silent": silent,
|
|
2762
2735
|
}
|
|
2763
2736
|
if sync is not None:
|
|
@@ -17,6 +17,7 @@ from arango.backup import Backup
|
|
|
17
17
|
from arango.cluster import Cluster
|
|
18
18
|
from arango.collection import StandardCollection
|
|
19
19
|
from arango.connection import Connection
|
|
20
|
+
from arango.errno import HTTP_NOT_FOUND
|
|
20
21
|
from arango.exceptions import (
|
|
21
22
|
AnalyzerCreateError,
|
|
22
23
|
AnalyzerDeleteError,
|
|
@@ -1644,12 +1645,14 @@ class Database(ApiGroup):
|
|
|
1644
1645
|
:return: True if graph exists, False otherwise.
|
|
1645
1646
|
:rtype: bool
|
|
1646
1647
|
"""
|
|
1647
|
-
request = Request(method="get", endpoint="/_api/gharial")
|
|
1648
|
+
request = Request(method="get", endpoint=f"/_api/gharial/{name}")
|
|
1648
1649
|
|
|
1649
1650
|
def response_handler(resp: Response) -> bool:
|
|
1650
|
-
if
|
|
1651
|
-
|
|
1652
|
-
|
|
1651
|
+
if resp.is_success:
|
|
1652
|
+
return True
|
|
1653
|
+
if resp.status_code == HTTP_NOT_FOUND:
|
|
1654
|
+
return False
|
|
1655
|
+
raise GraphListError(resp, request)
|
|
1653
1656
|
|
|
1654
1657
|
return self._execute(request, response_handler)
|
|
1655
1658
|
|
|
@@ -1699,6 +1702,7 @@ class Database(ApiGroup):
|
|
|
1699
1702
|
replication_factor: Optional[int] = None,
|
|
1700
1703
|
write_concern: Optional[int] = None,
|
|
1701
1704
|
satellite_collections: Optional[Sequence[str]] = None,
|
|
1705
|
+
sync: Optional[bool] = None,
|
|
1702
1706
|
) -> Result[Graph]:
|
|
1703
1707
|
"""Create a new graph.
|
|
1704
1708
|
|
|
@@ -1753,6 +1757,8 @@ class Database(ApiGroup):
|
|
|
1753
1757
|
element must be a string and a valid collection name. The
|
|
1754
1758
|
collection type cannot be modified later.
|
|
1755
1759
|
:type satellite_collections: [str] | None
|
|
1760
|
+
:param sync: Wait until everything is synced to disk.
|
|
1761
|
+
:type sync: bool | None
|
|
1756
1762
|
:return: Graph API wrapper.
|
|
1757
1763
|
:rtype: arango.graph.Graph
|
|
1758
1764
|
:raise arango.exceptions.GraphCreateError: If create fails.
|
|
@@ -1796,7 +1802,16 @@ class Database(ApiGroup):
|
|
|
1796
1802
|
if satellite_collections is not None: # pragma: no cover
|
|
1797
1803
|
data["options"]["satellites"] = satellite_collections
|
|
1798
1804
|
|
|
1799
|
-
|
|
1805
|
+
params: Params = {}
|
|
1806
|
+
if sync is not None:
|
|
1807
|
+
params["waitForSync"] = sync
|
|
1808
|
+
|
|
1809
|
+
request = Request(
|
|
1810
|
+
method="post",
|
|
1811
|
+
endpoint="/_api/gharial",
|
|
1812
|
+
data=data,
|
|
1813
|
+
params=params,
|
|
1814
|
+
)
|
|
1800
1815
|
|
|
1801
1816
|
def response_handler(resp: Response) -> Graph:
|
|
1802
1817
|
if resp.is_success:
|
|
@@ -60,10 +60,10 @@ class AsyncJob(Generic[T]):
|
|
|
60
60
|
fail.
|
|
61
61
|
|
|
62
62
|
:return: Async job status. Possible values are "pending" (job is still
|
|
63
|
-
in queue), "done" (job finished or raised an error)
|
|
64
|
-
(job was cancelled before completion).
|
|
63
|
+
in queue), "done" (job finished or raised an error).
|
|
65
64
|
:rtype: str
|
|
66
|
-
:raise arango.exceptions.AsyncJobStatusError: If retrieval fails
|
|
65
|
+
:raise arango.exceptions.AsyncJobStatusError: If retrieval fails or
|
|
66
|
+
job is not found.
|
|
67
67
|
"""
|
|
68
68
|
request = Request(method="get", endpoint=f"/_api/job/{self._id}")
|
|
69
69
|
resp = self._conn.send_request(request)
|
|
@@ -12,7 +12,7 @@ def normalize_headers(
|
|
|
12
12
|
if driver_flags is not None:
|
|
13
13
|
for flag in driver_flags:
|
|
14
14
|
flags = flags + flag + ";"
|
|
15
|
-
driver_version = "8.1.
|
|
15
|
+
driver_version = "8.1.7"
|
|
16
16
|
driver_header = "python-arango/" + driver_version + " (" + flags + ")"
|
|
17
17
|
normalized_headers: Headers = {
|
|
18
18
|
"charset": "utf-8",
|
|
@@ -64,11 +64,11 @@ def get_doc_id(doc: Union[str, Json]) -> str:
|
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
def is_none_or_int(obj: Any) -> bool:
|
|
67
|
-
"""Check if obj is None or
|
|
67
|
+
"""Check if obj is None or a positive integer.
|
|
68
68
|
|
|
69
69
|
:param obj: Object to check.
|
|
70
70
|
:type obj: Any
|
|
71
|
-
:return: True if object is None or
|
|
71
|
+
:return: True if object is None or a positive integer.
|
|
72
72
|
:rtype: bool
|
|
73
73
|
"""
|
|
74
74
|
return obj is None or (isinstance(obj, int) and obj >= 0)
|
|
@@ -128,11 +128,11 @@ def build_filter_conditions(filters: Json) -> str:
|
|
|
128
128
|
return "FILTER " + " AND ".join(conditions)
|
|
129
129
|
|
|
130
130
|
|
|
131
|
-
def validate_sort_parameters(sort:
|
|
131
|
+
def validate_sort_parameters(sort: Jsons) -> bool:
|
|
132
132
|
"""Validate sort parameters for an AQL query.
|
|
133
133
|
|
|
134
134
|
:param sort: Document sort parameters.
|
|
135
|
-
:type sort:
|
|
135
|
+
:type sort: Jsons
|
|
136
136
|
:return: Validation success.
|
|
137
137
|
:rtype: bool
|
|
138
138
|
:raise arango.exceptions.SortValidationError: If sort parameters are invalid.
|
|
@@ -45,8 +45,8 @@ the results can be retrieved once available via :ref:`AsyncJob` objects.
|
|
|
45
45
|
|
|
46
46
|
# Retrieve the status of each async job.
|
|
47
47
|
for job in [job1, job2, job3, job4]:
|
|
48
|
-
# Job status can be "pending"
|
|
49
|
-
assert job.status() in {'pending', 'done'
|
|
48
|
+
# Job status can be "pending" or "done".
|
|
49
|
+
assert job.status() in {'pending', 'done'}
|
|
50
50
|
|
|
51
51
|
# Let's wait until the jobs are finished.
|
|
52
52
|
while job.status() != 'done':
|
|
@@ -17,8 +17,7 @@ your HTTP client as described in the :ref:`HTTPClients` section.
|
|
|
17
17
|
|
|
18
18
|
The ``ArangoClient`` class provides an option to override the verification behavior,
|
|
19
19
|
no matter what has been defined in the underlying HTTP session.
|
|
20
|
-
You can use this option to disable verification
|
|
21
|
-
defining a custom HTTP Client.
|
|
20
|
+
You can use this option to disable verification.
|
|
22
21
|
|
|
23
22
|
.. code-block:: python
|
|
24
23
|
|
|
@@ -34,3 +33,18 @@ application:
|
|
|
34
33
|
|
|
35
34
|
import requests
|
|
36
35
|
requests.packages.urllib3.disable_warnings()
|
|
36
|
+
|
|
37
|
+
You can also provide a custom CA bundle without defining a custom HTTP Client:
|
|
38
|
+
|
|
39
|
+
.. code-block:: python
|
|
40
|
+
|
|
41
|
+
client = ArangoClient(hosts="https://localhost:8529", verify_override="path/to/certfile")
|
|
42
|
+
|
|
43
|
+
If `verify_override` is set to a path to a directory, the directory must have been processed using the `c_rehash` utility
|
|
44
|
+
supplied with OpenSSL. For more information, see the `requests documentation <https://requests.readthedocs.io/en/master/user/advanced/#ssl-cert-verification>`_.
|
|
45
|
+
|
|
46
|
+
Setting `verify_override` to `True` will use the system's default CA bundle.
|
|
47
|
+
|
|
48
|
+
.. code-block:: python
|
|
49
|
+
|
|
50
|
+
client = ArangoClient(hosts="https://localhost:8529", verify_override=True)
|
|
@@ -7,6 +7,8 @@ Python-Arango
|
|
|
7
7
|
|
|
8
8
|
Welcome to the documentation for **python-arango**, a Python driver for ArangoDB_.
|
|
9
9
|
|
|
10
|
+
If you're interested in using asyncio, please check python-arango-async_ driver.
|
|
11
|
+
|
|
10
12
|
Requirements
|
|
11
13
|
=============
|
|
12
14
|
|
|
@@ -96,3 +98,4 @@ Development
|
|
|
96
98
|
specs
|
|
97
99
|
|
|
98
100
|
.. _ArangoDB: https://www.arangodb.com
|
|
101
|
+
.. _python-arango-async: https://python-arango-async.readthedocs.io
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: python-arango
|
|
3
|
-
Version: 8.1.
|
|
3
|
+
Version: 8.1.7
|
|
4
4
|
Summary: Python Driver for ArangoDB
|
|
5
5
|
Author-email: Joohwan Oh <joohwan.oh@outlook.com>
|
|
6
6
|
Maintainer-email: Joohwan Oh <joohwan.oh@outlook.com>, Alexandru Petenchea <alex.petenchea@gmail.com>, Anthony Mahanna <anthony.mahanna@arangodb.com>
|
|
@@ -62,6 +62,7 @@ Requires-Dist: sphinx; extra == "dev"
|
|
|
62
62
|
Requires-Dist: sphinx_rtd_theme; extra == "dev"
|
|
63
63
|
Requires-Dist: types-requests; extra == "dev"
|
|
64
64
|
Requires-Dist: types-setuptools; extra == "dev"
|
|
65
|
+
Dynamic: license-file
|
|
65
66
|
|
|
66
67
|

|
|
67
68
|
|
|
@@ -72,7 +73,7 @@ Requires-Dist: types-setuptools; extra == "dev"
|
|
|
72
73
|
[](https://github.com/arangodb/python-arango/commits/main)
|
|
73
74
|
|
|
74
75
|
[](https://pypi.org/project/python-arango/)
|
|
75
|
-
[](https://pypi.org/project/python-arango/)
|
|
76
77
|
|
|
77
78
|
[](https://github.com/arangodb/python-arango/blob/main/LICENSE)
|
|
78
79
|
[](https://github.com/psf/black)
|
|
@@ -84,6 +85,8 @@ Requires-Dist: types-setuptools; extra == "dev"
|
|
|
84
85
|
Python driver for [ArangoDB](https://www.arangodb.com), a scalable multi-model
|
|
85
86
|
database natively supporting documents, graphs and search.
|
|
86
87
|
|
|
88
|
+
If you're interested in using asyncio, please check [python-arango-async](https://github.com/arangodb/python-arango-async).
|
|
89
|
+
|
|
87
90
|
## Requirements
|
|
88
91
|
|
|
89
92
|
- ArangoDB version 3.11+
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|