tree: 6eb051b5958ee96c5a597806affde56db24f3e71 [path history] [tgz]
  1. age/
  2. antlr/
  3. samples/
  4. __init__.py
  5. LICENSE
  6. README.md
  7. requirements.txt
  8. setup.py
  9. test_age_py.py
  10. test_agtypes.py
drivers/python/README.md

AGE AGType parser and driver support for Python

AGType parser and driver support for Apache AGE, graph extension for PostgreSQL.

Features

  • Unmarshal AGE result data(AGType) to Vertex, Edge, Path
  • Cypher query support for Psycopg2 PostreSQL driver (enables to use cypher queries directly)

Prerequisites

sudo apt-get update
sudo apt-get install python3-dev libpq-dev
git clone https://github.com/apache/age.git
cd age/drivers/python

Install required packages

pip install -r requirements.txt

Test

python test_age_py.py \
-host "127.0.0.1" \
-db "postgres" \
-u "postgres" \
-pass "agens" \
-port 5432 \
-gn "test_graph"
python -m unittest -v test_agtypes.py

Build from source

python setup.py install

For more information about Apache AGE

Check AGE loaded on your PostgreSQL

Connect to your containerized Postgres instance and then run the following commands:

# psql 
CREATE EXTENSION age;
LOAD 'age';
SET search_path = ag_catalog, "$user", public;

Usage

License

Apache-2.0 License