diff options
author | CoprDistGit <infra@openeuler.org> | 2023-04-11 15:56:37 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-04-11 15:56:37 +0000 |
commit | b6f3510246a2681af09e4b8a101d414d2e52bc11 (patch) | |
tree | 7dc954761c1421ac893e4afe1ba95ca2a8c20ddc | |
parent | cffd59f578fd6d0543c85db28736fefb84c38079 (diff) |
automatic import of python-redisgraph
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-redisgraph.spec | 384 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 386 insertions, 0 deletions
@@ -0,0 +1 @@ +/redisgraph-2.4.4.tar.gz diff --git a/python-redisgraph.spec b/python-redisgraph.spec new file mode 100644 index 0000000..360af57 --- /dev/null +++ b/python-redisgraph.spec @@ -0,0 +1,384 @@ +%global _empty_manifest_terminate_build 0 +Name: python-redisgraph +Version: 2.4.4 +Release: 1 +Summary: RedisGraph Python Client +License: BSD-3-Clause +URL: https://pypi.org/project/redisgraph/ +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/0e/15/1d1f01473ce8b20a20d2dba137851c5efdd26ae0c999b9e6311814fd98b2/redisgraph-2.4.4.tar.gz +BuildArch: noarch + +Requires: python3-redis +Requires: python3-hiredis +Requires: python3-prettytable + +%description +[](https://github.com/RedisGraph/redisgraph-py) +[](https://circleci.com/gh/RedisGraph/redisgraph-py/tree/master) +[](https://badge.fury.io/py/redisgraph) +[](https://github.com/RedisGraph/redisgraph-py/releases/latest) +[](https://codecov.io/gh/RedisGraph/redisgraph-py) +[](https://snyk.io/test/github/RedisGraph/redisgraph-py?targetFile=pyproject.toml) +[](https://lgtm.com/projects/g/RedisGraph/redisgraph-py/alerts/) + +# redisgraph-py +[](https://forum.redis.com/c/modules/redisgraph) +[](https://discord.gg/gWBRT6P) + +RedisGraph python client + + +## Example: Using the Python Client + +```python +import redis +from redisgraph import Node, Edge, Graph, Path + +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() + +# Use parameters +params = {'purpose':"pleasure"} +query = """MATCH (p:person)-[v:visited {purpose:$purpose}]->(c:country) + RETURN p.name, p.age, v.purpose, c.name""" + +result = redis_graph.query(query, params) + +# Print resultset +result.pretty_print() + +# Use query timeout to raise an exception if the query takes over 10 milliseconds +result = redis_graph.query(query, params, timeout=10) + +# Iterate through resultset +for record in result.result_set: + person_name = record[0] + person_age = record[1] + visit_purpose = record[2] + country_name = record[3] + +query = """MATCH p = (:person)-[:visited {purpose:"pleasure"}]->(:country) RETURN p""" + +result = redis_graph.query(query) + +# Iterate through resultset +for record in result.result_set: + path = record[0] + print(path) + + +# All done, remove graph. +redis_graph.delete() +``` + +## Installing + +### Install official release + +``` +pip install redisgraph +``` +### Install latest release (Aligned with RedisGraph master) + +``` +pip install git+https://github.com/RedisGraph/redisgraph-py.git@master +``` + +### Install for development in env + +1. Create a virtualenv to manage your python dependencies, and ensure it's active. + ```virtualenv -v venv; source venv/bin/activate``` + +2. Install [pypoetry](https://python-poetry.org/) to manage your dependencies. + ```pip install poetry``` + +3. Install dependencies. + ```poetry install``` + +[tox](https://tox.readthedocs.io/en/latest/) runs all code linters as its default target. + + +%package -n python3-redisgraph +Summary: RedisGraph Python Client +Provides: python-redisgraph +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-redisgraph +[](https://github.com/RedisGraph/redisgraph-py) +[](https://circleci.com/gh/RedisGraph/redisgraph-py/tree/master) +[](https://badge.fury.io/py/redisgraph) +[](https://github.com/RedisGraph/redisgraph-py/releases/latest) +[](https://codecov.io/gh/RedisGraph/redisgraph-py) +[](https://snyk.io/test/github/RedisGraph/redisgraph-py?targetFile=pyproject.toml) +[](https://lgtm.com/projects/g/RedisGraph/redisgraph-py/alerts/) + +# redisgraph-py +[](https://forum.redis.com/c/modules/redisgraph) +[](https://discord.gg/gWBRT6P) + +RedisGraph python client + + +## Example: Using the Python Client + +```python +import redis +from redisgraph import Node, Edge, Graph, Path + +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() + +# Use parameters +params = {'purpose':"pleasure"} +query = """MATCH (p:person)-[v:visited {purpose:$purpose}]->(c:country) + RETURN p.name, p.age, v.purpose, c.name""" + +result = redis_graph.query(query, params) + +# Print resultset +result.pretty_print() + +# Use query timeout to raise an exception if the query takes over 10 milliseconds +result = redis_graph.query(query, params, timeout=10) + +# Iterate through resultset +for record in result.result_set: + person_name = record[0] + person_age = record[1] + visit_purpose = record[2] + country_name = record[3] + +query = """MATCH p = (:person)-[:visited {purpose:"pleasure"}]->(:country) RETURN p""" + +result = redis_graph.query(query) + +# Iterate through resultset +for record in result.result_set: + path = record[0] + print(path) + + +# All done, remove graph. +redis_graph.delete() +``` + +## Installing + +### Install official release + +``` +pip install redisgraph +``` +### Install latest release (Aligned with RedisGraph master) + +``` +pip install git+https://github.com/RedisGraph/redisgraph-py.git@master +``` + +### Install for development in env + +1. Create a virtualenv to manage your python dependencies, and ensure it's active. + ```virtualenv -v venv; source venv/bin/activate``` + +2. Install [pypoetry](https://python-poetry.org/) to manage your dependencies. + ```pip install poetry``` + +3. Install dependencies. + ```poetry install``` + +[tox](https://tox.readthedocs.io/en/latest/) runs all code linters as its default target. + + +%package help +Summary: Development documents and examples for redisgraph +Provides: python3-redisgraph-doc +%description help +[](https://github.com/RedisGraph/redisgraph-py) +[](https://circleci.com/gh/RedisGraph/redisgraph-py/tree/master) +[](https://badge.fury.io/py/redisgraph) +[](https://github.com/RedisGraph/redisgraph-py/releases/latest) +[](https://codecov.io/gh/RedisGraph/redisgraph-py) +[](https://snyk.io/test/github/RedisGraph/redisgraph-py?targetFile=pyproject.toml) +[](https://lgtm.com/projects/g/RedisGraph/redisgraph-py/alerts/) + +# redisgraph-py +[](https://forum.redis.com/c/modules/redisgraph) +[](https://discord.gg/gWBRT6P) + +RedisGraph python client + + +## Example: Using the Python Client + +```python +import redis +from redisgraph import Node, Edge, Graph, Path + +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() + +# Use parameters +params = {'purpose':"pleasure"} +query = """MATCH (p:person)-[v:visited {purpose:$purpose}]->(c:country) + RETURN p.name, p.age, v.purpose, c.name""" + +result = redis_graph.query(query, params) + +# Print resultset +result.pretty_print() + +# Use query timeout to raise an exception if the query takes over 10 milliseconds +result = redis_graph.query(query, params, timeout=10) + +# Iterate through resultset +for record in result.result_set: + person_name = record[0] + person_age = record[1] + visit_purpose = record[2] + country_name = record[3] + +query = """MATCH p = (:person)-[:visited {purpose:"pleasure"}]->(:country) RETURN p""" + +result = redis_graph.query(query) + +# Iterate through resultset +for record in result.result_set: + path = record[0] + print(path) + + +# All done, remove graph. +redis_graph.delete() +``` + +## Installing + +### Install official release + +``` +pip install redisgraph +``` +### Install latest release (Aligned with RedisGraph master) + +``` +pip install git+https://github.com/RedisGraph/redisgraph-py.git@master +``` + +### Install for development in env + +1. Create a virtualenv to manage your python dependencies, and ensure it's active. + ```virtualenv -v venv; source venv/bin/activate``` + +2. Install [pypoetry](https://python-poetry.org/) to manage your dependencies. + ```pip install poetry``` + +3. Install dependencies. + ```poetry install``` + +[tox](https://tox.readthedocs.io/en/latest/) runs all code linters as its default target. + + +%prep +%autosetup -n redisgraph-2.4.4 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-redisgraph -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Tue Apr 11 2023 Python_Bot <Python_Bot@openeuler.org> - 2.4.4-1 +- Package Spec generated @@ -0,0 +1 @@ +a844b4118b2da6a3dda16d1f7c2fb974 redisgraph-2.4.4.tar.gz |