python-arango-async 0.0.3__tar.gz → 0.0.5__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_async-0.0.3 → python_arango_async-0.0.5}/PKG-INFO +62 -2
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/README.md +61 -1
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/arangoasync/aql.py +4 -4
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/arangoasync/collection.py +1715 -791
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/arangoasync/database.py +959 -22
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/arangoasync/exceptions.py +96 -0
- python_arango_async-0.0.5/arangoasync/graph.py +1050 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/arangoasync/response.py +15 -1
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/arangoasync/typings.py +247 -5
- python_arango_async-0.0.5/arangoasync/version.py +1 -0
- python_arango_async-0.0.5/docs/analyzer.rst +39 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/docs/collection.rst +4 -2
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/docs/document.rst +70 -0
- python_arango_async-0.0.5/docs/graph.rst +415 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/docs/index.rst +3 -0
- python_arango_async-0.0.5/docs/overview.rst +125 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/docs/serialization.rst +6 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/docs/specs.rst +3 -0
- python_arango_async-0.0.5/docs/view.rst +69 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/python_arango_async.egg-info/PKG-INFO +62 -2
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/python_arango_async.egg-info/SOURCES.txt +7 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/starter.sh +1 -1
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/tests/conftest.py +14 -2
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/tests/helpers.py +27 -0
- python_arango_async-0.0.5/tests/test_analyzer.py +91 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/tests/test_document.py +48 -0
- python_arango_async-0.0.5/tests/test_graph.py +404 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/tests/test_typings.py +56 -0
- python_arango_async-0.0.5/tests/test_view.py +137 -0
- python_arango_async-0.0.3/arangoasync/version.py +0 -1
- python_arango_async-0.0.3/docs/overview.rst +0 -63
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/.circleci/config.yml +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/.github/workflows/codeql.yaml +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/.github/workflows/docs.yaml +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/.github/workflows/pypi.yaml +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/.gitignore +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/.pre-commit-config.yaml +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/.readthedocs.yaml +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/CONTRIBUTING.md +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/LICENSE +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/arangoasync/__init__.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/arangoasync/auth.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/arangoasync/client.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/arangoasync/compression.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/arangoasync/connection.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/arangoasync/cursor.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/arangoasync/errno.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/arangoasync/executor.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/arangoasync/http.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/arangoasync/job.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/arangoasync/logger.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/arangoasync/request.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/arangoasync/resolver.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/arangoasync/result.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/arangoasync/serialization.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/docs/aql.rst +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/docs/async.rst +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/docs/authentication.rst +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/docs/certificates.rst +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/docs/compression.rst +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/docs/conf.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/docs/cursor.rst +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/docs/database.rst +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/docs/errno.rst +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/docs/errors.rst +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/docs/helpers.rst +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/docs/http.rst +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/docs/indexes.rst +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/docs/logging.rst +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/docs/migration.rst +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/docs/static/logo.png +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/docs/transaction.rst +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/docs/user.rst +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/pyproject.toml +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/python_arango_async.egg-info/dependency_links.txt +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/python_arango_async.egg-info/requires.txt +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/python_arango_async.egg-info/top_level.txt +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/setup.cfg +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/setup.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/tests/__init__.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/tests/static/cluster-3.11.conf +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/tests/static/cluster-3.12.conf +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/tests/static/keyfile +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/tests/static/single-3.11.conf +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/tests/static/single-3.12.conf +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/tests/test_aql.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/tests/test_async.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/tests/test_client.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/tests/test_collection.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/tests/test_compression.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/tests/test_connection.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/tests/test_cursor.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/tests/test_database.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/tests/test_http.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/tests/test_resolver.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/tests/test_transaction.py +0 -0
- {python_arango_async-0.0.3 → python_arango_async-0.0.5}/tests/test_user.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-arango-async
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.5
|
|
4
4
|
Summary: Async Python Driver for ArangoDB
|
|
5
5
|
Author-email: Alexandru Petenchea <alexandru.petenchea@arangodb.com>, Anthony Mahanna <anthony.mahanna@arangodb.com>
|
|
6
6
|
Maintainer-email: Alexandru Petenchea <alexandru.petenchea@arangodb.com>, Anthony Mahanna <anthony.mahanna@arangodb.com>
|
|
@@ -39,7 +39,7 @@ Requires-Dist: sphinx_rtd_theme>=2.0; extra == "dev"
|
|
|
39
39
|
Requires-Dist: types-setuptools; extra == "dev"
|
|
40
40
|
Dynamic: license-file
|
|
41
41
|
|
|
42
|
-

|
|
42
|
+

|
|
43
43
|
|
|
44
44
|
[](https://dl.circleci.com/status-badge/redirect/gh/arangodb/python-arango-async/tree/main)
|
|
45
45
|
[](https://github.com/arangodb/python-arango-async/actions/workflows/codeql.yaml)
|
|
@@ -114,7 +114,67 @@ async def main():
|
|
|
114
114
|
student_names = []
|
|
115
115
|
async for doc in cursor:
|
|
116
116
|
student_names.append(doc["name"])
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Another example with [graphs](https://docs.arangodb.com/stable/graphs/):
|
|
117
120
|
|
|
121
|
+
```python
|
|
122
|
+
async def main():
|
|
123
|
+
from arangoasync import ArangoClient
|
|
124
|
+
from arangoasync.auth import Auth
|
|
125
|
+
|
|
126
|
+
# Initialize the client for ArangoDB.
|
|
127
|
+
async with ArangoClient(hosts="http://localhost:8529") as client:
|
|
128
|
+
auth = Auth(username="root", password="passwd")
|
|
129
|
+
|
|
130
|
+
# Connect to "test" database as root user.
|
|
131
|
+
db = await client.db("test", auth=auth)
|
|
132
|
+
|
|
133
|
+
# Get the API wrapper for graph "school".
|
|
134
|
+
if await db.has_graph("school"):
|
|
135
|
+
graph = db.graph("school")
|
|
136
|
+
else:
|
|
137
|
+
graph = await db.create_graph("school")
|
|
138
|
+
|
|
139
|
+
# Create vertex collections for the graph.
|
|
140
|
+
students = await graph.create_vertex_collection("students")
|
|
141
|
+
lectures = await graph.create_vertex_collection("lectures")
|
|
142
|
+
|
|
143
|
+
# Create an edge definition (relation) for the graph.
|
|
144
|
+
edges = await graph.create_edge_definition(
|
|
145
|
+
edge_collection="register",
|
|
146
|
+
from_vertex_collections=["students"],
|
|
147
|
+
to_vertex_collections=["lectures"]
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
# Insert vertex documents into "students" (from) vertex collection.
|
|
151
|
+
await students.insert({"_key": "01", "full_name": "Anna Smith"})
|
|
152
|
+
await students.insert({"_key": "02", "full_name": "Jake Clark"})
|
|
153
|
+
await students.insert({"_key": "03", "full_name": "Lisa Jones"})
|
|
154
|
+
|
|
155
|
+
# Insert vertex documents into "lectures" (to) vertex collection.
|
|
156
|
+
await lectures.insert({"_key": "MAT101", "title": "Calculus"})
|
|
157
|
+
await lectures.insert({"_key": "STA101", "title": "Statistics"})
|
|
158
|
+
await lectures.insert({"_key": "CSC101", "title": "Algorithms"})
|
|
159
|
+
|
|
160
|
+
# Insert edge documents into "register" edge collection.
|
|
161
|
+
await edges.insert({"_from": "students/01", "_to": "lectures/MAT101"})
|
|
162
|
+
await edges.insert({"_from": "students/01", "_to": "lectures/STA101"})
|
|
163
|
+
await edges.insert({"_from": "students/01", "_to": "lectures/CSC101"})
|
|
164
|
+
await edges.insert({"_from": "students/02", "_to": "lectures/MAT101"})
|
|
165
|
+
await edges.insert({"_from": "students/02", "_to": "lectures/STA101"})
|
|
166
|
+
await edges.insert({"_from": "students/03", "_to": "lectures/CSC101"})
|
|
167
|
+
|
|
168
|
+
# Traverse the graph in outbound direction, breath-first.
|
|
169
|
+
query = """
|
|
170
|
+
FOR v, e, p IN 1..3 OUTBOUND 'students/01' GRAPH 'school'
|
|
171
|
+
OPTIONS { bfs: true, uniqueVertices: 'global' }
|
|
172
|
+
RETURN {vertex: v, edge: e, path: p}
|
|
173
|
+
"""
|
|
174
|
+
|
|
175
|
+
async with await db.aql.execute(query) as cursor:
|
|
176
|
+
async for doc in cursor:
|
|
177
|
+
print(doc)
|
|
118
178
|
```
|
|
119
179
|
|
|
120
180
|
Please see the [documentation](https://python-arango-async.readthedocs.io/en/latest/) for more details.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-

|
|
1
|
+

|
|
2
2
|
|
|
3
3
|
[](https://dl.circleci.com/status-badge/redirect/gh/arangodb/python-arango-async/tree/main)
|
|
4
4
|
[](https://github.com/arangodb/python-arango-async/actions/workflows/codeql.yaml)
|
|
@@ -73,7 +73,67 @@ async def main():
|
|
|
73
73
|
student_names = []
|
|
74
74
|
async for doc in cursor:
|
|
75
75
|
student_names.append(doc["name"])
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Another example with [graphs](https://docs.arangodb.com/stable/graphs/):
|
|
76
79
|
|
|
80
|
+
```python
|
|
81
|
+
async def main():
|
|
82
|
+
from arangoasync import ArangoClient
|
|
83
|
+
from arangoasync.auth import Auth
|
|
84
|
+
|
|
85
|
+
# Initialize the client for ArangoDB.
|
|
86
|
+
async with ArangoClient(hosts="http://localhost:8529") as client:
|
|
87
|
+
auth = Auth(username="root", password="passwd")
|
|
88
|
+
|
|
89
|
+
# Connect to "test" database as root user.
|
|
90
|
+
db = await client.db("test", auth=auth)
|
|
91
|
+
|
|
92
|
+
# Get the API wrapper for graph "school".
|
|
93
|
+
if await db.has_graph("school"):
|
|
94
|
+
graph = db.graph("school")
|
|
95
|
+
else:
|
|
96
|
+
graph = await db.create_graph("school")
|
|
97
|
+
|
|
98
|
+
# Create vertex collections for the graph.
|
|
99
|
+
students = await graph.create_vertex_collection("students")
|
|
100
|
+
lectures = await graph.create_vertex_collection("lectures")
|
|
101
|
+
|
|
102
|
+
# Create an edge definition (relation) for the graph.
|
|
103
|
+
edges = await graph.create_edge_definition(
|
|
104
|
+
edge_collection="register",
|
|
105
|
+
from_vertex_collections=["students"],
|
|
106
|
+
to_vertex_collections=["lectures"]
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
# Insert vertex documents into "students" (from) vertex collection.
|
|
110
|
+
await students.insert({"_key": "01", "full_name": "Anna Smith"})
|
|
111
|
+
await students.insert({"_key": "02", "full_name": "Jake Clark"})
|
|
112
|
+
await students.insert({"_key": "03", "full_name": "Lisa Jones"})
|
|
113
|
+
|
|
114
|
+
# Insert vertex documents into "lectures" (to) vertex collection.
|
|
115
|
+
await lectures.insert({"_key": "MAT101", "title": "Calculus"})
|
|
116
|
+
await lectures.insert({"_key": "STA101", "title": "Statistics"})
|
|
117
|
+
await lectures.insert({"_key": "CSC101", "title": "Algorithms"})
|
|
118
|
+
|
|
119
|
+
# Insert edge documents into "register" edge collection.
|
|
120
|
+
await edges.insert({"_from": "students/01", "_to": "lectures/MAT101"})
|
|
121
|
+
await edges.insert({"_from": "students/01", "_to": "lectures/STA101"})
|
|
122
|
+
await edges.insert({"_from": "students/01", "_to": "lectures/CSC101"})
|
|
123
|
+
await edges.insert({"_from": "students/02", "_to": "lectures/MAT101"})
|
|
124
|
+
await edges.insert({"_from": "students/02", "_to": "lectures/STA101"})
|
|
125
|
+
await edges.insert({"_from": "students/03", "_to": "lectures/CSC101"})
|
|
126
|
+
|
|
127
|
+
# Traverse the graph in outbound direction, breath-first.
|
|
128
|
+
query = """
|
|
129
|
+
FOR v, e, p IN 1..3 OUTBOUND 'students/01' GRAPH 'school'
|
|
130
|
+
OPTIONS { bfs: true, uniqueVertices: 'global' }
|
|
131
|
+
RETURN {vertex: v, edge: e, path: p}
|
|
132
|
+
"""
|
|
133
|
+
|
|
134
|
+
async with await db.aql.execute(query) as cursor:
|
|
135
|
+
async for doc in cursor:
|
|
136
|
+
print(doc)
|
|
77
137
|
```
|
|
78
138
|
|
|
79
139
|
Please see the [documentation](https://python-arango-async.readthedocs.io/en/latest/) for more details.
|
|
@@ -597,7 +597,7 @@ class AQL:
|
|
|
597
597
|
def response_handler(resp: Response) -> Json:
|
|
598
598
|
if not resp.is_success:
|
|
599
599
|
raise AQLQueryExplainError(resp, request)
|
|
600
|
-
return self.deserializer.loads(resp.raw_body)
|
|
600
|
+
return Response.format_body(self.deserializer.loads(resp.raw_body))
|
|
601
601
|
|
|
602
602
|
return await self._executor.execute(request, response_handler)
|
|
603
603
|
|
|
@@ -625,7 +625,7 @@ class AQL:
|
|
|
625
625
|
def response_handler(resp: Response) -> Json:
|
|
626
626
|
if not resp.is_success:
|
|
627
627
|
raise AQLQueryValidateError(resp, request)
|
|
628
|
-
return self.deserializer.loads(resp.raw_body)
|
|
628
|
+
return Response.format_body(self.deserializer.loads(resp.raw_body))
|
|
629
629
|
|
|
630
630
|
return await self._executor.execute(request, response_handler)
|
|
631
631
|
|
|
@@ -719,7 +719,7 @@ class AQL:
|
|
|
719
719
|
def response_handler(resp: Response) -> Json:
|
|
720
720
|
if not resp.is_success:
|
|
721
721
|
raise AQLFunctionCreateError(resp, request)
|
|
722
|
-
return self.deserializer.loads(resp.raw_body)
|
|
722
|
+
return Response.format_body(self.deserializer.loads(resp.raw_body))
|
|
723
723
|
|
|
724
724
|
return await self._executor.execute(request, response_handler)
|
|
725
725
|
|
|
@@ -760,6 +760,6 @@ class AQL:
|
|
|
760
760
|
if not resp.is_success:
|
|
761
761
|
if not (resp.status_code == HTTP_NOT_FOUND and ignore_missing):
|
|
762
762
|
raise AQLFunctionDeleteError(resp, request)
|
|
763
|
-
return self.deserializer.loads(resp.raw_body)
|
|
763
|
+
return Response.format_body(self.deserializer.loads(resp.raw_body))
|
|
764
764
|
|
|
765
765
|
return await self._executor.execute(request, response_handler)
|