pyneoinstance 3.0.0__tar.gz → 4.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/MANIFEST.in +1 -1
- {pyneoinstance-3.0.0/pyneoinstance.egg-info → pyneoinstance-4.0.0}/PKG-INFO +62 -22
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/README.md +45 -13
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/pyneoinstance/__init__.py +2 -1
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/pyneoinstance/database/context.py +1 -1
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/pyneoinstance/database/neo4jdbms.py +186 -249
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/pyneoinstance/fileload/helpers.py +3 -3
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/pyneoinstance/fileload/loadyaml.py +1 -1
- pyneoinstance-4.0.0/pyneoinstance/py.typed +0 -0
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/pyneoinstance/util/__init__.py +1 -0
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/pyneoinstance/util/functions.py +10 -16
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0/pyneoinstance.egg-info}/PKG-INFO +62 -22
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/pyneoinstance.egg-info/SOURCES.txt +1 -1
- pyneoinstance-4.0.0/pyneoinstance.egg-info/requires.txt +8 -0
- pyneoinstance-4.0.0/pyneoinstance.egg-info/top_level.txt +5 -0
- pyneoinstance-4.0.0/pyproject.toml +43 -0
- pyneoinstance-4.0.0/setup.py +5 -0
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/test/context.py +1 -1
- pyneoinstance-4.0.0/test/test_neo4jdb.py +237 -0
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/test/test_util_functions.py +12 -2
- pyneoinstance-3.0.0/pyneoinstance/fileload/context.py +0 -6
- pyneoinstance-3.0.0/pyneoinstance.egg-info/requires.txt +0 -4
- pyneoinstance-3.0.0/pyneoinstance.egg-info/top_level.txt +0 -2
- pyneoinstance-3.0.0/pyproject.toml +0 -26
- pyneoinstance-3.0.0/setup.py +0 -5
- pyneoinstance-3.0.0/test/test_neo4jdb.py +0 -202
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/LICENSE +0 -0
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/pyneoinstance/database/__init__.py +0 -0
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/pyneoinstance/fileload/__init__.py +0 -0
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/pyneoinstance.egg-info/dependency_links.txt +0 -0
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/setup.cfg +0 -0
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/test/__init__.py +0 -0
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/test/age_data.csv +0 -0
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/test/cypher_queries.yaml +0 -0
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/test/load_files.yaml +0 -0
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/test/movies.csv +0 -0
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/test/people.csv +0 -0
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/test/roles.csv +0 -0
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/test/test.py +0 -0
- {pyneoinstance-3.0.0 → pyneoinstance-4.0.0}/test/test_fileload.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyneoinstance
|
|
3
|
-
Version:
|
|
4
|
-
Summary: Handle Neo4j read and write transactions and provide
|
|
3
|
+
Version: 4.0.0
|
|
4
|
+
Summary: Handle Neo4j read and write transactions and provide methods for performing graph EDA
|
|
5
5
|
Author-email: "Jose A. Alvarado-Guzman" <jose.alvarado-guzman@neo4j.com>
|
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
|
7
7
|
Version 3, 29 June 2007
|
|
@@ -678,21 +678,34 @@ License: GNU GENERAL PUBLIC LICENSE
|
|
|
678
678
|
Public License instead of this License. But first, please read
|
|
679
679
|
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
|
680
680
|
|
|
681
|
+
Project-URL: Repository, https://github.com/jose-alvarado-guzman/pyneoingest
|
|
682
|
+
Project-URL: Documentation, https://jose-alvarado-guzman.github.io/pyneoingest/
|
|
681
683
|
Keywords: neo4j,graph,cypher
|
|
682
|
-
Classifier: License :: OSI Approved :: GNU General Public License (
|
|
684
|
+
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
683
685
|
Classifier: Programming Language :: Python :: 3
|
|
684
|
-
Classifier:
|
|
685
|
-
|
|
686
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
687
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
688
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
689
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
690
|
+
Requires-Python: >=3.10
|
|
686
691
|
Description-Content-Type: text/markdown
|
|
687
692
|
License-File: LICENSE
|
|
688
|
-
Requires-Dist: neo4j>=5.0.0
|
|
689
|
-
Requires-Dist: pandas
|
|
690
|
-
Requires-Dist: PyYAML
|
|
691
|
-
Requires-Dist: pyvis
|
|
693
|
+
Requires-Dist: neo4j-rust-ext>=5.0.0
|
|
694
|
+
Requires-Dist: pandas>=1.3.0
|
|
695
|
+
Requires-Dist: PyYAML>=5.1
|
|
696
|
+
Requires-Dist: pyvis>=0.3.0
|
|
697
|
+
Requires-Dist: neo4j-viz>=0.5.0
|
|
698
|
+
Provides-Extra: docs
|
|
699
|
+
Requires-Dist: mkdocs-material>=9.0.0; extra == "docs"
|
|
692
700
|
Dynamic: license-file
|
|
693
701
|
|
|
694
702
|
# PyNeoInstance Package
|
|
695
703
|
|
|
704
|
+
<table>
|
|
705
|
+
<tr>
|
|
706
|
+
<td><img src="https://raw.githubusercontent.com/jose-alvarado-guzman/pyneoingest/main/images/PyNeoInstanceLogo.png" alt="PyNeoInstance Logo" width="300"></td>
|
|
707
|
+
<td valign="top">
|
|
708
|
+
|
|
696
709
|
## What is it?
|
|
697
710
|
|
|
698
711
|
PyNeoInstance is a Python package that provides a user friendly API for submitting Cypher queries to Neo4j and performing Exploratory Data Analysis (EDA) of your graph.
|
|
@@ -712,14 +725,25 @@ It supports the following features:
|
|
|
712
725
|
- __<u>Constraints</u>__: Get information of all constraints in the graph.
|
|
713
726
|
- __<u>Indexes</u>__: Get information of all indexes in the graph.
|
|
714
727
|
- __<u>Schema Visualization</u>__: Visualize the graph schema.
|
|
728
|
+
- __<u>Query Graph Visualization</u>__: Visualize the result of a Cypher query as an interactive graph.
|
|
729
|
+
|
|
730
|
+
</td>
|
|
731
|
+
</tr>
|
|
732
|
+
</table>
|
|
733
|
+
|
|
715
734
|
|
|
735
|
+
## Documentation
|
|
736
|
+
|
|
737
|
+
Full documentation is available at **https://jose-alvarado-guzman.github.io/pyneoingest/**
|
|
716
738
|
|
|
717
739
|
## How to install it?
|
|
718
740
|
|
|
719
|
-
```
|
|
741
|
+
```bash
|
|
720
742
|
pip install pyneoinstance
|
|
721
743
|
```
|
|
722
744
|
|
|
745
|
+
The Rust-accelerated Neo4j driver (`neo4j-rust-ext`) is included by default for faster data serialization.
|
|
746
|
+
|
|
723
747
|
## How to use it?
|
|
724
748
|
|
|
725
749
|
### Instantiating the Neo4jInstance class
|
|
@@ -801,7 +825,7 @@ query = """
|
|
|
801
825
|
m.tagline AS tagline;
|
|
802
826
|
"""
|
|
803
827
|
|
|
804
|
-
data = graph.execute_read_query(query, db_info['database'],
|
|
828
|
+
data = graph.execute_read_query(query, db_info['database'], parameters={'movie_title':'The Matrix'})
|
|
805
829
|
```
|
|
806
830
|
|
|
807
831
|
### Submitting a Cypher write query
|
|
@@ -818,9 +842,9 @@ query = """
|
|
|
818
842
|
|
|
819
843
|
results = graph.execute_write_query(query, db_info['database'],
|
|
820
844
|
parameters={
|
|
821
|
-
'movie_title':'Wakanda Forever',
|
|
822
|
-
'year'
|
|
823
|
-
tagline
|
|
845
|
+
'movie_title': 'Wakanda Forever',
|
|
846
|
+
'year': 2022,
|
|
847
|
+
'tagline': 'Wakanda Forever! Long Live Wakanda! For Honor, For Legacy, For Wakanda!'
|
|
824
848
|
})
|
|
825
849
|
```
|
|
826
850
|
|
|
@@ -959,7 +983,7 @@ graph.get_rela_type_freq(database='mydbname')
|
|
|
959
983
|
### Properties
|
|
960
984
|
The get_properties method provides information about all the nodes and relationships properties.
|
|
961
985
|
```python
|
|
962
|
-
graph.
|
|
986
|
+
graph.get_properties(database='mydbname')
|
|
963
987
|
```
|
|
964
988
|
<img src="https://s3.amazonaws.com/neo4j-ps-ds-bootcamp/img/properties.png" width="350" hight="300">
|
|
965
989
|
|
|
@@ -977,21 +1001,37 @@ graph.get_indexes(database='mydbname')
|
|
|
977
1001
|
```
|
|
978
1002
|
<img src="https://s3.amazonaws.com/neo4j-ps-ds-bootcamp/img/indexes.png" width="450" hight="400">
|
|
979
1003
|
|
|
980
|
-
###
|
|
981
|
-
The
|
|
1004
|
+
### Query Graph Visualization
|
|
1005
|
+
The `get_query_visualization` method executes a Cypher query that returns nodes and relationships and renders the result as an interactive graph. Node labels are displayed as captions and all properties appear as tooltips on hover.
|
|
982
1006
|
|
|
983
1007
|
```python
|
|
984
|
-
|
|
985
|
-
|
|
1008
|
+
query = """
|
|
1009
|
+
MATCH (p:Person)-[r:ACTED_IN]->(m:Movie)
|
|
1010
|
+
RETURN p, r, m
|
|
1011
|
+
LIMIT 50
|
|
1012
|
+
"""
|
|
1013
|
+
vg = graph.get_query_visualization(query, database='mydbname')
|
|
1014
|
+
|
|
1015
|
+
# In a Jupyter notebook — renders inline:
|
|
1016
|
+
vg.render()
|
|
1017
|
+
|
|
1018
|
+
# As a standalone HTML file:
|
|
1019
|
+
with open('graph.html', 'w') as f:
|
|
1020
|
+
f.write(f'<!DOCTYPE html><html><body>{vg.render().data}</body></html>')
|
|
986
1021
|
```
|
|
987
|
-
<img src="https://
|
|
1022
|
+
<img src="https://raw.githubusercontent.com/jose-alvarado-guzman/pyneoingest/main/images/query_visualization.png" alt="Query Graph Visualization" width="600">
|
|
988
1023
|
|
|
989
|
-
|
|
1024
|
+
### Schema Visualization
|
|
1025
|
+
The `get_schema_visualization` method provides an interactive visualization of the graph schema with the ability to filter by label. Node labels are displayed as strings next to nodes; relationship types are shown on mouse hover.
|
|
990
1026
|
|
|
991
1027
|
```python
|
|
992
1028
|
schema = graph.get_schema_visualization(database='mydbname')
|
|
993
|
-
schema.
|
|
1029
|
+
schema.write_html('schema.html')
|
|
994
1030
|
```
|
|
1031
|
+
|
|
1032
|
+
Open `schema.html` in your browser to explore the schema interactively.
|
|
1033
|
+
|
|
1034
|
+
<img src="https://s3.amazonaws.com/neo4j-ps-ds-bootcamp/img/schema.png" width="450" hight="400">
|
|
995
1035
|
<img src="https://s3.amazonaws.com/neo4j-ps-ds-bootcamp/img/schemaHtml.png" width="450" hight="400">
|
|
996
1036
|
|
|
997
1037
|
## More detailed examples
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# PyNeoInstance Package
|
|
2
2
|
|
|
3
|
+
<table>
|
|
4
|
+
<tr>
|
|
5
|
+
<td><img src="https://raw.githubusercontent.com/jose-alvarado-guzman/pyneoingest/main/images/PyNeoInstanceLogo.png" alt="PyNeoInstance Logo" width="300"></td>
|
|
6
|
+
<td valign="top">
|
|
7
|
+
|
|
3
8
|
## What is it?
|
|
4
9
|
|
|
5
10
|
PyNeoInstance is a Python package that provides a user friendly API for submitting Cypher queries to Neo4j and performing Exploratory Data Analysis (EDA) of your graph.
|
|
@@ -19,14 +24,25 @@ It supports the following features:
|
|
|
19
24
|
- __<u>Constraints</u>__: Get information of all constraints in the graph.
|
|
20
25
|
- __<u>Indexes</u>__: Get information of all indexes in the graph.
|
|
21
26
|
- __<u>Schema Visualization</u>__: Visualize the graph schema.
|
|
27
|
+
- __<u>Query Graph Visualization</u>__: Visualize the result of a Cypher query as an interactive graph.
|
|
28
|
+
|
|
29
|
+
</td>
|
|
30
|
+
</tr>
|
|
31
|
+
</table>
|
|
32
|
+
|
|
22
33
|
|
|
34
|
+
## Documentation
|
|
35
|
+
|
|
36
|
+
Full documentation is available at **https://jose-alvarado-guzman.github.io/pyneoingest/**
|
|
23
37
|
|
|
24
38
|
## How to install it?
|
|
25
39
|
|
|
26
|
-
```
|
|
40
|
+
```bash
|
|
27
41
|
pip install pyneoinstance
|
|
28
42
|
```
|
|
29
43
|
|
|
44
|
+
The Rust-accelerated Neo4j driver (`neo4j-rust-ext`) is included by default for faster data serialization.
|
|
45
|
+
|
|
30
46
|
## How to use it?
|
|
31
47
|
|
|
32
48
|
### Instantiating the Neo4jInstance class
|
|
@@ -108,7 +124,7 @@ query = """
|
|
|
108
124
|
m.tagline AS tagline;
|
|
109
125
|
"""
|
|
110
126
|
|
|
111
|
-
data = graph.execute_read_query(query, db_info['database'],
|
|
127
|
+
data = graph.execute_read_query(query, db_info['database'], parameters={'movie_title':'The Matrix'})
|
|
112
128
|
```
|
|
113
129
|
|
|
114
130
|
### Submitting a Cypher write query
|
|
@@ -125,9 +141,9 @@ query = """
|
|
|
125
141
|
|
|
126
142
|
results = graph.execute_write_query(query, db_info['database'],
|
|
127
143
|
parameters={
|
|
128
|
-
'movie_title':'Wakanda Forever',
|
|
129
|
-
'year'
|
|
130
|
-
tagline
|
|
144
|
+
'movie_title': 'Wakanda Forever',
|
|
145
|
+
'year': 2022,
|
|
146
|
+
'tagline': 'Wakanda Forever! Long Live Wakanda! For Honor, For Legacy, For Wakanda!'
|
|
131
147
|
})
|
|
132
148
|
```
|
|
133
149
|
|
|
@@ -266,7 +282,7 @@ graph.get_rela_type_freq(database='mydbname')
|
|
|
266
282
|
### Properties
|
|
267
283
|
The get_properties method provides information about all the nodes and relationships properties.
|
|
268
284
|
```python
|
|
269
|
-
graph.
|
|
285
|
+
graph.get_properties(database='mydbname')
|
|
270
286
|
```
|
|
271
287
|
<img src="https://s3.amazonaws.com/neo4j-ps-ds-bootcamp/img/properties.png" width="350" hight="300">
|
|
272
288
|
|
|
@@ -284,21 +300,37 @@ graph.get_indexes(database='mydbname')
|
|
|
284
300
|
```
|
|
285
301
|
<img src="https://s3.amazonaws.com/neo4j-ps-ds-bootcamp/img/indexes.png" width="450" hight="400">
|
|
286
302
|
|
|
287
|
-
###
|
|
288
|
-
The
|
|
303
|
+
### Query Graph Visualization
|
|
304
|
+
The `get_query_visualization` method executes a Cypher query that returns nodes and relationships and renders the result as an interactive graph. Node labels are displayed as captions and all properties appear as tooltips on hover.
|
|
289
305
|
|
|
290
306
|
```python
|
|
291
|
-
|
|
292
|
-
|
|
307
|
+
query = """
|
|
308
|
+
MATCH (p:Person)-[r:ACTED_IN]->(m:Movie)
|
|
309
|
+
RETURN p, r, m
|
|
310
|
+
LIMIT 50
|
|
311
|
+
"""
|
|
312
|
+
vg = graph.get_query_visualization(query, database='mydbname')
|
|
313
|
+
|
|
314
|
+
# In a Jupyter notebook — renders inline:
|
|
315
|
+
vg.render()
|
|
316
|
+
|
|
317
|
+
# As a standalone HTML file:
|
|
318
|
+
with open('graph.html', 'w') as f:
|
|
319
|
+
f.write(f'<!DOCTYPE html><html><body>{vg.render().data}</body></html>')
|
|
293
320
|
```
|
|
294
|
-
<img src="https://
|
|
321
|
+
<img src="https://raw.githubusercontent.com/jose-alvarado-guzman/pyneoingest/main/images/query_visualization.png" alt="Query Graph Visualization" width="600">
|
|
295
322
|
|
|
296
|
-
|
|
323
|
+
### Schema Visualization
|
|
324
|
+
The `get_schema_visualization` method provides an interactive visualization of the graph schema with the ability to filter by label. Node labels are displayed as strings next to nodes; relationship types are shown on mouse hover.
|
|
297
325
|
|
|
298
326
|
```python
|
|
299
327
|
schema = graph.get_schema_visualization(database='mydbname')
|
|
300
|
-
schema.
|
|
328
|
+
schema.write_html('schema.html')
|
|
301
329
|
```
|
|
330
|
+
|
|
331
|
+
Open `schema.html` in your browser to explore the schema interactively.
|
|
332
|
+
|
|
333
|
+
<img src="https://s3.amazonaws.com/neo4j-ps-ds-bootcamp/img/schema.png" width="450" hight="400">
|
|
302
334
|
<img src="https://s3.amazonaws.com/neo4j-ps-ds-bootcamp/img/schemaHtml.png" width="450" hight="400">
|
|
303
335
|
|
|
304
336
|
## More detailed examples
|