Skip to main content

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 returned BoltResultSet and return it as an object
  • get_all(): treat the BoltResultSet 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


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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neo4j_marshaller-0.0.1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

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

Hashes for neo4j_marshaller-0.0.1.tar.gz
Algorithm Hash digest
SHA256 1cb61ab50ea67961ab0357c2404058c7cc3708a22386e8bd8bef11ded953d44a
MD5 6062f4c449c29946857d759ba6002634
BLAKE2b-256 b37caa58526bd3088e672498e70e23006e8a6619799721e91c8dc1154e8e94ec

See more details on using hashes here.

File details

Details for the file neo4j_marshaller-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for neo4j_marshaller-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5af22851dbb5cf9438397fec8102e6636c1d23e1d441d4b4447df6692012fefb
MD5 dcbcce363da06847a7a185de785acf42
BLAKE2b-256 9c12a192722f4214843931d0d4a4588e6ff9f4877d225300c23e56232d554ff6

See more details on using hashes here.

Supported by

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