pyneoinstance 3.0.0__tar.gz → 4.0.1__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.
Files changed (40) hide show
  1. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/MANIFEST.in +1 -1
  2. {pyneoinstance-3.0.0/pyneoinstance.egg-info → pyneoinstance-4.0.1}/PKG-INFO +63 -22
  3. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/README.md +45 -13
  4. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/pyneoinstance/__init__.py +2 -1
  5. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/pyneoinstance/database/context.py +1 -1
  6. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/pyneoinstance/database/neo4jdbms.py +180 -250
  7. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/pyneoinstance/fileload/helpers.py +3 -3
  8. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/pyneoinstance/fileload/loadyaml.py +1 -1
  9. pyneoinstance-4.0.1/pyneoinstance/py.typed +0 -0
  10. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/pyneoinstance/util/__init__.py +1 -0
  11. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/pyneoinstance/util/functions.py +10 -16
  12. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1/pyneoinstance.egg-info}/PKG-INFO +63 -22
  13. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/pyneoinstance.egg-info/SOURCES.txt +1 -1
  14. pyneoinstance-4.0.1/pyneoinstance.egg-info/requires.txt +9 -0
  15. pyneoinstance-4.0.1/pyneoinstance.egg-info/top_level.txt +5 -0
  16. pyneoinstance-4.0.1/pyproject.toml +43 -0
  17. pyneoinstance-4.0.1/setup.py +5 -0
  18. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/test/context.py +1 -1
  19. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/test/cypher_queries.yaml +3 -3
  20. pyneoinstance-4.0.1/test/test_neo4jdb.py +237 -0
  21. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/test/test_util_functions.py +13 -3
  22. pyneoinstance-3.0.0/pyneoinstance/fileload/context.py +0 -6
  23. pyneoinstance-3.0.0/pyneoinstance.egg-info/requires.txt +0 -4
  24. pyneoinstance-3.0.0/pyneoinstance.egg-info/top_level.txt +0 -2
  25. pyneoinstance-3.0.0/pyproject.toml +0 -26
  26. pyneoinstance-3.0.0/setup.py +0 -5
  27. pyneoinstance-3.0.0/test/test_neo4jdb.py +0 -202
  28. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/LICENSE +0 -0
  29. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/pyneoinstance/database/__init__.py +0 -0
  30. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/pyneoinstance/fileload/__init__.py +0 -0
  31. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/pyneoinstance.egg-info/dependency_links.txt +0 -0
  32. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/setup.cfg +0 -0
  33. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/test/__init__.py +0 -0
  34. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/test/age_data.csv +0 -0
  35. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/test/load_files.yaml +0 -0
  36. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/test/movies.csv +0 -0
  37. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/test/people.csv +0 -0
  38. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/test/roles.csv +0 -0
  39. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/test/test.py +0 -0
  40. {pyneoinstance-3.0.0 → pyneoinstance-4.0.1}/test/test_fileload.py +0 -0
@@ -1,3 +1,3 @@
1
1
  include test/*.yaml
2
2
  include test/*.csv
3
- recursive-exclude images
3
+ recursive-exclude images *
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyneoinstance
3
- Version: 3.0.0
4
- Summary: Handle Neo4j read and write transactions and provide methos for performing graph EDA
3
+ Version: 4.0.1
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,35 @@ 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 (GPL)
684
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
683
685
  Classifier: Programming Language :: Python :: 3
684
- Classifier: Development Status :: 4 - Beta
685
- Requires-Python: >=3.8
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>=1.0.0
698
+ Provides-Extra: docs
699
+ Requires-Dist: mkdocs-material>=9.0.0; extra == "docs"
700
+ Requires-Dist: mkdocstrings[python]>=0.24.0; extra == "docs"
692
701
  Dynamic: license-file
693
702
 
694
703
  # PyNeoInstance Package
695
704
 
705
+ <table>
706
+ <tr>
707
+ <td><img src="https://raw.githubusercontent.com/jose-alvarado-guzman/pyneoingest/main/images/PyNeoInstanceLogo.png" alt="PyNeoInstance Logo" width="300"></td>
708
+ <td valign="top">
709
+
696
710
  ## What is it?
697
711
 
698
712
  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 +726,25 @@ It supports the following features:
712
726
  - __<u>Constraints</u>__: Get information of all constraints in the graph.
713
727
  - __<u>Indexes</u>__: Get information of all indexes in the graph.
714
728
  - __<u>Schema Visualization</u>__: Visualize the graph schema.
729
+ - __<u>Query Graph Visualization</u>__: Visualize the result of a Cypher query as an interactive graph.
730
+
731
+ </td>
732
+ </tr>
733
+ </table>
734
+
715
735
 
736
+ ## Documentation
737
+
738
+ Full documentation is available at **https://jose-alvarado-guzman.github.io/pyneoingest/**
716
739
 
717
740
  ## How to install it?
718
741
 
719
- ```python
742
+ ```bash
720
743
  pip install pyneoinstance
721
744
  ```
722
745
 
746
+ The Rust-accelerated Neo4j driver (`neo4j-rust-ext`) is included by default for faster data serialization.
747
+
723
748
  ## How to use it?
724
749
 
725
750
  ### Instantiating the Neo4jInstance class
@@ -801,7 +826,7 @@ query = """
801
826
  m.tagline AS tagline;
802
827
  """
803
828
 
804
- data = graph.execute_read_query(query, db_info['database'], db_info['database'], parameters={'movie_title':'The Matrix'})
829
+ data = graph.execute_read_query(query, db_info['database'], parameters={'movie_title':'The Matrix'})
805
830
  ```
806
831
 
807
832
  ### Submitting a Cypher write query
@@ -818,9 +843,9 @@ query = """
818
843
 
819
844
  results = graph.execute_write_query(query, db_info['database'],
820
845
  parameters={
821
- 'movie_title':'Wakanda Forever',
822
- 'year'=2022,
823
- tagline=''Wakanda Forever! Long Live Wakanda! For Honor, For Legacy, For Wakanda!''
846
+ 'movie_title': 'Wakanda Forever',
847
+ 'year': 2022,
848
+ 'tagline': 'Wakanda Forever! Long Live Wakanda! For Honor, For Legacy, For Wakanda!'
824
849
  })
825
850
  ```
826
851
 
@@ -959,7 +984,7 @@ graph.get_rela_type_freq(database='mydbname')
959
984
  ### Properties
960
985
  The get_properties method provides information about all the nodes and relationships properties.
961
986
  ```python
962
- graph.graph.get_properties(database='mydbname')
987
+ graph.get_properties(database='mydbname')
963
988
  ```
964
989
  <img src="https://s3.amazonaws.com/neo4j-ps-ds-bootcamp/img/properties.png" width="350" hight="300">
965
990
 
@@ -977,21 +1002,37 @@ graph.get_indexes(database='mydbname')
977
1002
  ```
978
1003
  <img src="https://s3.amazonaws.com/neo4j-ps-ds-bootcamp/img/indexes.png" width="450" hight="400">
979
1004
 
980
- ### Schema Visualization
981
- The graph.get_schema_visualization provides an interactive UI with the visualization of the graph schema with the ability to filter the schema. This UI can be access via a Notebook or HTML page. This visualization displays the node labels as string close to nodes, relationship types are only display on mouse hover.
1005
+ ### Query Graph Visualization
1006
+ 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
1007
 
983
1008
  ```python
984
- schema = graph.get_schema_visualization(database='mydbname')
985
- schema.show('schema.html')
1009
+ query = """
1010
+ MATCH (p:Person)-[r:ACTED_IN]->(m:Movie)
1011
+ RETURN p, r, m
1012
+ LIMIT 50
1013
+ """
1014
+ vg = graph.get_query_visualization(query, database='mydbname')
1015
+
1016
+ # In a Jupyter notebook — renders inline:
1017
+ vg.render()
1018
+
1019
+ # As a standalone HTML file:
1020
+ with open('graph.html', 'w') as f:
1021
+ f.write(f'<!DOCTYPE html><html><body>{vg.render().data}</body></html>')
986
1022
  ```
987
- <img src="https://s3.amazonaws.com/neo4j-ps-ds-bootcamp/img/schema.png" width="450" hight="400">
1023
+ <img src="https://raw.githubusercontent.com/jose-alvarado-guzman/pyneoingest/main/images/query_visualization.png" alt="Query Graph Visualization" width="600">
988
1024
 
989
- To access the UI via HTTML page just set the parameter notebook to false in the show method and open the html file in your browser.
1025
+ ### Schema Visualization
1026
+ 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
1027
 
991
1028
  ```python
992
1029
  schema = graph.get_schema_visualization(database='mydbname')
993
- schema.show('schema.html',notebook=False)
1030
+ schema.write_html('schema.html')
994
1031
  ```
1032
+
1033
+ Open `schema.html` in your browser to explore the schema interactively.
1034
+
1035
+ <img src="https://s3.amazonaws.com/neo4j-ps-ds-bootcamp/img/schema.png" width="450" hight="400">
995
1036
  <img src="https://s3.amazonaws.com/neo4j-ps-ds-bootcamp/img/schemaHtml.png" width="450" hight="400">
996
1037
 
997
1038
  ## 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
- ```python
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'], db_info['database'], parameters={'movie_title':'The Matrix'})
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'=2022,
130
- tagline=''Wakanda Forever! Long Live Wakanda! For Honor, For Legacy, For Wakanda!''
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.graph.get_properties(database='mydbname')
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
- ### Schema Visualization
288
- The graph.get_schema_visualization provides an interactive UI with the visualization of the graph schema with the ability to filter the schema. This UI can be access via a Notebook or HTML page. This visualization displays the node labels as string close to nodes, relationship types are only display on mouse hover.
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
- schema = graph.get_schema_visualization(database='mydbname')
292
- schema.show('schema.html')
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://s3.amazonaws.com/neo4j-ps-ds-bootcamp/img/schema.png" width="450" hight="400">
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
- To access the UI via HTTML page just set the parameter notebook to false in the show method and open the html file in your browser.
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.show('schema.html',notebook=False)
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
@@ -1,4 +1,5 @@
1
1
  from .database.neo4jdbms import Neo4jInstance
2
2
  from .fileload.loadyaml import load_yaml_file
3
3
 
4
- __version__ = '3.0.0'
4
+ __version__ = '4.0.1'
5
+ __all__ = ['Neo4jInstance', 'load_yaml_file']
@@ -1,4 +1,4 @@
1
- """Use to provide context to the test module"""
1
+ """Re-exports utility functions for use by the database module."""
2
2
  import os
3
3
  import sys
4
4
  sys.path.insert(0, os.path.abspath(