Skip to main content

Query NetworkX graphs using openCypher syntax.

Project description

nxCypher

License: Apache 2.0

nxCypher is an openCypher graph query language implementation written in Python, for Python data structures. Originally forked from GrandCypher.

pip install nxcypher

You likely already know openCypher from the Neo4j Graph Database. Use it with your favorite graph libraries in Python!

Usage

Example Usage with NetworkX:

from nxcypher import NXCypher
import networkx as nx

NXCypher(nx.karate_club_graph()).run("""
MATCH (A)-[]->(B)
MATCH (B)-[]->(C)
WHERE A.club == "Mr. Hi"
RETURN A.club, B.club
""")

See examples.md for more!

Feature Parity

Feature Support
Multiple MATCH clauses
WHERE-clause filtering on nodes
Anonymous -[]- edges
LIMIT
SKIP
Node/edge attributes with {} syntax
WHERE-clause filtering on edges
Named -[]- edges
Chained ()-[]->()-[]->() edges
Backwards ()<-[]-() edges
Anonymous () nodes
Undirected ()-[]-() edges
Boolean Arithmetic (AND/OR)
(:Type) node-labels
[:Type] edge-labels
DISTINCT
ORDER BY
IN
Aggregation functions (COUNT, SUM, MIN, MAX, AVG)
COUNT(*) aggregate
DISTINCT in aggregates (COUNT(DISTINCT x))
COLLECT() aggregation
Aliasing of returned entities (return X as Y)
Negated edges (WHERE NOT (a)-->(b))
OPTIONAL MATCH
Multiple independent OPTIONAL MATCH
WITH clause
UNWIND clause
Graph mutations (CREATE, SET, DELETE, DETACH DELETE)
REMOVE clause
MERGE clause with ON CREATE/ON MATCH
String functions (toLower, toUpper, trim)
List functions (size, head, tail)
Type functions (type, labels, keys)
CASE expressions (searched and simple)
UNION / UNION ALL
List comprehensions
✅ = Supported 🛣 = On Roadmap 🥺 = Help Welcome 🔴 = Not Planned

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines, including the DCO sign-off requirement.

License

nxCypher is licensed under the Apache License 2.0.

This project implements the openCypher query language. Cypher is a registered trademark of Neo4j, Inc. This project is not affiliated with or endorsed by Neo4j, Inc.

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

nxcypher-1.0.1.tar.gz (113.4 kB view details)

Uploaded Source

Built Distribution

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

nxcypher-1.0.1-py3-none-any.whl (105.8 kB view details)

Uploaded Python 3

File details

Details for the file nxcypher-1.0.1.tar.gz.

File metadata

  • Download URL: nxcypher-1.0.1.tar.gz
  • Upload date:
  • Size: 113.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.20

File hashes

Hashes for nxcypher-1.0.1.tar.gz
Algorithm Hash digest
SHA256 8cebb463c1863ba32bbeb9deb240dfaafcc737214a0abd3d59baf38e5ae50203
MD5 a922d31cd57ff3256b41dd817407a1da
BLAKE2b-256 6627c5980cb0d8af094eaaa33dd2e264e932f18b3bec66c0b43aa3e591250ad9

See more details on using hashes here.

File details

Details for the file nxcypher-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: nxcypher-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 105.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.20

File hashes

Hashes for nxcypher-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 03308e32a6114b972466372bc82094351b3a7a4905c189cff213c149ead274a2
MD5 7ab9a6cda03ced2ddb3d0a4f3c4380e9
BLAKE2b-256 7eef5cbc01be578f4afc26970624f101099cbd1fb47c59f12ce52a2db13edbd7

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