Skip to content
Back to search

neo4j-python-pandas-py2neo-v3

Excel-to-Neo4j knowledge graph examples: legacy py2neo v3 plus modern Neo4j GraphRAG/vector search.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/mazzawill-neo4j-python-pandas-py2neo-v3/badge.svg)](/listings/mazzawill-neo4j-python-pandas-py2neo-v3)

HTML

<a href="/listings/mazzawill-neo4j-python-pandas-py2neo-v3"><img src="/api/listings/mazzawill-neo4j-python-pandas-py2neo-v3/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Install dependencies:

pip install -r requirements.txt

The repository includes `Invoice_data_Demo.xls` as sample data.

Before running `invoice_neo4j.py`, update the local path and Neo4j connection settings:

- Replace `os.chdir('xxxx')` with this repository path, or run the script from the repository root. - Replace the placeholder `Graph(...)` connection in `dataToNeo4jClass/DataToNeo4jClass.py` with your Neo4j server URL and credentials.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 160 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Excel to Neo4j Knowledge Graph
  2. [![Release](https://img.shields.io/github/v/release/MazzaWill/neo4j-python-pandas-py2neo-v3)](https://github.com/MazzaWill/neo4j-python-pandas-py2neo-v3/releases)
  3. [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
  4. [![Maintenance](https://img.shields.io/badge/maintenance-active-brightgreen.svg)](https://github.com/MazzaWill/neo4j-python-pandas-py2neo-v3/issues/23)
  5. English | [Simplified Chinese](README.zh-CN.md)
  6. Excel-to-Neo4j examples for building knowledge graphs: a legacy py2neo v3 path for the original educational project, plus a modern Neo4j GraphRAG/vector-search path for current applications.
  7. Legacy repository slug: `neo4j-python-pandas-py2neo-v3`.
  8. ![](https://s1.ax1x.com/2018/11/13/iObQkn.png)
  9. ## Maintenance Status
  10. This project is maintained again as of 2026-06. The current goal is to keep the original py2neo v3 / Neo4j 3.x example usable for learners, notebooks, and legacy projects while adding a current Neo4j driver, vector index, and GraphRAG example.
  11. This repository is intentionally maintained as a legacy educational example. Modern Python, pandas, Neo4j, and py2neo versions may require code changes; modernization work is tracked separately so the legacy baseline remains clear.
  12. ## What This Project Does
  13. - Reads invoice-style Excel data with pandas.
  14. - Extracts node data and relationship data from the spreadsheet.
  15. - Creates Neo4j nodes and relationships through py2neo v3.
  16. - Converts Neo4j graph data into matrices for downstream machine learning experiments.
  17. ## Modern Neo4j Example
  18. The repository now includes a modern, additive example at [`examples/modern_invoice_graphrag/`](examples/modern_invoice_graphrag/).
  19. It keeps the original invoice dataset concept but uses the current Neo4j application stack:
  20. - official `neo4j` Python driver
  21. - Neo4j 5+/2026 vector indexes
  22. - GraphRAG-style semantic retrieval
  23. - optional `neo4j-graphrag` production embeddings
  24. - local deterministic embeddings for keyless demos and CI
  25. Start with:
  26. ```bash
  27. python -m examples.modern_invoice_graphrag.app \
  28. --input examples/modern_invoice_graphrag/sample_invoice_rows.csv \
  29. --limit 2 \
  30. dry-run
  31. ```
  32. ## Open Source Skill
  33. The repository also includes an open-source Codex/agent skill at [`skills/neo4j-knowledge-graph/`](skills/neo4j-knowledge-graph/).
  34. Use it when an AI coding agent needs to design a Neo4j knowledge graph from CSV/Excel data, generate safe Cypher, choose between legacy py2neo and the official Neo4j driver, or add GraphRAG/vector-search behavior. The skill includes a reusable `profile_table.py` script for inspecting tabular data before graph modeling.
  35. ## Compatibility
  36. The original working environment was:
  37. - Python 3.6.5
  38. - Windows 10
  39. - Neo4j 3.x
  40. - py2neo 3
  41. The pinned dependencies in `requirements.txt` are intentionally legacy. Dependency and security modernization is tracked in [issue #23](https://github.com/MazzaWill/neo4j-python-pandas-py2neo-v3/issues/23).
  42. ## Quick Start
  43. Install dependencies:
  44. ```bash
  45. pip install -r requirements.txt
  46. ```
  47. The repository includes `Invoice_data_Demo.xls` as sample data.
  48. Before running `invoice_neo4j.py`, update the local path and Neo4j connection settings:
  49. - Replace `os.chdir('xxxx')` with this repository path, or run the script from the repository root.
  50. - Replace the placeholder `Graph(...)` connection in `dataToNeo4jClass/DataToNeo4jClass.py` with your Neo4j server URL and credentials.
  51. ## Project Structure
  52. - `invoice_neo4j.py`: reads the Excel file, extracts node and relationship data, and writes to Neo4j.
  53. - `dataToNeo4jClass/DataToNeo4jClass.py`: wraps Neo4j node and relationship creation.
  54. - `neo4j_matrix.py`: extracts Neo4j relationship data and converts it into matrix form.
  55. - `Invoice_data_Demo.xls`: demo Excel data for local testing and learning.
  56. - `requirements.txt`: legacy dependency pins for the original py2neo v3 environment.
  57. - `.github/ISSUE_TEMPLATE/`: issue templates for bugs, compatibility questions, and sample-data requests.
  58. ## Neo4j Knowledge Graph Construction
  59. ### 1. Running Environment
  60. For package dependencies, refer to `requirements.txt`.
  61. ### 2. Extracting Excel Data With Pandas
  62. The Excel data structure is as follows:
  63. <img src="https://s1.ax1x.com/2018/11/13/iObTc8.png" width="800" hegiht="500" align=center />
  64. The `data_extraction` and `relation_extraction` functions extract the node data and relationship data required for building the knowledge graph.
  65. `invoice_neo4j.py`
  66. <img src="https://s1.ax1x.com/2018/11/13/iOb4ht.png" width="500" hegiht="313" align=center />
  67. ### 3. Creating Nodes And Edges
  68. `DataToNeo4jClass.py`
  69. <img src="https://s1.ax1x.com/2018/11/13/iXk6iV.png" width="500" hegiht="313" align=center />
  70. `neo4j_matrix.py` extracts knowledge graph data and converts it into matrices for machine learning models.
  71. ## Roadmap
  72. ### v0.2.x - Restore Maintenance
  73. - Triage historical issues and close resolved sample-data questions.
  74. - Document the known working legacy environment.
  75. - Add clearer setup notes for Windows, local paths, Neo4j credentials, and sample data.
  76. - Publish maintenance restart releases.
  77. ### v0.3.x - Reproducible Examples
  78. - Ship a modern Neo4j GraphRAG/vector-search invoice example.
  79. - Replace hard-coded local paths with configurable arguments.
  80. - Add smoke tests for Excel extraction and relationship DataFrame generation.
  81. - Improve issue templates based on new bug reports.
  82. ### v0.4.x - Modern Compatibility
  83. - Evaluate support for newer Python and pandas versions.
  84. - Document the migration path from py2neo v3 to newer Neo4j Python tooling.
  85. - Add CI checks for the supported legacy environment where practical.
  86. ## Issue Triage
  87. New and historical issues are being reviewed in batches. When opening an issue, please include:
  88. - Python version
  89. - Neo4j version
  90. - py2neo version
  91. - operating system
  92. - the command you ran
  93. - the full error message or screenshot
  94. For sample data questions, use the included `Invoice_data_Demo.xls` file first.
  95. ## Project Governance
  96. - License: [MIT](LICENSE)
  97. - Contributing guide: [CONTRIBUTING.md](CONTRIBUTING.md)
  98. - Security policy: [SECURITY.md](SECURITY.md)
  99. - Support policy: [SUPPORT.md](SUPPORT.md)
  100. - Code of conduct: [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)
  101. - Pull request template: [.github/PULL_REQUEST_TEMPLATE.md](.github/PULL_REQUEST_TEMPLATE.md)
  102. Repository maintenance is tracked publicly through issues and releases.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.