1
- # python-arango
1
+ ![ Logo ] ( docs/static/logo.png )
2
2
3
- Python driver for [ ArangoDB] ( https://www.arangodb.com ) .
3
+ [ ![ Build] ( https://github.com/joowani/python-arango/actions/workflows/build.yaml/badge.svg )] ( https://github.com/joowani/python-arango/actions/workflows/build.yaml )
4
+ [ ![ CodeQL] ( https://github.com/joowani/python-arango/actions/workflows/codeql.yaml/badge.svg )] ( https://github.com/joowani/python-arango/actions/workflows/codeql.yaml )
5
+ [ ![ CodeCov] ( https://codecov.io/gh/joowani/python-arango/branch/main/graph/badge.svg?token=DXg0O4hxnx )] ( https://codecov.io/gh/joowani/python-arango )
6
+ [ ![ PyPI version] ( https://badge.fury.io/py/python-arango.svg )] ( https://badge.fury.io/py/python-arango )
7
+ [ ![ GitHub license] ( https://img.shields.io/badge/license-MIT-brightgreen )] ( https://github.com/joowani/python-arango/blob/main/LICENSE )
8
+ ![ Python version] ( https://img.shields.io/badge/python-3.6%2B-blue )
9
+
10
+ # Python-Arango
11
+
12
+ Python driver for [ ArangoDB] ( https://www.arangodb.com ) , a scalable multi-model
13
+ database natively supporting documents, graphs and search.
4
14
5
15
## Requirements
6
16
7
- Python 3.6+ and ArangoDB 3.7+
17
+ - ArangoDB version 3.7+
18
+ - Python version 3.6+
8
19
9
20
## Installation
10
21
@@ -47,7 +58,7 @@ cursor = db.aql.execute("FOR doc IN students RETURN doc")
47
58
student_names = [document[" name" ] for document in cursor]
48
59
```
49
60
50
- Here is another example with graphs:
61
+ Another example with [ graphs] ( https://www.arangodb.com/docs/stable/graphs.html ) :
51
62
52
63
``` python
53
64
from arango import ArangoClient
@@ -66,7 +77,7 @@ students = graph.create_vertex_collection("students")
66
77
lectures = graph.create_vertex_collection(" lectures" )
67
78
68
79
# Create an edge definition (relation) for the graph.
69
- register = graph.create_edge_definition(
80
+ edges = graph.create_edge_definition(
70
81
edge_collection = " register" ,
71
82
from_vertex_collections = [" students" ],
72
83
to_vertex_collections = [" lectures" ]
@@ -83,12 +94,12 @@ lectures.insert({"_key": "STA101", "title": "Statistics"})
83
94
lectures.insert({" _key" : " CSC101" , " title" : " Algorithms" })
84
95
85
96
# Insert edge documents into "register" edge collection.
86
- register .insert({" _from" : " students/01" , " _to" : " lectures/MAT101" })
87
- register .insert({" _from" : " students/01" , " _to" : " lectures/STA101" })
88
- register .insert({" _from" : " students/01" , " _to" : " lectures/CSC101" })
89
- register .insert({" _from" : " students/02" , " _to" : " lectures/MAT101" })
90
- register .insert({" _from" : " students/02" , " _to" : " lectures/STA101" })
91
- register .insert({" _from" : " students/03" , " _to" : " lectures/CSC101" })
97
+ edges .insert({" _from" : " students/01" , " _to" : " lectures/MAT101" })
98
+ edges .insert({" _from" : " students/01" , " _to" : " lectures/STA101" })
99
+ edges .insert({" _from" : " students/01" , " _to" : " lectures/CSC101" })
100
+ edges .insert({" _from" : " students/02" , " _to" : " lectures/MAT101" })
101
+ edges .insert({" _from" : " students/02" , " _to" : " lectures/STA101" })
102
+ edges .insert({" _from" : " students/03" , " _to" : " lectures/CSC101" })
92
103
93
104
# Traverse the graph in outbound direction, breadth-first.
94
105
result = graph.traverse(
@@ -98,5 +109,5 @@ result = graph.traverse(
98
109
)
99
110
```
100
111
101
- Please see [ documentation] ( http://python-driver-for-arangodb.readthedocs.io/en/master/index.html )
112
+ Please see the [ documentation] ( http://python-driver-for-arangodb.readthedocs.io/en/master/index.html )
102
113
for more details.
0 commit comments