Skip to main content

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

arangodb-pythongraph-0.1.2.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

arangodb_pythongraph-0.1.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file arangodb-pythongraph-0.1.2.tar.gz.

File metadata

  • Download URL: arangodb-pythongraph-0.1.2.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.3 CPython/3.8.1 Darwin/18.7.0

File hashes

Hashes for arangodb-pythongraph-0.1.2.tar.gz
Algorithm Hash digest
SHA256 72afedd9d581e94b2c127c095e6e9168bc7e0f47acc27dbe28b3896063a43678
MD5 d13c91a1397f87c3442a581d9f0cc124
BLAKE2b-256 351357c8119ddcec81fb5740279394010ebf1d5e3ac4ccc911ed94c690ff0ced

See more details on using hashes here.

File details

Details for the file arangodb_pythongraph-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for arangodb_pythongraph-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1e915890fc66220bc50cf7e3cc720b151fcc22e687d50cc9f917746d831c8e5b
MD5 47d594479c13eb8916b9213656accf2b
BLAKE2b-256 3eb913a277f68dd5bb75c1bb0863dfc4ef5888f0fc3dc59a4dddb8069398da23

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page