python-arango


Namepython-arango JSON
Version 7.9.1 PyPI version JSON
download
home_page
SummaryPython Driver for ArangoDB
upload_time2024-01-18 16:17:19
maintainer
docs_urlNone
author
requires_python>=3.8
licenseMIT 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-Community/python-arango/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/ArangoDB-Community/python-arango/tree/main)
[![CodeQL](https://github.com/ArangoDB-Community/python-arango/actions/workflows/codeql.yaml/badge.svg)](https://github.com/ArangoDB-Community/python-arango/actions/workflows/codeql.yaml)
[![Docs](https://github.com/ArangoDB-Community/python-arango/actions/workflows/docs.yaml/badge.svg)](https://github.com/ArangoDB-Community/python-arango/actions/workflows/docs.yaml)
[![Coverage Status](https://codecov.io/gh/ArangoDB-Community/python-arango/branch/main/graph/badge.svg?token=M8zrjrzsUY)](https://codecov.io/gh/ArangoDB-Community/python-arango)
[![Last commit](https://img.shields.io/github/last-commit/ArangoDB-Community/python-arango)](https://github.com/ArangoDB-Community/python-arango/commits/master)

[![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-Community/python-arango?color=9E2165&style=for-the-badge)](https://github.com/ArangoDB-Community/python-arango/blob/master/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.9+
- 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 hash index to the collection.
students.add_hash_index(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, breadth-first.
result = graph.traverse(
    start_vertex="students/01",
    direction="outbound",
    strategy="breadthfirst"
)
```

Please see the [documentation](https://docs.python-arango.com) for more details.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "python-arango",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Joohwan Oh <joohwan.oh@outlook.com>, Alexandru Petenchea <alexandru.petenchea@arangodb.com>, Anthony Mahanna <anthony.mahanna@arangodb.com>",
    "keywords": "arangodb,python,driver",
    "author": "",
    "author_email": "Joohwan Oh <joohwan.oh@outlook.com>",
    "download_url": "https://files.pythonhosted.org/packages/95/06/e439d1f948392f57b6f535649070651888495b8422a93dbe7cc952b459e9/python-arango-7.9.1.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-Community/python-arango/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/ArangoDB-Community/python-arango/tree/main)\n[![CodeQL](https://github.com/ArangoDB-Community/python-arango/actions/workflows/codeql.yaml/badge.svg)](https://github.com/ArangoDB-Community/python-arango/actions/workflows/codeql.yaml)\n[![Docs](https://github.com/ArangoDB-Community/python-arango/actions/workflows/docs.yaml/badge.svg)](https://github.com/ArangoDB-Community/python-arango/actions/workflows/docs.yaml)\n[![Coverage Status](https://codecov.io/gh/ArangoDB-Community/python-arango/branch/main/graph/badge.svg?token=M8zrjrzsUY)](https://codecov.io/gh/ArangoDB-Community/python-arango)\n[![Last commit](https://img.shields.io/github/last-commit/ArangoDB-Community/python-arango)](https://github.com/ArangoDB-Community/python-arango/commits/master)\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-Community/python-arango?color=9E2165&style=for-the-badge)](https://github.com/ArangoDB-Community/python-arango/blob/master/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.9+\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 hash index to the collection.\nstudents.add_hash_index(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, breadth-first.\nresult = graph.traverse(\n    start_vertex=\"students/01\",\n    direction=\"outbound\",\n    strategy=\"breadthfirst\"\n)\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": "7.9.1",
    "project_urls": {
        "homepage": "https://github.com/ArangoDB-Community/python-arango"
    },
    "split_keywords": [
        "arangodb",
        "python",
        "driver"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ceaf6c6350003fa28327ebf37ea5b059757dd76bbc0745ce5f030da2e07dc068",
                "md5": "879c402c4b6b6e806586516334e2d7f0",
                "sha256": "23ec7b3aad774db5f99df20f6a1036385c85eb5c9864e47628bc622ea812f2f8"
            },
            "downloads": -1,
            "filename": "python_arango-7.9.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "879c402c4b6b6e806586516334e2d7f0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 110639,
            "upload_time": "2024-01-18T16:17:16",
            "upload_time_iso_8601": "2024-01-18T16:17:16.850904Z",
            "url": "https://files.pythonhosted.org/packages/ce/af/6c6350003fa28327ebf37ea5b059757dd76bbc0745ce5f030da2e07dc068/python_arango-7.9.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9506e439d1f948392f57b6f535649070651888495b8422a93dbe7cc952b459e9",
                "md5": "fe6d628082c54f51809d5feb5ceb5547",
                "sha256": "18f7d365fb6cf45778fa73b559e3865d0a1c00081de65ef00ba238db52e374ab"
            },
            "downloads": -1,
            "filename": "python-arango-7.9.1.tar.gz",
            "has_sig": false,
            "md5_digest": "fe6d628082c54f51809d5feb5ceb5547",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 147189,
            "upload_time": "2024-01-18T16:17:19",
            "upload_time_iso_8601": "2024-01-18T16:17:19.213379Z",
            "url": "https://files.pythonhosted.org/packages/95/06/e439d1f948392f57b6f535649070651888495b8422a93dbe7cc952b459e9/python-arango-7.9.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-18 16:17:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ArangoDB-Community",
    "github_project": "python-arango",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "circle": true,
    "lcname": "python-arango"
}
        
Elapsed time: 0.16477s