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
BoltResultSetin-order to use the results - easily supply named parameters in the Cypher Query
get_one(): pick one row from returnedBoltResultSetand return it as an objectget_all(): treat theBoltResultSetand 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file neo4j_marshaller-0.0.1.tar.gz.
File metadata
- Download URL: neo4j_marshaller-0.0.1.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1cb61ab50ea67961ab0357c2404058c7cc3708a22386e8bd8bef11ded953d44a
|
|
| MD5 |
6062f4c449c29946857d759ba6002634
|
|
| BLAKE2b-256 |
b37caa58526bd3088e672498e70e23006e8a6619799721e91c8dc1154e8e94ec
|
File details
Details for the file neo4j_marshaller-0.0.1-py3-none-any.whl.
File metadata
- Download URL: neo4j_marshaller-0.0.1-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5af22851dbb5cf9438397fec8102e6636c1d23e1d441d4b4447df6692012fefb
|
|
| MD5 |
dcbcce363da06847a7a185de785acf42
|
|
| BLAKE2b-256 |
9c12a192722f4214843931d0d4a4588e6ff9f4877d225300c23e56232d554ff6
|