Simplified Neo4J Cypher Query execution
Project description
neo4j_marshaller
neo4j_marshaller
is a Python library that takes a Cypher Query, executes it, and returns the resultset as a JSON object.
The idea is to
- avoid the boiler-plate code that has to "interpret" the returned
BoltResultSet
in-order to use the results - easily supply named parameters in the Cypher Query
get_one()
: pick one row from returnedBoltResultSet
and return it as an objectget_all()
: treat theBoltResultSet
and return it as an array
Here is the GitHub repo:
Here is the pip command to install it:
pip install neo4j-marshaller
Here’s a simple example of how you might use neo4j_marshaller
:
from neo4j_marshaller import Neo4JMarshallerResource
import json, sys, os
if __name__ == "__main__":
email_address = os.environ['EMAIL_ADDRESS']
cypher_query = """
MATCH (user:ExplUser {name: $username})
RETURN user
"""
with Neo4JMarshallerResource() as nmr:
userJson = nmr.get_one(cypher_query, username=email_address)
json.dump(userJson, indent=2, fp=sys.stdout)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
neo4j_marshaller-0.0.1.tar.gz
(8.1 kB
view hashes)
Built Distribution
Close
Hashes for neo4j_marshaller-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5af22851dbb5cf9438397fec8102e6636c1d23e1d441d4b4447df6692012fefb |
|
MD5 | dcbcce363da06847a7a185de785acf42 |
|
BLAKE2b-256 | 9c12a192722f4214843931d0d4a4588e6ff9f4877d225300c23e56232d554ff6 |