Fetch an AQL directly to a Python graph representation (In NetworkX, IGraph, or Graph-Tool)
Project description
arangodb-pythongraph
Run an AQL and get a Python network object in return
Installation
pip install arangodb-pythongraph
Duh.
Graph frameworks
This package is based on pyintergraph and thus supports extraction to NetworkX, python-IGraph and Graph-Tools graph objects. However, these libraries are not defined as requirements for this package and if you want to extract to each of them you are required to install the necessary package accordingly.
Usage
All queries must return path objects.
Simple extraction
from arangodb_pythongraph import execute_to_pygraph
db = ... # ArangoDB connection (use python-arango package)
example_query = '''
FOR v0 in vertex_collection
FOR e, v, p IN OUTBOUND v0 edge_collection
RETURN p
'''
python_graph = execute_to_pygraph(db, query)
nx_graph = python_graph.to_networkx()
gt_graph = python_graph.to_graph_tool()
ig_graph = python_graph.to_igraph()
Attaching functionality to the AQL object
For a neater use, run arangodb_pythongraph.register()
Before:
python_graph = execute_to_pythongraph(db, query)
After:
python_graph = db.aql.execute_to_pythongraph(query)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for arangodb-pythongraph-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 098cc80f51a7eef8c42d2206da26cd831094f04a6a370ff62c682f32c6baeae1 |
|
MD5 | f2b5f559552d5aad6b0a0ad4f8d6bdaf |
|
BLAKE2b-256 | 92e6c3675b345b949b0fe8143f240650eac93cd75a8d2937336b16c65f23bc87 |
Close
Hashes for arangodb_pythongraph-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 466932c9914dafda7e064e484cf0cc219de48f6a997ba6e1a81b553a22e183dc |
|
MD5 | 9618983fd62052e405b9002a5a33a817 |
|
BLAKE2b-256 | 6ffcd7b41b5412619a472eb954ffce7bb1e38f7c6246b85c3f130791d91472d5 |