Skip to main content

license CircleCI PyPI version GitHub issues

redisgraph-py

RedisGraph python client

Example: Using the Python Client

import redis
from redisgraph import Node, Edge, Graph

r = redis.Redis(host='localhost', port=6379)

redis_graph = Graph('social', r)

john = Node(label='person', properties={'name': 'John Doe', 'age': 33, 'gender': 'male', 'status': 'single'})
redis_graph.add_node(john)

japan = Node(label='country', properties={'name': 'Japan'})
redis_graph.add_node(japan)

edge = Edge(john, 'visited', japan, properties={'purpose': 'pleasure'})
redis_graph.add_edge(edge)

redis_graph.commit()

query = """MATCH (p:person)-[v:visited {purpose:"pleasure"}]->(c:country)
		   RETURN p.name, p.age, v.purpose, c.name"""

result = redis_graph.query(query)

# Print resultset
result.pretty_print()

# Iterate through resultset, skip header row at position 0
for record in result.result_set[1:]:
	person_name = record[0]
	person_age = record[1]
	visit_purpose = record[2]
	country_name = record[3]


# All done, remove graph.
redis_graph.delete()

Installing

pip install redisgraph

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

redisgraph-2.1.tar.gz (5.8 kB view details)

Uploaded Source

File details

Details for the file redisgraph-2.1.tar.gz.

File metadata

  • Download URL: redisgraph-2.1.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.17

File hashes

Hashes for redisgraph-2.1.tar.gz
Algorithm Hash digest
SHA256 66fce47e165ae54e3adafb211de9e6f2ffc46adbb8a8c354fc58fb87603c9d54
MD5 a3fbcd4957bd490e80242452ecbb5f3e
BLAKE2b-256 4c6136190ac30f1d2e7226942f8c90270eb8bac368dbfa1b085130b876686e64

See more details on using hashes here.

Release history Release notifications | RSS feed

2.4.4

2 files

2.4.3

2 files

2.4.2

2 files

2.4.1

2 files

2.4.0

2 files

2.3.0

1 file

2.2.4

1 file

2.2.3

1 file

2.1.5

2 files

2.1.4

1 file

2.1.3

1 file

2.1.2

1 file

2.1.1

1 file

This release

2.1 This release

1 file

2.0

1 file

1.7

1 file

1.6

1 file

1.5

1 file

1.4

1 file

1.3

1 file

1.2

1 file

1.1

1 file

1.0

1 file

0.9

1 file

0.8

1 file

0.6

1 file

0.5

1 file

0.4

1 file

0.3

1 file

0.2

1 file

0.1

1 file

Supported by

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