Graphinate 0.3.2__tar.gz → 0.5.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.
- {graphinate-0.3.2 → graphinate-0.5.0}/.github/workflows/test-beta.yml +1 -1
- {graphinate-0.3.2 → graphinate-0.5.0}/PKG-INFO +30 -24
- {graphinate-0.3.2 → graphinate-0.5.0}/README.md +28 -22
- graphinate-0.5.0/docs/assets/stylesheets/extra.css +64 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/docs/examples/github.md +0 -7
- graphinate-0.5.0/docs/examples/math.md +29 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/docs/index.md +25 -19
- {graphinate-0.3.2 → graphinate-0.5.0}/docs/intro.md +31 -30
- {graphinate-0.3.2 → graphinate-0.5.0}/docs/start.md +7 -3
- {graphinate-0.3.2 → graphinate-0.5.0}/examples/code/python_ast.py +1 -1
- {graphinate-0.3.2 → graphinate-0.5.0}/examples/code/python_dependencies.py +3 -4
- {graphinate-0.3.2 → graphinate-0.5.0}/examples/github/followers.py +6 -1
- {graphinate-0.3.2 → graphinate-0.5.0}/examples/github/repositories.py +4 -2
- graphinate-0.5.0/examples/math/graph_atlas.py +69 -0
- graphinate-0.5.0/examples/math/graphs.py +862 -0
- graphinate-0.5.0/examples/math/gui.py +108 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/examples/math/polygonal_graph.py +7 -4
- {graphinate-0.3.2 → graphinate-0.5.0}/examples/system/processes.py +3 -2
- {graphinate-0.3.2 → graphinate-0.5.0}/examples/web/page_links.py +14 -7
- {graphinate-0.3.2 → graphinate-0.5.0}/pyproject.toml +2 -2
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/builders.py +5 -5
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/cli.py +2 -2
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/materializers/__init__.py +14 -24
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/modeling.py +14 -15
- graphinate-0.5.0/src/graphinate/server/web/static/images/logo.svg +50 -0
- graphinate-0.5.0/src/graphinate/server/web/viewer/index.html +162 -0
- graphinate-0.5.0/tests/graphinate/test_materializers.py +87 -0
- graphinate-0.3.2/docs/assets/stylesheets/extra.css +0 -13
- graphinate-0.3.2/docs/examples/math.md +0 -15
- graphinate-0.3.2/examples/math/graph_atlas.py +0 -828
- graphinate-0.3.2/src/graphinate/server/web/static/js/murmurhash3_gc.js +0 -64
- graphinate-0.3.2/src/graphinate/server/web/viewer/index.html +0 -66
- graphinate-0.3.2/src/graphinate/tools/gui.py +0 -133
- graphinate-0.3.2/tests/graphinate/test_materializers.py +0 -79
- {graphinate-0.3.2 → graphinate-0.5.0}/.coveragerc +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/.github/dependabot.yml +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/.github/workflows/codeql.yml +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/.github/workflows/publish-docs.yaml +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/.github/workflows/publish.yml +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/.github/workflows/test.yml +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/.gitignore +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/.sonarcloud.properties +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/LICENSE +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/STATS.md +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/docs/acknowledge.md +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/docs/assets/images/logo-128.png +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/docs/assets/images/network_graph.png +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/docs/dev.md +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/docs/examples/code.md +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/docs/examples/system.md +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/docs/examples/web.md +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/docs/gen_ref_pages.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/docs/usage/cli.md +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/docs/usage/lib.md +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/examples/code/requirements.txt +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/examples/github/_client.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/examples/github/commits_visibilty_graph.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/examples/github/followers.graphql +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/examples/github/graphql.config.yml +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/examples/github/repositories.graphql +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/examples/github/requirements.txt +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/examples/math/requirements.txt +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/examples/system/requirements.txt +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/examples/web/requirements.txt +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/mkdocs.yml +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/playground/ethernet/traceroute.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/playground/genric_graph.graphql +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/playground/graphql.config.yml +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/playground/house_of_graphs.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/playground/social/albums.json +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/playground/social/musicisians.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/playground/text/nlp_graph.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/playground/text/requirements.txt +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/playground/time_series/requirements.txt +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/playground/time_series/visibility_graph.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/sonar-project.properties +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/__init__.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/__main__.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/color.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/materializers/matplotlib.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/server/__init__.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/server/starlette/__init__.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/server/starlette/views.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/server/web/__init__.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/server/web/elements/__init__.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/server/web/elements/index.html +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/server/web/graphiql/__init__.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/server/web/graphiql/index.html +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/server/web/rapidoc/__init__.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/server/web/rapidoc/index.html +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/server/web/static/images/logo-128.png +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/server/web/static/images/network_graph.png +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/server/web/viewer/__init__.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/server/web/voyager/__init__.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/server/web/voyager/index.html +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/tools/__init__.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/tools/converters.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/tools/mutators.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/src/graphinate/typing.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/tests/conftest.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/tests/graphinate/test_builders.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/tests/graphinate/test_cli.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/tests/graphinate/test_color.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/tests/graphinate/test_modeling.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/tests/graphinate/test_server.py +0 -0
- {graphinate-0.3.2 → graphinate-0.5.0}/tests/graphinate/test_tools.py +0 -0
|
@@ -16,7 +16,7 @@ jobs:
|
|
|
16
16
|
fail-fast: false
|
|
17
17
|
matrix:
|
|
18
18
|
# https://github.com/actions/python-versions/blob/main/versions-manifest.json
|
|
19
|
-
python-version: [ "3.14.0-alpha.
|
|
19
|
+
python-version: [ "3.14.0-alpha.4" ]
|
|
20
20
|
steps:
|
|
21
21
|
- uses: actions/checkout@v4
|
|
22
22
|
- name: Set up Python ${{ matrix.python-version }}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Graphinate
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 0.5.0
|
|
4
|
+
Summary: 𝔾raphinate. Data to Graphs.
|
|
5
5
|
Project-URL: Homepage, https://erivlis.github.io/graphinate
|
|
6
6
|
Project-URL: Documentation, https://erivlis.github.io/graphinate
|
|
7
7
|
Project-URL: Bug Tracker, https://github.com/erivlis/graphinate/issues
|
|
@@ -58,7 +58,7 @@ Requires-Dist: pytest-randomly; extra == 'test'
|
|
|
58
58
|
Requires-Dist: pytest-xdist; extra == 'test'
|
|
59
59
|
Description-Content-Type: text/markdown
|
|
60
60
|
|
|
61
|
-
# [
|
|
61
|
+
# [𝔾raphinate. Data to Graphs.](https://erivlis.github.io/graphinate/)
|
|
62
62
|
|
|
63
63
|
<img height="360" src="https://github.com/erivlis/graphinate/assets/9897520/dae41f9f-69e5-4eb5-a488-87ce7f51fa32" alt="Graphinate. Data to Graphs.">
|
|
64
64
|
|
|
@@ -73,7 +73,7 @@ Description-Content-Type: text/markdown
|
|
|
73
73
|
<img alt="Libraries.io SourceRank" src="https://img.shields.io/librariesio/sourcerank/pypi/Graphinate.svg?logo=Libraries.io&label=SourceRank">
|
|
74
74
|
</td>
|
|
75
75
|
</tr>
|
|
76
|
-
<tr>
|
|
76
|
+
<tr style="vertical-align: middle;">
|
|
77
77
|
<td>Code</td>
|
|
78
78
|
<td>
|
|
79
79
|
<img alt="GitHub" src="https://img.shields.io/github/license/erivlis/graphinate">
|
|
@@ -82,7 +82,7 @@ Description-Content-Type: text/markdown
|
|
|
82
82
|
<a href="https://github.com/erivlis/graphinate/graphs/contributors"><img alt="Contributors" src="https://img.shields.io/github/contributors/erivlis/graphinate.svg?&logo=git"></a>
|
|
83
83
|
</td>
|
|
84
84
|
</tr>
|
|
85
|
-
<tr>
|
|
85
|
+
<tr style="vertical-align: middle;">
|
|
86
86
|
<td>Tools</td>
|
|
87
87
|
<td>
|
|
88
88
|
<a href="https://www.jetbrains.com/pycharm/"><img alt="PyCharm" src="https://img.shields.io/badge/PyCharm-FCF84A.svg?logo=PyCharm&logoColor=black&labelColor=21D789&color=FCF84A"></a>
|
|
@@ -93,16 +93,16 @@ Description-Content-Type: text/markdown
|
|
|
93
93
|
<a href="https://hatch.pypa.io"><img alt="Hatch project" class="off-glb" loading="lazy" src="https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg"></a>
|
|
94
94
|
</td>
|
|
95
95
|
</tr>
|
|
96
|
-
<tr>
|
|
96
|
+
<tr style="vertical-align: middle;">
|
|
97
97
|
<td>CI/CD</td>
|
|
98
98
|
<td>
|
|
99
|
-
<a href="https://github.com/erivlis/graphinate/actions/workflows/test.yml"><img alt="
|
|
100
|
-
<a href="https://github.com/erivlis/graphinate/actions/workflows/test.yml"><img alt="
|
|
99
|
+
<a href="https://github.com/erivlis/graphinate/actions/workflows/test.yml"><img alt="Test" src="https://github.com/erivlis/graphinate/actions/workflows/test.yml/badge.svg"></a>
|
|
100
|
+
<a href="https://github.com/erivlis/graphinate/actions/workflows/test-beta.yml"><img alt="Test (Beta)" src="https://github.com/erivlis/graphinate/actions/workflows/test-beta.yml/badge.svg"></a>
|
|
101
101
|
<a href="https://github.com/erivlis/graphinate/actions/workflows/publish.yml"><img alt="Publish" src="https://github.com/erivlis/graphinate/actions/workflows/publish.yml/badge.svg"></a>
|
|
102
102
|
<a href="https://github.com/erivlis/graphinate/actions/workflows/publish-docs.yaml"><img alt="Publish Docs" src="https://github.com/erivlis/graphinate/actions/workflows/publish-docs.yaml/badge.svg"></a>
|
|
103
103
|
</td>
|
|
104
104
|
</tr>
|
|
105
|
-
<tr>
|
|
105
|
+
<tr style="vertical-align: middle;">
|
|
106
106
|
<td>Scans</td>
|
|
107
107
|
<td>
|
|
108
108
|
<a href="https://codecov.io/gh/erivlis/graphinate"><img alt="Coverage" src="https://codecov.io/gh/erivlis/graphinate/graph/badge.svg?token=POODT8M9NV"/></a>
|
|
@@ -120,22 +120,26 @@ Description-Content-Type: text/markdown
|
|
|
120
120
|
<a href="https://snyk.io/test/github/erivlis/graphinate"><img alt="Snyk" src="https://snyk.io/test/github/erivlis/Graphinate/badge.svg"></a>
|
|
121
121
|
</td>
|
|
122
122
|
</tr>
|
|
123
|
+
<tr>
|
|
124
|
+
<td>Badge</td>
|
|
125
|
+
<td>
|
|
126
|
+
<a href="https://img.shields.io/badge/%F0%9D%94%BE%3D%7B%F0%9D%95%8D%2C%F0%9D%94%BC%7D-Graphinate-darkviolet"><img alt="Graphinate" src="https://img.shields.io/badge/%F0%9D%94%BE%3D%7B%F0%9D%95%8D%2C%F0%9D%94%BC%7D-Graphinate-darkviolet"></a>
|
|
127
|
+
</td>
|
|
128
|
+
</tr>
|
|
123
129
|
</table>
|
|
124
130
|
|
|
125
|
-
---------------------
|
|
126
|
-
|
|
127
131
|
## Introduction
|
|
128
132
|
|
|
129
133
|
### What is Graphinate?
|
|
130
134
|
|
|
131
|
-
**Graphinate** is a python library that
|
|
135
|
+
**Graphinate** is a python library that can be used to generate Graph Data Structures from Data Sources.
|
|
132
136
|
|
|
133
|
-
It can help create an efficient retrieval pipeline from a given data source, while also enabling the developer to
|
|
134
|
-
|
|
137
|
+
It can help create an efficient retrieval pipeline from a given data source, while also enabling the developer to map
|
|
138
|
+
data payloads and hierarchies to a Graph.
|
|
135
139
|
|
|
136
|
-
In addition, there are several modes of output to enable examination of the Graph
|
|
140
|
+
In addition, there are several modes of output to enable examination of the Graph and its content.
|
|
137
141
|
|
|
138
|
-
**Graphinate**
|
|
142
|
+
**Graphinate** uses and builds upon the excellent [**_NetworkX_**](https://networkx.org/).
|
|
139
143
|
|
|
140
144
|
### Links
|
|
141
145
|
|
|
@@ -163,25 +167,28 @@ pip install graphinate[server]
|
|
|
163
167
|
|
|
164
168
|
### Example
|
|
165
169
|
|
|
166
|
-
```python
|
|
170
|
+
```python title="Octagonal Graph"
|
|
167
171
|
import graphinate
|
|
168
172
|
|
|
169
173
|
N: int = 8
|
|
170
174
|
|
|
171
|
-
# Define GraphModel
|
|
172
|
-
graph_model = graphinate.model(name="Octagonal Graph")
|
|
175
|
+
# Define a GraphModel
|
|
176
|
+
graph_model: graphinate.GraphModel = graphinate.model(name="Octagonal Graph")
|
|
173
177
|
|
|
174
178
|
|
|
175
|
-
# Register edges supplier function
|
|
179
|
+
# Register in the Graph Model the edges' supplier function
|
|
176
180
|
@graph_model.edge()
|
|
177
181
|
def edge():
|
|
178
|
-
for i in range(N
|
|
182
|
+
for i in range(N):
|
|
179
183
|
yield {'source': i, 'target': i + 1}
|
|
180
|
-
yield {'source': N
|
|
184
|
+
yield {'source': N, 'target': 0}
|
|
185
|
+
|
|
181
186
|
|
|
187
|
+
# Choose builder and handler
|
|
188
|
+
builder, handler = graphinate.materializers.Materializers.NetworkX_with_edge_labels.value
|
|
182
189
|
|
|
183
190
|
# Materialize the GraphModel
|
|
184
|
-
graphinate.materialize(graph_model)
|
|
191
|
+
graphinate.materialize(graph_model, builder=builder, builder_output_handler=handler)
|
|
185
192
|
```
|
|
186
193
|
|
|
187
194
|
#### `graphinate.model` function
|
|
@@ -194,7 +201,6 @@ graphinate.materialize(graph_model)
|
|
|
194
201
|
|
|
195
202
|
> [!NOTE]
|
|
196
203
|
> This function can be used to easily generate an output from a `GraphModel` instance.
|
|
197
|
-
> By default, it will prompt the user to choose the output format, using a popup GUI dialog box.
|
|
198
204
|
|
|
199
205
|
## CLI
|
|
200
206
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# [
|
|
1
|
+
# [𝔾raphinate. Data to Graphs.](https://erivlis.github.io/graphinate/)
|
|
2
2
|
|
|
3
3
|
<img height="360" src="https://github.com/erivlis/graphinate/assets/9897520/dae41f9f-69e5-4eb5-a488-87ce7f51fa32" alt="Graphinate. Data to Graphs.">
|
|
4
4
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<img alt="Libraries.io SourceRank" src="https://img.shields.io/librariesio/sourcerank/pypi/Graphinate.svg?logo=Libraries.io&label=SourceRank">
|
|
14
14
|
</td>
|
|
15
15
|
</tr>
|
|
16
|
-
<tr>
|
|
16
|
+
<tr style="vertical-align: middle;">
|
|
17
17
|
<td>Code</td>
|
|
18
18
|
<td>
|
|
19
19
|
<img alt="GitHub" src="https://img.shields.io/github/license/erivlis/graphinate">
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<a href="https://github.com/erivlis/graphinate/graphs/contributors"><img alt="Contributors" src="https://img.shields.io/github/contributors/erivlis/graphinate.svg?&logo=git"></a>
|
|
23
23
|
</td>
|
|
24
24
|
</tr>
|
|
25
|
-
<tr>
|
|
25
|
+
<tr style="vertical-align: middle;">
|
|
26
26
|
<td>Tools</td>
|
|
27
27
|
<td>
|
|
28
28
|
<a href="https://www.jetbrains.com/pycharm/"><img alt="PyCharm" src="https://img.shields.io/badge/PyCharm-FCF84A.svg?logo=PyCharm&logoColor=black&labelColor=21D789&color=FCF84A"></a>
|
|
@@ -33,16 +33,16 @@
|
|
|
33
33
|
<a href="https://hatch.pypa.io"><img alt="Hatch project" class="off-glb" loading="lazy" src="https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg"></a>
|
|
34
34
|
</td>
|
|
35
35
|
</tr>
|
|
36
|
-
<tr>
|
|
36
|
+
<tr style="vertical-align: middle;">
|
|
37
37
|
<td>CI/CD</td>
|
|
38
38
|
<td>
|
|
39
|
-
<a href="https://github.com/erivlis/graphinate/actions/workflows/test.yml"><img alt="
|
|
40
|
-
<a href="https://github.com/erivlis/graphinate/actions/workflows/test.yml"><img alt="
|
|
39
|
+
<a href="https://github.com/erivlis/graphinate/actions/workflows/test.yml"><img alt="Test" src="https://github.com/erivlis/graphinate/actions/workflows/test.yml/badge.svg"></a>
|
|
40
|
+
<a href="https://github.com/erivlis/graphinate/actions/workflows/test-beta.yml"><img alt="Test (Beta)" src="https://github.com/erivlis/graphinate/actions/workflows/test-beta.yml/badge.svg"></a>
|
|
41
41
|
<a href="https://github.com/erivlis/graphinate/actions/workflows/publish.yml"><img alt="Publish" src="https://github.com/erivlis/graphinate/actions/workflows/publish.yml/badge.svg"></a>
|
|
42
42
|
<a href="https://github.com/erivlis/graphinate/actions/workflows/publish-docs.yaml"><img alt="Publish Docs" src="https://github.com/erivlis/graphinate/actions/workflows/publish-docs.yaml/badge.svg"></a>
|
|
43
43
|
</td>
|
|
44
44
|
</tr>
|
|
45
|
-
<tr>
|
|
45
|
+
<tr style="vertical-align: middle;">
|
|
46
46
|
<td>Scans</td>
|
|
47
47
|
<td>
|
|
48
48
|
<a href="https://codecov.io/gh/erivlis/graphinate"><img alt="Coverage" src="https://codecov.io/gh/erivlis/graphinate/graph/badge.svg?token=POODT8M9NV"/></a>
|
|
@@ -60,22 +60,26 @@
|
|
|
60
60
|
<a href="https://snyk.io/test/github/erivlis/graphinate"><img alt="Snyk" src="https://snyk.io/test/github/erivlis/Graphinate/badge.svg"></a>
|
|
61
61
|
</td>
|
|
62
62
|
</tr>
|
|
63
|
+
<tr>
|
|
64
|
+
<td>Badge</td>
|
|
65
|
+
<td>
|
|
66
|
+
<a href="https://img.shields.io/badge/%F0%9D%94%BE%3D%7B%F0%9D%95%8D%2C%F0%9D%94%BC%7D-Graphinate-darkviolet"><img alt="Graphinate" src="https://img.shields.io/badge/%F0%9D%94%BE%3D%7B%F0%9D%95%8D%2C%F0%9D%94%BC%7D-Graphinate-darkviolet"></a>
|
|
67
|
+
</td>
|
|
68
|
+
</tr>
|
|
63
69
|
</table>
|
|
64
70
|
|
|
65
|
-
---------------------
|
|
66
|
-
|
|
67
71
|
## Introduction
|
|
68
72
|
|
|
69
73
|
### What is Graphinate?
|
|
70
74
|
|
|
71
|
-
**Graphinate** is a python library that
|
|
75
|
+
**Graphinate** is a python library that can be used to generate Graph Data Structures from Data Sources.
|
|
72
76
|
|
|
73
|
-
It can help create an efficient retrieval pipeline from a given data source, while also enabling the developer to
|
|
74
|
-
|
|
77
|
+
It can help create an efficient retrieval pipeline from a given data source, while also enabling the developer to map
|
|
78
|
+
data payloads and hierarchies to a Graph.
|
|
75
79
|
|
|
76
|
-
In addition, there are several modes of output to enable examination of the Graph
|
|
80
|
+
In addition, there are several modes of output to enable examination of the Graph and its content.
|
|
77
81
|
|
|
78
|
-
**Graphinate**
|
|
82
|
+
**Graphinate** uses and builds upon the excellent [**_NetworkX_**](https://networkx.org/).
|
|
79
83
|
|
|
80
84
|
### Links
|
|
81
85
|
|
|
@@ -103,25 +107,28 @@ pip install graphinate[server]
|
|
|
103
107
|
|
|
104
108
|
### Example
|
|
105
109
|
|
|
106
|
-
```python
|
|
110
|
+
```python title="Octagonal Graph"
|
|
107
111
|
import graphinate
|
|
108
112
|
|
|
109
113
|
N: int = 8
|
|
110
114
|
|
|
111
|
-
# Define GraphModel
|
|
112
|
-
graph_model = graphinate.model(name="Octagonal Graph")
|
|
115
|
+
# Define a GraphModel
|
|
116
|
+
graph_model: graphinate.GraphModel = graphinate.model(name="Octagonal Graph")
|
|
113
117
|
|
|
114
118
|
|
|
115
|
-
# Register edges supplier function
|
|
119
|
+
# Register in the Graph Model the edges' supplier function
|
|
116
120
|
@graph_model.edge()
|
|
117
121
|
def edge():
|
|
118
|
-
for i in range(N
|
|
122
|
+
for i in range(N):
|
|
119
123
|
yield {'source': i, 'target': i + 1}
|
|
120
|
-
yield {'source': N
|
|
124
|
+
yield {'source': N, 'target': 0}
|
|
125
|
+
|
|
121
126
|
|
|
127
|
+
# Choose builder and handler
|
|
128
|
+
builder, handler = graphinate.materializers.Materializers.NetworkX_with_edge_labels.value
|
|
122
129
|
|
|
123
130
|
# Materialize the GraphModel
|
|
124
|
-
graphinate.materialize(graph_model)
|
|
131
|
+
graphinate.materialize(graph_model, builder=builder, builder_output_handler=handler)
|
|
125
132
|
```
|
|
126
133
|
|
|
127
134
|
#### `graphinate.model` function
|
|
@@ -134,7 +141,6 @@ graphinate.materialize(graph_model)
|
|
|
134
141
|
|
|
135
142
|
> [!NOTE]
|
|
136
143
|
> This function can be used to easily generate an output from a `GraphModel` instance.
|
|
137
|
-
> By default, it will prompt the user to choose the output format, using a popup GUI dialog box.
|
|
138
144
|
|
|
139
145
|
## CLI
|
|
140
146
|
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/* extra.css */
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
:root {
|
|
5
|
+
--md-primary-fg-color: #E3963E;
|
|
6
|
+
--md-primary-fg-color--dark: #FFBF00;
|
|
7
|
+
--md-primary-fg-color--light: #EBA937;
|
|
8
|
+
}
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
:root {
|
|
12
|
+
--md-primary-fg-color: rebeccapurple;
|
|
13
|
+
--md-primary-fg-color--dark: midnight;
|
|
14
|
+
--md-primary-fg-color--light: silver;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
/* Title levels */
|
|
19
|
+
h1 {
|
|
20
|
+
color: royalblue;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
h2 {
|
|
24
|
+
color: slateblue;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
h3 {
|
|
28
|
+
color: mediumslateblue;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
h4, h5, h6 {
|
|
32
|
+
color: steelblue;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Blockquotes */
|
|
36
|
+
/*blockquote {*/
|
|
37
|
+
/* border-left: 4px solid #bdc3c7; !* Light gray *!*/
|
|
38
|
+
/* color: #7f8c8d; !* Gray *!*/
|
|
39
|
+
/* !*background-color: #ecf0f1; !* Very light gray *!*!*/
|
|
40
|
+
/* padding: 10px;*/
|
|
41
|
+
/*}*/
|
|
42
|
+
|
|
43
|
+
/* Code blocks */
|
|
44
|
+
/*pre, code {*/
|
|
45
|
+
/* background-color: #f8f9fa; !* Very light gray *!*/
|
|
46
|
+
/* color: #2c3e50; !* Dark blue *!*/
|
|
47
|
+
/*}*/
|
|
48
|
+
|
|
49
|
+
/* Tables */
|
|
50
|
+
/*table {*/
|
|
51
|
+
/* border-collapse: collapse;*/
|
|
52
|
+
/* width: 100%;*/
|
|
53
|
+
/*}*/
|
|
54
|
+
|
|
55
|
+
/*th, td {*/
|
|
56
|
+
/* border: 1px solid #bdc3c7; !* Light gray *!*/
|
|
57
|
+
/* padding: 8px;*/
|
|
58
|
+
/* text-align: left;*/
|
|
59
|
+
/*}*/
|
|
60
|
+
|
|
61
|
+
/*th {*/
|
|
62
|
+
/* background-color: #ecf0f1; !* Very light gray *!*/
|
|
63
|
+
/* color: #2c3e50; !* Dark blue *!*/
|
|
64
|
+
/*}*/
|
|
@@ -3,42 +3,35 @@
|
|
|
3
3
|
## Repositories
|
|
4
4
|
|
|
5
5
|
=== "Repositories"
|
|
6
|
-
|
|
7
6
|
``` python title="examples/github/repositories.py" linenums="1"
|
|
8
7
|
--8<-- "examples/github/repositories.py"
|
|
9
8
|
```
|
|
10
9
|
|
|
11
10
|
=== "Dependencies"
|
|
12
|
-
|
|
13
11
|
``` text title="examples/github/requirements.txt" linenums="1"
|
|
14
12
|
--8<-- "examples/github/requirements.txt"
|
|
15
13
|
```
|
|
16
14
|
|
|
17
|
-
|
|
18
15
|
``` python title="examples/github/_client.py" linenums="1"
|
|
19
16
|
--8<-- "examples/github/_client.py"
|
|
20
17
|
```
|
|
21
18
|
|
|
22
19
|
=== "Plot"
|
|
23
|
-
|
|
24
20
|

|
|
25
21
|
|
|
26
22
|
|
|
27
23
|
## Followers
|
|
28
24
|
|
|
29
25
|
=== "Followers"
|
|
30
|
-
|
|
31
26
|
``` python title="examples/github/followers.py" linenums="1"
|
|
32
27
|
--8<-- "examples/github/followers.py"
|
|
33
28
|
```
|
|
34
29
|
|
|
35
30
|
=== "Dependencies"
|
|
36
|
-
|
|
37
31
|
``` text title="examples/github/requirements.txt" linenums="1"
|
|
38
32
|
--8<-- "examples/github/requirements.txt"
|
|
39
33
|
```
|
|
40
34
|
|
|
41
|
-
|
|
42
35
|
``` python title="examples/github/_client.py" linenums="1"
|
|
43
36
|
--8<-- "examples/github/_client.py"
|
|
44
37
|
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Math
|
|
2
|
+
|
|
3
|
+
## Graph Atlas
|
|
4
|
+
|
|
5
|
+
=== "Graph Atlas"
|
|
6
|
+
``` python title="examples/math/graph_atlas.py" linenums="1"
|
|
7
|
+
--8<-- "examples/math/graph_atlas.py"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
=== "Dependencies"
|
|
11
|
+
``` text title="examples/math/requirements.txt" linenums="1"
|
|
12
|
+
--8<-- "examples/math/requirements.txt"
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
``` python title="examples/math/graph.py" linenums="1"
|
|
16
|
+
--8<-- "examples/math/graphs.py"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Polygonal Graph
|
|
20
|
+
|
|
21
|
+
=== "Polygonal Graph"
|
|
22
|
+
``` python title="examples/math/polygonal_graph.py" linenums="1"
|
|
23
|
+
--8<-- "examples/math/polygonal_graph.py"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
=== "Dependencies"
|
|
27
|
+
``` text title="examples/math/requirements.txt" linenums="1"
|
|
28
|
+
--8<-- "examples/math/requirements.txt"
|
|
29
|
+
```
|
|
@@ -2,55 +2,61 @@
|
|
|
2
2
|
|
|
3
3
|
<table style="border-width: 0;">
|
|
4
4
|
<tr style="vertical-align: middle; border-width: 0;">
|
|
5
|
-
<td rowspan="
|
|
5
|
+
<td rowspan="5"><img height="240" src="https://github.com/erivlis/graphinate/assets/9897520/dae41f9f-69e5-4eb5-a488-87ce7f51fa32" alt="Graphinate. Data to Graphs."></td>
|
|
6
6
|
<td>Package</td>
|
|
7
7
|
<td>
|
|
8
|
-
<img alt="PyPI - version" src="https://img.shields.io/pypi/v/graphinate">
|
|
9
|
-
<img alt="PyPI - Status" src="https://img.shields.io/pypi/status/graphinate">
|
|
10
|
-
<img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/graphinate">
|
|
11
|
-
<img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dd/graphinate">
|
|
12
|
-
<
|
|
8
|
+
<img alt="PyPI - version" src="https://img.shields.io/pypi/v/graphinate.svg?logo=pypi&logoColor=lightblue">
|
|
9
|
+
<img alt="PyPI - Status" src="https://img.shields.io/pypi/status/graphinate.svg?logo=pypi&logoColor=lightblue">
|
|
10
|
+
<img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/graphinate.svg?logo=python&label=Python&logoColor=lightblue">
|
|
11
|
+
<img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dd/graphinate.svg?logo=pypi&logoColor=lightblue">
|
|
12
|
+
<img alt="Libraries.io SourceRank" src="https://img.shields.io/librariesio/sourcerank/pypi/Graphinate.svg?logo=Libraries.io&label=SourceRank">
|
|
13
|
+
</td>
|
|
14
|
+
</tr>
|
|
15
|
+
<tr style="vertical-align: middle;">
|
|
16
|
+
<td>Code</td>
|
|
17
|
+
<td>
|
|
13
18
|
<img alt="GitHub" src="https://img.shields.io/github/license/erivlis/graphinate">
|
|
14
|
-
<img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/erivlis/graphinate">
|
|
15
|
-
<img alt="GitHub last commit (by committer)" src="https://img.shields.io/github/last-commit/erivlis/graphinate">
|
|
16
|
-
<a href="https://github.com/erivlis/graphinate/graphs/contributors"><img alt="Contributors" src="https://img.shields.io/github/contributors/erivlis/graphinate.svg"></a>
|
|
17
|
-
<img alt="GitHub Watchers" src="https://img.shields.io/github/watchers/erivlis/graphinate.svg">
|
|
19
|
+
<img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/erivlis/graphinate.svg?label=Size&logo=git">
|
|
20
|
+
<img alt="GitHub last commit (by committer)" src="https://img.shields.io/github/last-commit/erivlis/graphinate.svg?&logo=git">
|
|
21
|
+
<a href="https://github.com/erivlis/graphinate/graphs/contributors"><img alt="Contributors" src="https://img.shields.io/github/contributors/erivlis/graphinate.svg?&logo=git"></a>
|
|
18
22
|
</td>
|
|
19
23
|
</tr>
|
|
20
|
-
<tr
|
|
24
|
+
<tr style="vertical-align: middle;">
|
|
21
25
|
<td>Tools</td>
|
|
22
26
|
<td>
|
|
23
27
|
<a href="https://www.jetbrains.com/pycharm/"><img alt="PyCharm" src="https://img.shields.io/badge/PyCharm-FCF84A.svg?logo=PyCharm&logoColor=black&labelColor=21D789&color=FCF84A"></a>
|
|
24
|
-
<a href="https://github.com/astral-sh/
|
|
25
|
-
<a href="https://github.com/astral-sh/
|
|
26
|
-
<a href="https://github.com/tox-dev/pipdeptree"><img src="https://img.shields.io/badge/pipdeptree-526CFE.svg?labelColor=gray&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADFElEQVR4nFxTW2tcVRRe39773E/mliZjwKRmhBaKt4BWRKmGgihCH3xUKNWC/Q/ii76IP8AHpSIiRfqmD5YKCinalhgiCMZLSVtMM0mTdDLTuZyZc9l7yTlp7WXBgXPW+fa31rfWtxU9FLMN79Crr028e+iJsZfb7fJMp23xRlOvbTR3L/y5cuOL3Vbv7/vxuPviecI/eWr6k/mj4+8AkM11y+zs2MKwMJvNgIgYINZX/rlx+tIvf72fZXr4P0EQyOCjjw98P9vwn8+/+z3Bq6sek7AJkNhsOjQcyjvFmHd2upd+PP/zsSxNI5mnPvjw8U9fPFJ9XVkgNuDVayEbcgVEfgikNfFg4JAmh1LyyfGq06QqE9vN6+fEs4fHnjv25vjbAOA4AsL2MVZ1hRcI4QXIH7ilMqQXkiYXRBJRbFNQnTsRlqfmxFvH66ccFyAQMxP3I5cqNZBSxIWcKORMO9g3yeSHzFkGbnVCIkDUZ+beEy+8VJ4XguC6TMPYokwrCAHUJsBxYptoFBYSMi0oLIlcAkuFYhal8Zl5VanZU0zErgfurufMFjEkWZ7iRFY4SlgYfW9bUIJKFQNjiNPYf1QZOZn/hTaStPQKTI4eDCxSjsL4I6BeJzOjgcnT0HqPqwBJCdHZjW/miWjkkG3hzqKIe5FVlM3llGuWqOxTDMBkWlJ/6PB2p0Sb21gXixdvLeTtDGOHLFvQHpkiYyTuNU5kuxJercTdpEK3Bz4yLdFrXVsQ33x1/bModjhvyrKKVXB/YD9gb8PgKAlolAZipmFTOIYcxq21Xz8XS5dbi+e+2zqbA3MjxYninH3PpkyZljwYjZE2FoxBIWm6YVHaW/k66qwtF05curz509OHHzvqBqWp232fE+2AoCjOXNMfhcRcjAxxoijNFNpbG0vL588cNzpLC4I00cnCD1fPBuVqffbA5DMGNjR5MOSBpC+UYxGE5G5PmNXff/vy4rdnTmRJHD1wG+9G42D9qVfeePLk/oONI8qv7+/2fbq11f53ZfnqhStLi6d3b67/cT/+vwAAAP//Xo5dwOtdLi4AAAAASUVORK5CYII="></a>
|
|
28
|
+
<a href="https://github.com/astral-sh/uv"><img alt="uv" src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json" style="max-width:100%;"></a>
|
|
29
|
+
<a href="https://github.com/astral-sh/ruff"><img alt="ruff" src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" style="max-width:100%;"></a>
|
|
30
|
+
<a href="https://github.com/tox-dev/pipdeptree"><img alt="pipdeptree" src="https://img.shields.io/badge/pipdeptree-526CFE.svg?labelColor=gray&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADFElEQVR4nFxTW2tcVRRe39773E/mliZjwKRmhBaKt4BWRKmGgihCH3xUKNWC/Q/ii76IP8AHpSIiRfqmD5YKCinalhgiCMZLSVtMM0mTdDLTuZyZc9l7yTlp7WXBgXPW+fa31rfWtxU9FLMN79Crr028e+iJsZfb7fJMp23xRlOvbTR3L/y5cuOL3Vbv7/vxuPviecI/eWr6k/mj4+8AkM11y+zs2MKwMJvNgIgYINZX/rlx+tIvf72fZXr4P0EQyOCjjw98P9vwn8+/+z3Bq6sek7AJkNhsOjQcyjvFmHd2upd+PP/zsSxNI5mnPvjw8U9fPFJ9XVkgNuDVayEbcgVEfgikNfFg4JAmh1LyyfGq06QqE9vN6+fEs4fHnjv25vjbAOA4AsL2MVZ1hRcI4QXIH7ilMqQXkiYXRBJRbFNQnTsRlqfmxFvH66ccFyAQMxP3I5cqNZBSxIWcKORMO9g3yeSHzFkGbnVCIkDUZ+beEy+8VJ4XguC6TMPYokwrCAHUJsBxYptoFBYSMi0oLIlcAkuFYhal8Zl5VanZU0zErgfurufMFjEkWZ7iRFY4SlgYfW9bUIJKFQNjiNPYf1QZOZn/hTaStPQKTI4eDCxSjsL4I6BeJzOjgcnT0HqPqwBJCdHZjW/miWjkkG3hzqKIe5FVlM3llGuWqOxTDMBkWlJ/6PB2p0Sb21gXixdvLeTtDGOHLFvQHpkiYyTuNU5kuxJercTdpEK3Bz4yLdFrXVsQ33x1/bModjhvyrKKVXB/YD9gb8PgKAlolAZipmFTOIYcxq21Xz8XS5dbi+e+2zqbA3MjxYninH3PpkyZljwYjZE2FoxBIWm6YVHaW/k66qwtF05curz509OHHzvqBqWp232fE+2AoCjOXNMfhcRcjAxxoijNFNpbG0vL588cNzpLC4I00cnCD1fPBuVqffbA5DMGNjR5MOSBpC+UYxGE5G5PmNXff/vy4rdnTmRJHD1wG+9G42D9qVfeePLk/oONI8qv7+/2fbq11f53ZfnqhStLi6d3b67/cT/+vwAAAP//Xo5dwOtdLi4AAAAASUVORK5CYII="></a>
|
|
31
|
+
<a href="https://squidfunk.github.io/mkdocs-material/"><img alt="mkdocs-material" src="https://img.shields.io/badge/Material_for_MkDocs-526CFE?&logo=MaterialForMkDocs&logoColor=white&labelColor=grey"></a>
|
|
32
|
+
<a href="https://hatch.pypa.io"><img alt="Hatch project" class="off-glb" loading="lazy" src="https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg"></a>
|
|
27
33
|
</td>
|
|
28
34
|
</tr>
|
|
29
|
-
<tr style="vertical-align: middle;
|
|
35
|
+
<tr style="vertical-align: middle;">
|
|
30
36
|
<td>CI/CD</td>
|
|
31
37
|
<td>
|
|
32
38
|
<a href="https://github.com/erivlis/graphinate/actions/workflows/test.yml"><img alt="Tests" src="https://github.com/erivlis/graphinate/actions/workflows/test.yml/badge.svg?branch=master"></a>
|
|
39
|
+
<a href="https://github.com/erivlis/graphinate/actions/workflows/test.yml"><img alt="Tests" src="https://github.com/erivlis/graphinate/actions/workflows/test-beta.yml/badge.svg?branch=master"></a>
|
|
33
40
|
<a href="https://github.com/erivlis/graphinate/actions/workflows/publish.yml"><img alt="Publish" src="https://github.com/erivlis/graphinate/actions/workflows/publish.yml/badge.svg"></a>
|
|
34
41
|
<a href="https://github.com/erivlis/graphinate/actions/workflows/publish-docs.yaml"><img alt="Publish Docs" src="https://github.com/erivlis/graphinate/actions/workflows/publish-docs.yaml/badge.svg"></a>
|
|
35
42
|
</td>
|
|
36
43
|
</tr>
|
|
37
|
-
<tr style="vertical-align: middle;
|
|
44
|
+
<tr style="vertical-align: middle;">
|
|
38
45
|
<td>Scans</td>
|
|
39
46
|
<td>
|
|
40
47
|
<a href="https://codecov.io/gh/erivlis/graphinate"><img alt="Coverage" src="https://codecov.io/gh/erivlis/graphinate/graph/badge.svg?token=POODT8M9NV"/></a>
|
|
41
|
-
<br>
|
|
42
48
|
<a href="https://sonarcloud.io/summary/new_code?id=erivlis_graphinate"><img alt="Quality Gate Status" src="https://sonarcloud.io/api/project_badges/measure?project=erivlis_graphinate&metric=alert_status"></a>
|
|
43
49
|
<a href="https://sonarcloud.io/summary/new_code?id=erivlis_graphinate"><img alt="Security Rating" src="https://sonarcloud.io/api/project_badges/measure?project=erivlis_graphinate&metric=security_rating"></a>
|
|
44
50
|
<a href="https://sonarcloud.io/summary/new_code?id=erivlis_graphinate"><img alt="Maintainability Rating" src="https://sonarcloud.io/api/project_badges/measure?project=erivlis_graphinate&metric=sqale_rating"></a>
|
|
45
51
|
<a href="https://sonarcloud.io/summary/new_code?id=erivlis_graphinate"><img alt="Reliability Rating" src="https://sonarcloud.io/api/project_badges/measure?project=erivlis_graphinate&metric=reliability_rating"></a>
|
|
46
|
-
<br>
|
|
47
52
|
<a href="https://sonarcloud.io/summary/new_code?id=erivlis_graphinate"><img alt="Lines of Code" src="https://sonarcloud.io/api/project_badges/measure?project=erivlis_graphinate&metric=ncloc"></a>
|
|
48
53
|
<a href="https://sonarcloud.io/summary/new_code?id=erivlis_graphinate"><img alt="Vulnerabilities" src="https://sonarcloud.io/api/project_badges/measure?project=erivlis_graphinate&metric=vulnerabilities"></a>
|
|
49
54
|
<a href="https://sonarcloud.io/summary/new_code?id=erivlis_graphinate"><img alt="Bugs" src="https://sonarcloud.io/api/project_badges/measure?project=erivlis_graphinate&metric=bugs"></a>
|
|
50
|
-
<br>
|
|
51
55
|
<a href="https://app.codacy.com/gh/erivlis/graphinate/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img alt="Codacy Badge" src="https://app.codacy.com/project/badge/Grade/54b33c3f7313448f9471d01e2a06f037"></a>
|
|
52
56
|
<a href="https://app.codacy.com/gh/erivlis/graphinate/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage"><img alt="Codacy Coverage" src="https://app.codacy.com/project/badge/Coverage/54b33c3f7313448f9471d01e2a06f037"/></a>
|
|
53
57
|
<a href="https://scrutinizer-ci.com/g/erivlis/graphinate"><img alt="Scrutinizer" src="https://scrutinizer-ci.com/g/erivlis/graphinate/badges/quality-score.png?b=main"></a>
|
|
58
|
+
<a href="https://www.codefactor.io/repository/github/erivlis/graphinate"><img src="https://www.codefactor.io/repository/github/erivlis/graphinate/badge" alt="CodeFactor" /></a>
|
|
59
|
+
<a href="https://snyk.io/test/github/erivlis/graphinate"><img alt="Snyk" src="https://snyk.io/test/github/erivlis/Graphinate/badge.svg"></a>
|
|
54
60
|
</td>
|
|
55
61
|
</tr>
|
|
56
62
|
</table>
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
### What is Graphinate?
|
|
6
6
|
|
|
7
|
-
**Graphinate** is a python library that
|
|
7
|
+
**Graphinate** is a python library that can be used to generate Graph Data Structures from Data Sources.
|
|
8
8
|
|
|
9
9
|
It can help create an efficient retrieval pipeline from a given data source, while also enabling the developer to map
|
|
10
10
|
data payloads and hierarchies to a Graph.
|
|
11
11
|
|
|
12
12
|
In addition, there are several modes of output to enable examination of the Graph and its content.
|
|
13
13
|
|
|
14
|
-
**Graphinate**
|
|
14
|
+
**Graphinate** uses and is built upon the excellent [**_NetworkX_**](https://networkx.org/).
|
|
15
15
|
|
|
16
16
|
### What is a Graph?
|
|
17
17
|
|
|
@@ -35,10 +35,9 @@ formally.”
|
|
|
35
35
|
|
|
36
36
|
### A Graph as a Data Structure
|
|
37
37
|
|
|
38
|
-
A Graph
|
|
39
|
-
It is perhaps the simplest data structure, that is a bit more than just a
|
|
40
|
-
|
|
41
|
-
As such, it can be used to model all data sources that have structure.
|
|
38
|
+
A Graph can be a useful data structure.
|
|
39
|
+
It is, perhaps, the simplest data structure, that is a "bit more" than just a simple collection of "things".
|
|
40
|
+
As such, it can be used to model any data source that has structure.
|
|
42
41
|
|
|
43
42
|
### Graph Elements
|
|
44
43
|
|
|
@@ -47,14 +46,14 @@ A Graph consists of two types of elements:
|
|
|
47
46
|
#### Nodes
|
|
48
47
|
|
|
49
48
|
A Graph Node can be any Python Hashable object. Usually it will be a primitive type such as an integer or a string,
|
|
50
|
-
in particular when the node in itself has no
|
|
51
|
-
One can also add attributes to the node to describe additional information.
|
|
52
|
-
|
|
53
|
-
or stylistic information (e.g., color, size, shape, label etc.).
|
|
49
|
+
in particular when the node in itself has no specific meaning.
|
|
50
|
+
One can also add attributes to the node to describe additional information. This information can be anything.
|
|
51
|
+
Often attributes are used to store scalar dimensions (e.g., weight, area, width, age, etc.)
|
|
52
|
+
or stylistic information (e.g., color, size, shape, label, etc.).
|
|
54
53
|
|
|
55
54
|
#### Edges
|
|
56
55
|
|
|
57
|
-
A Graph Edge is a
|
|
56
|
+
A Graph Edge is a pair of two node values. It can also have additional attributes in the same vain as a Graph Node.
|
|
58
57
|
|
|
59
58
|
### Defining a Graph
|
|
60
59
|
|
|
@@ -62,13 +61,14 @@ One can define a Graph in two general ways:
|
|
|
62
61
|
|
|
63
62
|
#### Edge First
|
|
64
63
|
|
|
65
|
-
The most
|
|
66
|
-
|
|
67
|
-
definition to convey additional characteristics.
|
|
64
|
+
The most straightforward way to generate a Graph is to supply a list of edges. The simplest definition of an edge is a
|
|
65
|
+
pair of two values. Each value represents a node (or vertex) in the graph. Attributes may be added to the edge
|
|
66
|
+
definition to convey additional characteristics, such as weight, direction, etc.
|
|
68
67
|
|
|
69
68
|
In this case, one defines the **edges explicitly** and the **nodes implicitly**.
|
|
70
69
|
|
|
71
|
-
Such a graph is focused more on the _relationships_ between nodes or the _structure_ of the graph
|
|
70
|
+
Such a graph is focused more on the _relationships_ between nodes, or the _structure_ of the graph,
|
|
71
|
+
than on the nodes themselves.
|
|
72
72
|
|
|
73
73
|
#### Node First
|
|
74
74
|
|
|
@@ -78,33 +78,34 @@ relationships between the nodes.
|
|
|
78
78
|
|
|
79
79
|
In this case, **both nodes and the edges** are defined **explicitly**.
|
|
80
80
|
|
|
81
|
-
Such a graph
|
|
81
|
+
Such a graph may have a focus primarily on the nodes, and then only if needed on the relationship between them.
|
|
82
82
|
|
|
83
|
-
### Graphinate
|
|
83
|
+
### Graphinate
|
|
84
84
|
|
|
85
|
-
"Hydrate" a Graph from a Data Source.
|
|
86
|
-
Using Graphinate enables generating graphs from data sources.
|
|
85
|
+
Graphinate helps to generate graphs from data sources ("Hydrate" a Graph from a Data Source.)
|
|
87
86
|
It supports both *Edge First* and *Node First* creation scenarios.
|
|
88
87
|
|
|
89
|
-
This is achieved following
|
|
88
|
+
This is achieved the following way:
|
|
90
89
|
|
|
91
|
-
#### Source
|
|
90
|
+
#### Source
|
|
92
91
|
|
|
93
|
-
It is required to represent the
|
|
92
|
+
It is required to represent the data sources, as an Iterable of items that will be transformed, to graph edges
|
|
94
93
|
and/or nodes.
|
|
95
|
-
It is recommended to use Generators as the items Iterables.
|
|
94
|
+
It is recommended to use Generators as the items Iterables. This way, the data source can be lazy-loaded.
|
|
95
|
+
The Iterables or Generators can be anything, from a simple list of dictionaries to a complex database query.
|
|
96
96
|
|
|
97
97
|
#### Model
|
|
98
98
|
|
|
99
|
-
|
|
100
|
-
to
|
|
99
|
+
Graphinate introduces the concept of a Graph Model.
|
|
100
|
+
A Graph Model is a set of rules, that define how to transform the data source item into Graph elements (i.e. nodes and
|
|
101
|
+
edges). The GraphModel registers the sources using node and edge decorators.
|
|
101
102
|
|
|
102
103
|
#### Build
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
|
|
105
|
+
A Graph Model can be used to generate an actual instance of a Graph that contains the transformed source data.
|
|
106
|
+
Graphinate provides several GraphBuilder classes, that can be used to build the Graph from the Graph Model.
|
|
106
107
|
|
|
107
108
|
#### Materialize
|
|
108
109
|
|
|
109
|
-
Finally, we can use the builders to Materialize the graph in several ways that support different use cases
|
|
110
|
-
(i.e., visualizing, querying, reporting, etc.)
|
|
110
|
+
Finally, we can use the builders to Materialize the graph in several ways that support different use cases
|
|
111
|
+
(i.e., visualizing, querying, reporting, etc.).
|