{"id":13656085,"url":"https://github.com/aplbrain/grand-cypher","last_synced_at":"2025-10-12T08:15:31.156Z","repository":{"id":46230834,"uuid":"312432103","full_name":"aplbrain/grand-cypher","owner":"aplbrain","description":"Implementation of the Cypher language for searching NetworkX graphs","archived":false,"fork":false,"pushed_at":"2025-09-23T15:53:47.000Z","size":141,"stargazers_count":120,"open_issues_count":12,"forks_count":15,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-10-07T04:13:51.679Z","etag":null,"topics":["cypher","grand","graph","graph-database","neo4j","networks","networkx","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aplbrain.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-11-13T00:39:26.000Z","updated_at":"2025-10-04T20:56:19.000Z","dependencies_parsed_at":"2023-02-02T20:46:06.371Z","dependency_job_id":"6f640e92-d41b-4225-bac6-e35c6ee0a872","html_url":"https://github.com/aplbrain/grand-cypher","commit_stats":{"total_commits":62,"total_committers":5,"mean_commits":12.4,"dds":0.6612903225806452,"last_synced_commit":"af754de6e65a03dd4c0d3a6e084e175f5c26b756"},"previous_names":["aplbrain/grandcypher"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/aplbrain/grand-cypher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aplbrain%2Fgrand-cypher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aplbrain%2Fgrand-cypher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aplbrain%2Fgrand-cypher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aplbrain%2Fgrand-cypher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aplbrain","download_url":"https://codeload.github.com/aplbrain/grand-cypher/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aplbrain%2Fgrand-cypher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010802,"owners_count":26084807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cypher","grand","graph","graph-database","neo4j","networks","networkx","python"],"created_at":"2024-08-02T04:00:49.440Z","updated_at":"2025-10-12T08:15:31.127Z","avatar_url":"https://github.com/aplbrain.png","language":"Python","funding_links":[],"categories":["Query engines"],"sub_categories":[],"readme":"\u003ch1 align=center\u003eGrandCypher\u003c/h1\u003e\n\u003cdiv align=center\u003e\u003cimg src=\"https://img.shields.io/pypi/v/grand-cypher?style=for-the-badge\" /\u003e \u003cimg alt=\"GitHub Workflow Status (branch)\" src=\"https://img.shields.io/github/actions/workflow/status/aplbrain/grand-cypher/python-package.yml?branch=master\u0026style=for-the-badge\"\u003e\u003c/div\u003e\n\n```shell\npip install grand-cypher\n# Note: You will want a version of grandiso\u003e=2.2.0 for best performance!\n# pip install -U 'grandiso\u003e=2.2.0'\n```\n\nGrandCypher is a partial (and growing!) implementation of the Cypher graph query language written in Python, for Python data structures.\n\nYou likely already know Cypher from the Neo4j Graph Database. Use it with your favorite graph libraries in Python!\n\n## Usage\n\n### Example Usage with NetworkX:\n\n```python\nfrom grandcypher import GrandCypher\nimport networkx as nx\n\nGrandCypher(nx.karate_club_graph()).run(\"\"\"\nMATCH (A)-[]-\u003e(B)\nMATCH (B)-[]-\u003e(C)\nWHERE A.club == \"Mr. Hi\"\nRETURN A.club, B.club\n\"\"\")\n```\n\nSee [examples.md](docs/examples.md) for more!\n\n### Example Usage with SQL\n\nCreate your own \"Sqlite for Neo4j\"! This example uses [grand-graph](https://github.com/aplbrain/grand) to run queries in SQL:\n\n```python\nimport grand\nfrom grandcypher import GrandCypher\n\nG = grand.Graph(\n    backend=grand.backends.SQLBackend(\n        db_url=\"my_persisted_graph.db\",\n        directed=True\n    )\n)\n\n# use the networkx-style API for the Grand library:\nG.nx.add_node(\"A\", foo=\"bar\")\nG.nx.add_edge(\"A\", \"B\")\nG.nx.add_edge(\"B\", \"C\")\nG.nx.add_edge(\"C\", \"A\")\n\nGrandCypher(G.nx).run(\"\"\"\nMATCH (A)-[]-\u003e(B)-[]-\u003e(C)\nMATCH (C)-[]-\u003e(A)\nWHERE\n    A.foo == \"bar\"\nRETURN\n    A, B, C\n\"\"\")\n```\n\n# Feature Parity\n\n| Feature                                                     | Support                   |\n| ----------------------------------------------------------- | ------------------------- |\n| Multiple `MATCH` clauses                                    | ✅                        |\n| `WHERE`-clause filtering on nodes                           | ✅                        |\n| Anonymous `-[]-` edges                                      | ✅                        |\n| `LIMIT`                                                     | ✅                        |\n| `SKIP`                                                      | ✅                        |\n| Node/edge attributes with `{}` syntax                       | ✅                        |\n| `WHERE`-clause filtering on edges                           | ✅                        |\n| Named `-[]-` edges                                          | ✅                        |\n| Chained `()-[]-\u003e()-[]-\u003e()` edges                            | ✅ Thanks @khoale88!      |\n| Backwards `()\u003c-[]-()` edges                                 | ✅ Thanks @khoale88!      |\n| Anonymous `()` nodes                                        | ✅ Thanks @khoale88!      |\n| Undirected `()-[]-()` edges                                 | ✅ Thanks @khoale88!      |\n| Boolean Arithmetic (`AND`/`OR`)                             | ✅ Thanks @khoale88!      |\n| `(:Type)` node-labels                                       | ✅ Thanks @khoale88!      |\n| `[:Type]` edge-labels                                       | ✅ Thanks @khoale88!      |\n| `DISTINCT`                                                  | ✅ Thanks @jackboyla!     |\n| `ORDER BY`                                                  | ✅ Thanks @jackboyla!     |\n| `IN`                                                        | ✅ Thanks @davidmezzetti! |\n| Aggregation functions (`COUNT`, `SUM`, `MIN`, `MAX`, `AVG`) | ✅ Thanks @jackboyla!     |\n| Aliasing of returned entities (`return X as Y`)             | ✅ Thanks @jackboyla!     |\n| Negated edges (`where not (a)--\u003e(b)`)                       | 🥺                        |\n| `OPTIONAL MATCH`                                            | 🥺                        |\n| Graph mutations (e.g. `DELETE`, `SET`,...)                  | 🥺                        |\n\n|                |                |                   |                  |\n| -------------- | -------------- | ----------------- | ---------------- |\n| ✅ = Supported | 🛣 = On Roadmap | 🥺 = Help Welcome | 🔴 = Not Planned |\n\n## Citing\n\nIf this tool is helpful to your research, please consider citing it with:\n\n```bibtex\n# https://doi.org/10.1038/s41598-021-91025-5\n@article{Matelsky_Motifs_2021,\n    title={{DotMotif: an open-source tool for connectome subgraph isomorphism search and graph queries}},\n    volume={11},\n    ISSN={2045-2322},\n    url={http://dx.doi.org/10.1038/s41598-021-91025-5},\n    DOI={10.1038/s41598-021-91025-5},\n    number={1},\n    journal={Scientific Reports},\n    publisher={Springer Science and Business Media LLC},\n    author={Matelsky, Jordan K. and Reilly, Elizabeth P. and Johnson, Erik C. and Stiso, Jennifer and Bassett, Danielle S. and Wester, Brock A. and Gray-Roncal, William},\n    year={2021},\n    month={Jun}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faplbrain%2Fgrand-cypher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faplbrain%2Fgrand-cypher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faplbrain%2Fgrand-cypher/lists"}