Name | python-arango JSON |
Version |
8.1.4
JSON |
| download |
home_page | None |
Summary | Python Driver for ArangoDB |
upload_time | 2024-12-10 14:06:11 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT License Copyright (c) 2016-2021 Joohwan Oh Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
arangodb
python
driver
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
![Logo](https://user-images.githubusercontent.com/2701938/108583516-c3576680-72ee-11eb-883f-2d9b52e74e45.png)
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/arangodb/python-arango/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/arangodb/python-arango/tree/main)
[![CodeQL](https://github.com/arangodb/python-arango/actions/workflows/codeql.yaml/badge.svg)](https://github.com/arangodb/python-arango/actions/workflows/codeql.yaml)
[![Docs](https://github.com/arangodb/python-arango/actions/workflows/docs.yaml/badge.svg)](https://github.com/arangodb/python-arango/actions/workflows/docs.yaml)
[![Coverage Status](https://codecov.io/gh/arangodb/python-arango/branch/main/graph/badge.svg?token=M8zrjrzsUY)](https://codecov.io/gh/arangodb/python-arango)
[![Last commit](https://img.shields.io/github/last-commit/arangodb/python-arango)](https://github.com/arangodb/python-arango/commits/main)
[![PyPI version badge](https://img.shields.io/pypi/v/python-arango?color=3775A9&style=for-the-badge&logo=pypi&logoColor=FFD43B)](https://pypi.org/project/python-arango/)
[![Python versions badge](https://img.shields.io/badge/3.8%2B-3776AB?style=for-the-badge&logo=python&logoColor=FFD43B&label=Python)](https://pypi.org/project/python-arango/)
[![License](https://img.shields.io/github/license/arangodb/python-arango?color=9E2165&style=for-the-badge)](https://github.com/arangodb/python-arango/blob/main/LICENSE)
[![Code style: black](https://img.shields.io/static/v1?style=for-the-badge&label=code%20style&message=black&color=black)](https://github.com/psf/black)
[![Downloads](https://img.shields.io/pepy/dt/python-arango?style=for-the-badge&color=282661
)](https://pepy.tech/project/python-arango)
# Python-Arango
Python driver for [ArangoDB](https://www.arangodb.com), a scalable multi-model
database natively supporting documents, graphs and search.
## Requirements
- ArangoDB version 3.11+
- Python version 3.8+
## Installation
```shell
pip install python-arango --upgrade
```
## Getting Started
Here is a simple usage example:
```python
from arango import ArangoClient
# Initialize the client for ArangoDB.
client = ArangoClient(hosts="http://localhost:8529")
# Connect to "_system" database as root user.
sys_db = client.db("_system", username="root", password="passwd")
# Create a new database named "test".
sys_db.create_database("test")
# Connect to "test" database as root user.
db = client.db("test", username="root", password="passwd")
# Create a new collection named "students".
students = db.create_collection("students")
# Add a persistent index to the collection.
students.add_index({'type': 'persistent', 'fields': ['name'], 'unique': True})
# Insert new documents into the collection.
students.insert({"name": "jane", "age": 39})
students.insert({"name": "josh", "age": 18})
students.insert({"name": "judy", "age": 21})
# Execute an AQL query and iterate through the result cursor.
cursor = db.aql.execute("FOR doc IN students RETURN doc")
student_names = [document["name"] for document in cursor]
```
Another example with [graphs](https://www.arangodb.com/docs/stable/graphs.html):
```python
from arango import ArangoClient
# Initialize the client for ArangoDB.
client = ArangoClient(hosts="http://localhost:8529")
# Connect to "test" database as root user.
db = client.db("test", username="root", password="passwd")
# Create a new graph named "school".
graph = db.create_graph("school")
# Create a new EnterpriseGraph [Enterprise Edition]
eegraph = db.create_graph(
name="school",
smart=True)
# Create vertex collections for the graph.
students = graph.create_vertex_collection("students")
lectures = graph.create_vertex_collection("lectures")
# Create an edge definition (relation) for the graph.
edges = graph.create_edge_definition(
edge_collection="register",
from_vertex_collections=["students"],
to_vertex_collections=["lectures"]
)
# Insert vertex documents into "students" (from) vertex collection.
students.insert({"_key": "01", "full_name": "Anna Smith"})
students.insert({"_key": "02", "full_name": "Jake Clark"})
students.insert({"_key": "03", "full_name": "Lisa Jones"})
# Insert vertex documents into "lectures" (to) vertex collection.
lectures.insert({"_key": "MAT101", "title": "Calculus"})
lectures.insert({"_key": "STA101", "title": "Statistics"})
lectures.insert({"_key": "CSC101", "title": "Algorithms"})
# Insert edge documents into "register" edge collection.
edges.insert({"_from": "students/01", "_to": "lectures/MAT101"})
edges.insert({"_from": "students/01", "_to": "lectures/STA101"})
edges.insert({"_from": "students/01", "_to": "lectures/CSC101"})
edges.insert({"_from": "students/02", "_to": "lectures/MAT101"})
edges.insert({"_from": "students/02", "_to": "lectures/STA101"})
edges.insert({"_from": "students/03", "_to": "lectures/CSC101"})
# Traverse the graph in outbound direction, breath-first.
query = """
FOR v, e, p IN 1..3 OUTBOUND 'students/01' GRAPH 'school'
OPTIONS { bfs: true, uniqueVertices: 'global' }
RETURN {vertex: v, edge: e, path: p}
"""
cursor = db.aql.execute(query)
```
Please see the [documentation](https://docs.python-arango.com) for more details.
Raw data
{
"_id": null,
"home_page": null,
"name": "python-arango",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "Joohwan Oh <joohwan.oh@outlook.com>, Alexandru Petenchea <alex.petenchea@gmail.com>, Anthony Mahanna <anthony.mahanna@arangodb.com>",
"keywords": "arangodb, python, driver",
"author": null,
"author_email": "Joohwan Oh <joohwan.oh@outlook.com>",
"download_url": "https://files.pythonhosted.org/packages/30/51/1d1147a9c4609a272b676e312905ceca009b8aa0a6f22a043cb66f42a907/python_arango-8.1.4.tar.gz",
"platform": null,
"description": "![Logo](https://user-images.githubusercontent.com/2701938/108583516-c3576680-72ee-11eb-883f-2d9b52e74e45.png)\n\n[![CircleCI](https://dl.circleci.com/status-badge/img/gh/arangodb/python-arango/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/arangodb/python-arango/tree/main)\n[![CodeQL](https://github.com/arangodb/python-arango/actions/workflows/codeql.yaml/badge.svg)](https://github.com/arangodb/python-arango/actions/workflows/codeql.yaml)\n[![Docs](https://github.com/arangodb/python-arango/actions/workflows/docs.yaml/badge.svg)](https://github.com/arangodb/python-arango/actions/workflows/docs.yaml)\n[![Coverage Status](https://codecov.io/gh/arangodb/python-arango/branch/main/graph/badge.svg?token=M8zrjrzsUY)](https://codecov.io/gh/arangodb/python-arango)\n[![Last commit](https://img.shields.io/github/last-commit/arangodb/python-arango)](https://github.com/arangodb/python-arango/commits/main)\n\n[![PyPI version badge](https://img.shields.io/pypi/v/python-arango?color=3775A9&style=for-the-badge&logo=pypi&logoColor=FFD43B)](https://pypi.org/project/python-arango/)\n[![Python versions badge](https://img.shields.io/badge/3.8%2B-3776AB?style=for-the-badge&logo=python&logoColor=FFD43B&label=Python)](https://pypi.org/project/python-arango/)\n\n[![License](https://img.shields.io/github/license/arangodb/python-arango?color=9E2165&style=for-the-badge)](https://github.com/arangodb/python-arango/blob/main/LICENSE)\n[![Code style: black](https://img.shields.io/static/v1?style=for-the-badge&label=code%20style&message=black&color=black)](https://github.com/psf/black)\n[![Downloads](https://img.shields.io/pepy/dt/python-arango?style=for-the-badge&color=282661\n)](https://pepy.tech/project/python-arango)\n\n# Python-Arango\n\nPython driver for [ArangoDB](https://www.arangodb.com), a scalable multi-model\ndatabase natively supporting documents, graphs and search.\n\n## Requirements\n\n- ArangoDB version 3.11+\n- Python version 3.8+\n\n## Installation\n\n```shell\npip install python-arango --upgrade\n```\n\n## Getting Started\n\nHere is a simple usage example:\n\n```python\nfrom arango import ArangoClient\n\n# Initialize the client for ArangoDB.\nclient = ArangoClient(hosts=\"http://localhost:8529\")\n\n# Connect to \"_system\" database as root user.\nsys_db = client.db(\"_system\", username=\"root\", password=\"passwd\")\n\n# Create a new database named \"test\".\nsys_db.create_database(\"test\")\n\n# Connect to \"test\" database as root user.\ndb = client.db(\"test\", username=\"root\", password=\"passwd\")\n\n# Create a new collection named \"students\".\nstudents = db.create_collection(\"students\")\n\n# Add a persistent index to the collection.\nstudents.add_index({'type': 'persistent', 'fields': ['name'], 'unique': True})\n\n# Insert new documents into the collection.\nstudents.insert({\"name\": \"jane\", \"age\": 39})\nstudents.insert({\"name\": \"josh\", \"age\": 18})\nstudents.insert({\"name\": \"judy\", \"age\": 21})\n\n# Execute an AQL query and iterate through the result cursor.\ncursor = db.aql.execute(\"FOR doc IN students RETURN doc\")\nstudent_names = [document[\"name\"] for document in cursor]\n```\n\nAnother example with [graphs](https://www.arangodb.com/docs/stable/graphs.html):\n\n```python\nfrom arango import ArangoClient\n\n# Initialize the client for ArangoDB.\nclient = ArangoClient(hosts=\"http://localhost:8529\")\n\n# Connect to \"test\" database as root user.\ndb = client.db(\"test\", username=\"root\", password=\"passwd\")\n\n# Create a new graph named \"school\".\ngraph = db.create_graph(\"school\")\n\n# Create a new EnterpriseGraph [Enterprise Edition]\neegraph = db.create_graph(\n name=\"school\",\n smart=True)\n\n# Create vertex collections for the graph.\nstudents = graph.create_vertex_collection(\"students\")\nlectures = graph.create_vertex_collection(\"lectures\")\n\n# Create an edge definition (relation) for the graph.\nedges = graph.create_edge_definition(\n edge_collection=\"register\",\n from_vertex_collections=[\"students\"],\n to_vertex_collections=[\"lectures\"]\n)\n\n# Insert vertex documents into \"students\" (from) vertex collection.\nstudents.insert({\"_key\": \"01\", \"full_name\": \"Anna Smith\"})\nstudents.insert({\"_key\": \"02\", \"full_name\": \"Jake Clark\"})\nstudents.insert({\"_key\": \"03\", \"full_name\": \"Lisa Jones\"})\n\n# Insert vertex documents into \"lectures\" (to) vertex collection.\nlectures.insert({\"_key\": \"MAT101\", \"title\": \"Calculus\"})\nlectures.insert({\"_key\": \"STA101\", \"title\": \"Statistics\"})\nlectures.insert({\"_key\": \"CSC101\", \"title\": \"Algorithms\"})\n\n# Insert edge documents into \"register\" edge collection.\nedges.insert({\"_from\": \"students/01\", \"_to\": \"lectures/MAT101\"})\nedges.insert({\"_from\": \"students/01\", \"_to\": \"lectures/STA101\"})\nedges.insert({\"_from\": \"students/01\", \"_to\": \"lectures/CSC101\"})\nedges.insert({\"_from\": \"students/02\", \"_to\": \"lectures/MAT101\"})\nedges.insert({\"_from\": \"students/02\", \"_to\": \"lectures/STA101\"})\nedges.insert({\"_from\": \"students/03\", \"_to\": \"lectures/CSC101\"})\n\n# Traverse the graph in outbound direction, breath-first.\nquery = \"\"\"\n FOR v, e, p IN 1..3 OUTBOUND 'students/01' GRAPH 'school'\n OPTIONS { bfs: true, uniqueVertices: 'global' }\n RETURN {vertex: v, edge: e, path: p}\n \"\"\"\ncursor = db.aql.execute(query)\n```\n\nPlease see the [documentation](https://docs.python-arango.com) for more details.\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2016-2021 Joohwan Oh Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Python Driver for ArangoDB",
"version": "8.1.4",
"project_urls": {
"homepage": "https://github.com/arangodb/python-arango"
},
"split_keywords": [
"arangodb",
" python",
" driver"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "53a0b07f740c3544dcec75d49047ee9a358682d8429e0e8b6bc734a8bd07fd4a",
"md5": "721f264755fb75a2ae1ce7454c528b13",
"sha256": "51a1cf36c361911c14053e501589fa7f9c89db80f67b567ebd0574e2a0c84702"
},
"downloads": -1,
"filename": "python_arango-8.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "721f264755fb75a2ae1ce7454c528b13",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 116543,
"upload_time": "2024-12-10T14:06:08",
"upload_time_iso_8601": "2024-12-10T14:06:08.861519Z",
"url": "https://files.pythonhosted.org/packages/53/a0/b07f740c3544dcec75d49047ee9a358682d8429e0e8b6bc734a8bd07fd4a/python_arango-8.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "30511d1147a9c4609a272b676e312905ceca009b8aa0a6f22a043cb66f42a907",
"md5": "d86788b7656bac4cbdb72bd34cb09ac9",
"sha256": "4f5a2fdf84935984a50a2f45dcef07956457e3e4ce6fa276741ac419b718031a"
},
"downloads": -1,
"filename": "python_arango-8.1.4.tar.gz",
"has_sig": false,
"md5_digest": "d86788b7656bac4cbdb72bd34cb09ac9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 154932,
"upload_time": "2024-12-10T14:06:11",
"upload_time_iso_8601": "2024-12-10T14:06:11.702296Z",
"url": "https://files.pythonhosted.org/packages/30/51/1d1147a9c4609a272b676e312905ceca009b8aa0a6f22a043cb66f42a907/python_arango-8.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-10 14:06:11",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "arangodb",
"github_project": "python-arango",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"circle": true,
"lcname": "python-arango"
}