Dict2Cypher
Convert Python dicts into Neo4j Cypher queries easily and safely.
This library allows you to build Cypher queries from Python dictionaries and lists without ever executing them. Perfect for generating, testing, and templating Neo4j queries.
Features
- Create, Merge, Delete nodes and relationships
- Match complex paths
- Bulk operations
- Traversals with depth
- WHERE and filters as strings
- Auto-generated or custom aliases
- Indexes and constraints generation
- Only string output, no Neo4j execution
Installation
pip install dict2cypher
Usage
from dict2cypher import Dict2Cypher
# Simple MATCH
q = Dict2Cypher.match({"Person#p": {"name": "Alice"}}).return_("p")
print(q.cypher())
# MATCH (p:Person {name: 'Alice'}) RETURN p
# Create Node + Relationship
nodes = [{"Person#p": {"name": "Alice"}}, {"Person#q": {"name": "Bob"}}]
rel = {"KNOWS#k": {"from": "p", "to": "q", "since": 2020}}
q = Dict2Cypher.create(nodes + [rel])
print(q.cypher())
# CREATE (p:Person {name: 'Alice'})
# CREATE (q:Person {name: 'Bob'})
# CREATE (p)-[k:KNOWS {since: 2020}]->(q)
Why Use Dict2Cypher?
- Generates Cypher queries safely from Python structures
- Works with complex paths, relationships, and filters
- Useful for testing, templating, or building query builders
- Keeps your logic in Python, Cypher as pure output
Metadata
Release files for dict2cypher 20
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dict2cypher-20.tar.gz | 3.5 kB | Without provenance | Details for dict2cypher-20.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dict2cypher-20-py3-none-any.whl | Python 3 | none | any | Details for dict2cypher-20-py3-none-any.whl |
Total release size: 6.7 kB
Release files / dict2cypher-20.tar.gz
| Download URL | dict2cypher-20.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
73c55f5c1e437524b1bb2668ef3d4dddb423994c22ba52f703bf167a18dcc88a
|
|
BLAKE2b-256 checksum How to use checksums |
e3d081f82ade8a337c1c6afefe0c365752414c987c6cd9ce8ac9ebce6963eb52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.23
|
Release files / dict2cypher-20-py3-none-any.whl
| Download URL | dict2cypher-20-py3-none-any.whl |
|---|---|
| Size | 3.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
722ba77de7ab6e4fc927ceb55a184f185a6de5ee26cc4ca24f3fbed0a616dec4
|
|
BLAKE2b-256 checksum How to use checksums |
430b791369129d411cc22700d3282d3dcd22b22edda725b7852b2aaae4feb3ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.23
|
Security for dict2cypher 20
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.