python-arango-async 0.0.3__tar.gz → 0.0.4__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.
Files changed (93) hide show
  1. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/PKG-INFO +61 -1
  2. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/README.md +60 -0
  3. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/arangoasync/collection.py +1716 -791
  4. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/arangoasync/database.py +242 -19
  5. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/arangoasync/exceptions.py +52 -0
  6. python_arango_async-0.0.4/arangoasync/graph.py +1050 -0
  7. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/arangoasync/typings.py +247 -5
  8. python_arango_async-0.0.4/arangoasync/version.py +1 -0
  9. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/docs/collection.rst +4 -2
  10. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/docs/document.rst +20 -0
  11. python_arango_async-0.0.4/docs/graph.rst +415 -0
  12. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/docs/index.rst +1 -0
  13. python_arango_async-0.0.4/docs/overview.rst +125 -0
  14. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/docs/serialization.rst +6 -0
  15. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/docs/specs.rst +3 -0
  16. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/python_arango_async.egg-info/PKG-INFO +61 -1
  17. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/python_arango_async.egg-info/SOURCES.txt +3 -0
  18. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/tests/conftest.py +14 -2
  19. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/tests/helpers.py +9 -0
  20. python_arango_async-0.0.4/tests/test_graph.py +404 -0
  21. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/tests/test_typings.py +56 -0
  22. python_arango_async-0.0.3/arangoasync/version.py +0 -1
  23. python_arango_async-0.0.3/docs/overview.rst +0 -63
  24. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/.circleci/config.yml +0 -0
  25. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/.github/workflows/codeql.yaml +0 -0
  26. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/.github/workflows/docs.yaml +0 -0
  27. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/.github/workflows/pypi.yaml +0 -0
  28. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/.gitignore +0 -0
  29. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/.pre-commit-config.yaml +0 -0
  30. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/.readthedocs.yaml +0 -0
  31. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/CONTRIBUTING.md +0 -0
  32. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/LICENSE +0 -0
  33. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/arangoasync/__init__.py +0 -0
  34. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/arangoasync/aql.py +0 -0
  35. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/arangoasync/auth.py +0 -0
  36. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/arangoasync/client.py +0 -0
  37. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/arangoasync/compression.py +0 -0
  38. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/arangoasync/connection.py +0 -0
  39. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/arangoasync/cursor.py +0 -0
  40. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/arangoasync/errno.py +0 -0
  41. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/arangoasync/executor.py +0 -0
  42. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/arangoasync/http.py +0 -0
  43. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/arangoasync/job.py +0 -0
  44. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/arangoasync/logger.py +0 -0
  45. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/arangoasync/request.py +0 -0
  46. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/arangoasync/resolver.py +0 -0
  47. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/arangoasync/response.py +0 -0
  48. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/arangoasync/result.py +0 -0
  49. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/arangoasync/serialization.py +0 -0
  50. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/docs/aql.rst +0 -0
  51. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/docs/async.rst +0 -0
  52. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/docs/authentication.rst +0 -0
  53. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/docs/certificates.rst +0 -0
  54. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/docs/compression.rst +0 -0
  55. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/docs/conf.py +0 -0
  56. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/docs/cursor.rst +0 -0
  57. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/docs/database.rst +0 -0
  58. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/docs/errno.rst +0 -0
  59. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/docs/errors.rst +0 -0
  60. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/docs/helpers.rst +0 -0
  61. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/docs/http.rst +0 -0
  62. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/docs/indexes.rst +0 -0
  63. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/docs/logging.rst +0 -0
  64. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/docs/migration.rst +0 -0
  65. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/docs/static/logo.png +0 -0
  66. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/docs/transaction.rst +0 -0
  67. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/docs/user.rst +0 -0
  68. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/pyproject.toml +0 -0
  69. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/python_arango_async.egg-info/dependency_links.txt +0 -0
  70. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/python_arango_async.egg-info/requires.txt +0 -0
  71. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/python_arango_async.egg-info/top_level.txt +0 -0
  72. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/setup.cfg +0 -0
  73. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/setup.py +0 -0
  74. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/starter.sh +0 -0
  75. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/tests/__init__.py +0 -0
  76. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/tests/static/cluster-3.11.conf +0 -0
  77. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/tests/static/cluster-3.12.conf +0 -0
  78. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/tests/static/keyfile +0 -0
  79. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/tests/static/single-3.11.conf +0 -0
  80. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/tests/static/single-3.12.conf +0 -0
  81. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/tests/test_aql.py +0 -0
  82. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/tests/test_async.py +0 -0
  83. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/tests/test_client.py +0 -0
  84. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/tests/test_collection.py +0 -0
  85. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/tests/test_compression.py +0 -0
  86. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/tests/test_connection.py +0 -0
  87. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/tests/test_cursor.py +0 -0
  88. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/tests/test_database.py +0 -0
  89. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/tests/test_document.py +0 -0
  90. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/tests/test_http.py +0 -0
  91. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/tests/test_resolver.py +0 -0
  92. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/tests/test_transaction.py +0 -0
  93. {python_arango_async-0.0.3 → python_arango_async-0.0.4}/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
3
+ Version: 0.0.4
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>
@@ -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.
@@ -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.