Graphinate 0.7.0__tar.gz → 0.8.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.
Files changed (126) hide show
  1. {graphinate-0.7.0 → graphinate-0.8.0}/.github/workflows/codeql.yml +5 -5
  2. {graphinate-0.7.0 → graphinate-0.8.0}/PKG-INFO +81 -13
  3. {graphinate-0.7.0 → graphinate-0.8.0}/README.md +78 -11
  4. graphinate-0.8.0/docs/.dates_cache.json +86 -0
  5. {graphinate-0.7.0 → graphinate-0.8.0}/docs/examples/code.md +12 -7
  6. graphinate-0.8.0/docs/examples/web.md +35 -0
  7. {graphinate-0.7.0 → graphinate-0.8.0}/docs/gen_ref_pages.py +1 -1
  8. graphinate-0.8.0/docs/index.md +4 -0
  9. {graphinate-0.7.0 → graphinate-0.8.0}/docs/intro.md +18 -0
  10. {graphinate-0.7.0 → graphinate-0.8.0}/docs/start.md +10 -3
  11. graphinate-0.8.0/docs/tutorial.md +350 -0
  12. {graphinate-0.7.0 → graphinate-0.8.0}/docs/usage/cli.md +1 -1
  13. {graphinate-0.7.0 → graphinate-0.8.0}/docs/usage/lib.md +0 -7
  14. graphinate-0.8.0/examples/code/git_commits.py +59 -0
  15. {graphinate-0.7.0 → graphinate-0.8.0}/examples/code/python_ast.py +48 -7
  16. {graphinate-0.7.0 → graphinate-0.8.0}/examples/code/python_dependencies.py +2 -5
  17. {graphinate-0.7.0 → graphinate-0.8.0}/examples/code/requirements.txt +1 -0
  18. {graphinate-0.7.0 → graphinate-0.8.0}/examples/code/tokens.py +2 -5
  19. {graphinate-0.7.0 → graphinate-0.8.0}/examples/github/followers.py +4 -12
  20. {graphinate-0.7.0 → graphinate-0.8.0}/examples/github/repositories.py +2 -2
  21. graphinate-0.7.0/tests/graphinate/test_materializers.py → graphinate-0.8.0/examples/math/_test_materializers.py +10 -9
  22. {graphinate-0.7.0 → graphinate-0.8.0}/examples/math/graph_atlas.py +3 -2
  23. graphinate-0.7.0/src/graphinate/materializers/__init__.py → graphinate-0.8.0/examples/math/materializers.py +5 -9
  24. {graphinate-0.7.0 → graphinate-0.8.0}/examples/math/polygonal_graph.py +11 -24
  25. graphinate-0.8.0/examples/science/caffeine.py +44 -0
  26. {graphinate-0.7.0 → graphinate-0.8.0}/examples/social/music_artists.py +2 -5
  27. {graphinate-0.7.0 → graphinate-0.8.0}/examples/system/files.py +3 -5
  28. {graphinate-0.7.0 → graphinate-0.8.0}/examples/system/processes.py +11 -24
  29. {graphinate-0.7.0/examples/code → graphinate-0.8.0/examples/web}/html_dom.py +2 -6
  30. {graphinate-0.7.0 → graphinate-0.8.0}/examples/web/page_links.py +3 -8
  31. {graphinate-0.7.0 → graphinate-0.8.0}/mkdocs.yml +21 -13
  32. {graphinate-0.7.0 → graphinate-0.8.0}/pyproject.toml +19 -5
  33. {graphinate-0.7.0 → graphinate-0.8.0}/src/graphinate/__init__.py +6 -5
  34. {graphinate-0.7.0 → graphinate-0.8.0}/src/graphinate/builders.py +30 -1
  35. {graphinate-0.7.0 → graphinate-0.8.0}/src/graphinate/cli.py +10 -13
  36. {graphinate-0.7.0 → graphinate-0.8.0}/src/graphinate/color.py +5 -0
  37. {graphinate-0.7.0 → graphinate-0.8.0}/src/graphinate/constants.py +2 -0
  38. graphinate-0.8.0/src/graphinate/renderers/__init__.py +5 -0
  39. graphinate-0.7.0/src/graphinate/server/__init__.py → graphinate-0.8.0/src/graphinate/renderers/graphql.py +12 -14
  40. {graphinate-0.7.0/src/graphinate/materializers → graphinate-0.8.0/src/graphinate/renderers}/matplotlib.py +5 -3
  41. graphinate-0.8.0/src/graphinate/server/web/viewer/__init__.py +0 -0
  42. graphinate-0.8.0/src/graphinate/server/web/voyager/__init__.py +0 -0
  43. graphinate-0.7.0/.coveragerc +0 -3
  44. graphinate-0.7.0/STATS.md +0 -18
  45. graphinate-0.7.0/docs/dev.md +0 -35
  46. graphinate-0.7.0/docs/examples/web.md +0 -18
  47. graphinate-0.7.0/docs/index.md +0 -69
  48. {graphinate-0.7.0 → graphinate-0.8.0}/.github/dependabot.yml +0 -0
  49. {graphinate-0.7.0 → graphinate-0.8.0}/.github/workflows/publish-docs.yaml +0 -0
  50. {graphinate-0.7.0 → graphinate-0.8.0}/.github/workflows/publish.yml +0 -0
  51. {graphinate-0.7.0 → graphinate-0.8.0}/.github/workflows/test-beta.yml +0 -0
  52. {graphinate-0.7.0 → graphinate-0.8.0}/.github/workflows/test.yml +0 -0
  53. {graphinate-0.7.0 → graphinate-0.8.0}/.gitignore +0 -0
  54. {graphinate-0.7.0 → graphinate-0.8.0}/.sonarcloud.properties +0 -0
  55. {graphinate-0.7.0 → graphinate-0.8.0}/LICENSE +0 -0
  56. {graphinate-0.7.0 → graphinate-0.8.0}/docs/acknowledge.md +0 -0
  57. {graphinate-0.7.0 → graphinate-0.8.0}/docs/assets/badge/v0.json +0 -0
  58. {graphinate-0.7.0 → graphinate-0.8.0}/docs/assets/images/logo-128.png +0 -0
  59. {graphinate-0.7.0 → graphinate-0.8.0}/docs/assets/images/network_graph.png +0 -0
  60. {graphinate-0.7.0 → graphinate-0.8.0}/docs/assets/stylesheets/extra.css +0 -0
  61. {graphinate-0.7.0 → graphinate-0.8.0}/docs/examples/github.md +0 -0
  62. {graphinate-0.7.0 → graphinate-0.8.0}/docs/examples/math.md +0 -0
  63. {graphinate-0.7.0 → graphinate-0.8.0}/docs/examples/social.md +0 -0
  64. {graphinate-0.7.0 → graphinate-0.8.0}/docs/examples/system.md +0 -0
  65. {graphinate-0.7.0 → graphinate-0.8.0}/examples/github/_client.py +0 -0
  66. {graphinate-0.7.0 → graphinate-0.8.0}/examples/github/commits_visibilty_graph.py +0 -0
  67. {graphinate-0.7.0 → graphinate-0.8.0}/examples/github/followers.graphql +0 -0
  68. {graphinate-0.7.0 → graphinate-0.8.0}/examples/github/graphql.config.yml +0 -0
  69. {graphinate-0.7.0 → graphinate-0.8.0}/examples/github/repositories.graphql +0 -0
  70. {graphinate-0.7.0 → graphinate-0.8.0}/examples/github/requirements.txt +0 -0
  71. {graphinate-0.7.0/src/graphinate/server/web/elements → graphinate-0.8.0/examples/math}/__init__.py +0 -0
  72. {graphinate-0.7.0 → graphinate-0.8.0}/examples/math/graphs.py +0 -0
  73. {graphinate-0.7.0 → graphinate-0.8.0}/examples/math/gui.py +0 -0
  74. {graphinate-0.7.0 → graphinate-0.8.0}/examples/math/requirements.txt +0 -0
  75. {graphinate-0.7.0 → graphinate-0.8.0}/examples/social/cache/13/dd/73ce25face7beb30b69b64feeb77.val +0 -0
  76. {graphinate-0.7.0 → graphinate-0.8.0}/examples/social/cache/21/9e/00846f323987ba16cfbe0127d8eb.val +0 -0
  77. {graphinate-0.7.0 → graphinate-0.8.0}/examples/social/cache/70/b6/2aefb0269adce7fedf877fa0d267.val +0 -0
  78. {graphinate-0.7.0 → graphinate-0.8.0}/examples/social/cache/87/f5/ec1739bc369e84c3fcb302bf532a.val +0 -0
  79. {graphinate-0.7.0 → graphinate-0.8.0}/examples/social/cache/ba/fe/3aca7b2c38abff60e7ce5eb486a8.val +0 -0
  80. {graphinate-0.7.0 → graphinate-0.8.0}/examples/social/cache/c7/9e/ce82b0288020b7152779df09bd73.val +0 -0
  81. {graphinate-0.7.0 → graphinate-0.8.0}/examples/social/cache/cache.db +0 -0
  82. {graphinate-0.7.0 → graphinate-0.8.0}/examples/social/cache/d2/53/3b88f2fc162561cfdbbe9abc352a.val +0 -0
  83. {graphinate-0.7.0 → graphinate-0.8.0}/examples/social/cache/e2/d5/5d079f200eabf9b625b0473f6fbe.val +0 -0
  84. {graphinate-0.7.0 → graphinate-0.8.0}/examples/social/gui.py +0 -0
  85. {graphinate-0.7.0 → graphinate-0.8.0}/examples/social/requirements.txt +0 -0
  86. {graphinate-0.7.0 → graphinate-0.8.0}/examples/system/.ignore +0 -0
  87. {graphinate-0.7.0 → graphinate-0.8.0}/examples/system/requirements.txt +0 -0
  88. {graphinate-0.7.0 → graphinate-0.8.0}/examples/web/requirements.txt +0 -0
  89. {graphinate-0.7.0 → graphinate-0.8.0}/playground/ethernet/traceroute.py +0 -0
  90. {graphinate-0.7.0 → graphinate-0.8.0}/playground/genric_graph.graphql +0 -0
  91. {graphinate-0.7.0 → graphinate-0.8.0}/playground/graphql.config.yml +0 -0
  92. {graphinate-0.7.0 → graphinate-0.8.0}/playground/house_of_graphs.py +0 -0
  93. {graphinate-0.7.0 → graphinate-0.8.0}/playground/social/albums.json +0 -0
  94. {graphinate-0.7.0 → graphinate-0.8.0}/playground/social/musicisians.py +0 -0
  95. {graphinate-0.7.0 → graphinate-0.8.0}/playground/text/nlp_graph.py +0 -0
  96. {graphinate-0.7.0 → graphinate-0.8.0}/playground/text/requirements.txt +0 -0
  97. {graphinate-0.7.0 → graphinate-0.8.0}/playground/time_series/requirements.txt +0 -0
  98. {graphinate-0.7.0 → graphinate-0.8.0}/playground/time_series/visibility_graph.py +0 -0
  99. {graphinate-0.7.0 → graphinate-0.8.0}/sonar-project.properties +0 -0
  100. {graphinate-0.7.0 → graphinate-0.8.0}/src/graphinate/__main__.py +0 -0
  101. {graphinate-0.7.0 → graphinate-0.8.0}/src/graphinate/converters.py +0 -0
  102. {graphinate-0.7.0 → graphinate-0.8.0}/src/graphinate/modeling.py +0 -0
  103. {graphinate-0.7.0/src/graphinate/server/web/graphiql → graphinate-0.8.0/src/graphinate/server}/__init__.py +0 -0
  104. {graphinate-0.7.0 → graphinate-0.8.0}/src/graphinate/server/starlette/__init__.py +0 -0
  105. {graphinate-0.7.0 → graphinate-0.8.0}/src/graphinate/server/starlette/views.py +0 -0
  106. {graphinate-0.7.0 → graphinate-0.8.0}/src/graphinate/server/web/__init__.py +0 -0
  107. {graphinate-0.7.0/src/graphinate/server/web/rapidoc → graphinate-0.8.0/src/graphinate/server/web/elements}/__init__.py +0 -0
  108. {graphinate-0.7.0 → graphinate-0.8.0}/src/graphinate/server/web/elements/index.html +0 -0
  109. {graphinate-0.7.0/src/graphinate/server/web/viewer → graphinate-0.8.0/src/graphinate/server/web/graphiql}/__init__.py +0 -0
  110. {graphinate-0.7.0 → graphinate-0.8.0}/src/graphinate/server/web/graphiql/index.html +0 -0
  111. {graphinate-0.7.0/src/graphinate/server/web/voyager → graphinate-0.8.0/src/graphinate/server/web/rapidoc}/__init__.py +0 -0
  112. {graphinate-0.7.0 → graphinate-0.8.0}/src/graphinate/server/web/rapidoc/index.html +0 -0
  113. {graphinate-0.7.0 → graphinate-0.8.0}/src/graphinate/server/web/static/images/logo-128.png +0 -0
  114. {graphinate-0.7.0 → graphinate-0.8.0}/src/graphinate/server/web/static/images/logo.svg +0 -0
  115. {graphinate-0.7.0 → graphinate-0.8.0}/src/graphinate/server/web/static/images/network_graph.png +0 -0
  116. {graphinate-0.7.0 → graphinate-0.8.0}/src/graphinate/server/web/viewer/index.html +0 -0
  117. {graphinate-0.7.0 → graphinate-0.8.0}/src/graphinate/server/web/voyager/index.html +0 -0
  118. {graphinate-0.7.0 → graphinate-0.8.0}/src/graphinate/tools.py +0 -0
  119. {graphinate-0.7.0 → graphinate-0.8.0}/src/graphinate/typing.py +0 -0
  120. {graphinate-0.7.0 → graphinate-0.8.0}/tests/conftest.py +0 -0
  121. {graphinate-0.7.0 → graphinate-0.8.0}/tests/graphinate/test_builders.py +0 -0
  122. {graphinate-0.7.0 → graphinate-0.8.0}/tests/graphinate/test_cli.py +0 -0
  123. {graphinate-0.7.0 → graphinate-0.8.0}/tests/graphinate/test_color.py +0 -0
  124. {graphinate-0.7.0 → graphinate-0.8.0}/tests/graphinate/test_converters.py +0 -0
  125. {graphinate-0.7.0 → graphinate-0.8.0}/tests/graphinate/test_modeling.py +0 -0
  126. {graphinate-0.7.0 → graphinate-0.8.0}/tests/graphinate/test_server.py +0 -0
@@ -13,10 +13,10 @@ name: "CodeQL"
13
13
 
14
14
  on:
15
15
  push:
16
- branches: [ "master" ]
16
+ branches: [ "main" ]
17
17
  pull_request:
18
18
  # The branches below must be a subset of the branches above
19
- branches: [ "master" ]
19
+ branches: [ "main" ]
20
20
  schedule:
21
21
  - cron: '44 6 * * 4'
22
22
 
@@ -50,7 +50,7 @@ jobs:
50
50
 
51
51
  # Initializes the CodeQL tools for scanning.
52
52
  - name: Initialize CodeQL
53
- uses: github/codeql-action/init@v2
53
+ uses: github/codeql-action/init@v3
54
54
  with:
55
55
  languages: ${{ matrix.language }}
56
56
  # If you wish to specify custom queries, you can do so here or in a config file.
@@ -64,7 +64,7 @@ jobs:
64
64
  # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
65
65
  # If this step fails, then you should remove it and run the build manually (see below)
66
66
  - name: Autobuild
67
- uses: github/codeql-action/autobuild@v2
67
+ uses: github/codeql-action/autobuild@v3
68
68
 
69
69
  # ℹ️ Command-line programs to run using the OS shell.
70
70
  # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -77,6 +77,6 @@ jobs:
77
77
  # ./location_of_script_within_repo/buildscript.sh
78
78
 
79
79
  - name: Perform CodeQL Analysis
80
- uses: github/codeql-action/analyze@v2
80
+ uses: github/codeql-action/analyze@v3
81
81
  with:
82
82
  category: "/language:${{matrix.language}}"
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Graphinate
3
- Version: 0.7.0
4
- Summary: 𝔾raphinate. Data to Graphs.
3
+ Version: 0.8.0
4
+ Summary: Graphinate. 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
@@ -33,6 +33,7 @@ Requires-Dist: loguru
33
33
  Requires-Dist: mappingtools
34
34
  Requires-Dist: matplotlib
35
35
  Requires-Dist: networkx
36
+ Requires-Dist: networkx-mermaid>=0.1.0
36
37
  Requires-Dist: strawberry-graphql[asgi,opentelemetry]
37
38
  Provides-Extra: plot
38
39
  Requires-Dist: scipy; extra == 'plot'
@@ -41,7 +42,7 @@ Requires-Dist: starlette-prometheus; extra == 'server'
41
42
  Requires-Dist: uvicorn[standard]; extra == 'server'
42
43
  Description-Content-Type: text/markdown
43
44
 
44
- # [𝔾raphinate. Data to Graphs.](https://erivlis.github.io/graphinate/)
45
+ # [Graphinate. Data to Graphs.](https://erivlis.github.io/graphinate/)
45
46
 
46
47
  <img height="360" src="https://github.com/erivlis/graphinate/assets/9897520/dae41f9f-69e5-4eb5-a488-87ce7f51fa32" alt="Graphinate. Data to Graphs.">
47
48
 
@@ -118,6 +119,38 @@ Description-Content-Type: text/markdown
118
119
  </tr>
119
120
  </table>
120
121
 
122
+ ## Table of Contents
123
+
124
+ - [Introduction](#introduction)
125
+ - [What is Graphinate?](#what-is-graphinate)
126
+ - [Links](#links)
127
+ - [Quick Start](#quick-start)
128
+ - [Install](#install)
129
+ - [Example](#example)
130
+ - [CLI](#cli)
131
+ - [Commands](#commands)
132
+ - [Save](#save)
133
+ - [Server](#server)
134
+ - [Gallery](#gallery)
135
+ - [Python AST](#python-ast)
136
+ - [GitHub Repository](#github-repository)
137
+ - [Python AST - 3D Force-Directed Animation](#python-ast---3d-force-directed-animation)
138
+ - [Web Page Links](#web-page-links)
139
+ - [Development](#development)
140
+ - [Ruff](#ruff)
141
+ - [Test](#test)
142
+ - [Standard (cobertura) XML Coverage Report](#standard-cobertura-xml-coverage-report)
143
+ - [HTML Coverage Report](#html-coverage-report)
144
+ - [Docs](#docs)
145
+ - [test](#test-1)
146
+ - [build](#build)
147
+ - [Acknowledgements](#acknowledgements)
148
+ - [Dependencies](#dependencies)
149
+ - [Python](#python)
150
+ - [Javascript and HTML](#javascript-and-html)
151
+ - [Dev Tools](#dev-tools)
152
+ - [IDE](#ide)
153
+
121
154
  ## Introduction
122
155
 
123
156
  ### What is Graphinate?
@@ -158,6 +191,7 @@ pip install graphinate[server]
158
191
  ### Example
159
192
 
160
193
  ```python title="Octagonal Graph"
194
+ import examples.math.materializers
161
195
  import graphinate
162
196
 
163
197
  N: int = 8
@@ -175,10 +209,16 @@ def edge():
175
209
 
176
210
 
177
211
  # Choose builder and handler
178
- builder, handler = graphinate.materializers.Materializers.NetworkX_with_edge_labels.value
212
+ builder, handler = examples.math.materializers.Materializers.NetworkX_with_edge_labels.value
213
+
214
+ # Use the NetworkX Builder
215
+ builder = graphinate.builders.NetworkxBuilder(graph_model)
179
216
 
180
- # Materialize the GraphModel
181
- graphinate.materialize(graph_model, builder=builder, builder_output_handler=handler)
217
+ # build the NetworkX graph
218
+ graph = builder.build()
219
+
220
+ # plot the graph using matplotlib
221
+ graphinate.plot(graph, with_edge_labels=True)
182
222
  ```
183
223
 
184
224
  #### `graphinate.model` function
@@ -187,11 +227,6 @@ graphinate.materialize(graph_model, builder=builder, builder_output_handler=hand
187
227
  > This function creates `GraphModel` class that is used to declaratively register _Edge_ and/or _Node_ data
188
228
  > supplier functions by using the `GraphModel.node()` and `GraphModel.edge()` decorators.
189
229
 
190
- #### `graphinate.materialize` function
191
-
192
- > [!NOTE]
193
- > This function can be used to easily generate an output from a `GraphModel` instance.
194
-
195
230
  ## CLI
196
231
 
197
232
  ### Commands
@@ -258,12 +293,35 @@ Options:
258
293
 
259
294
  ## Development
260
295
 
296
+ ### Install dependencies
297
+
298
+ Use UV to install all dependencies
299
+
300
+ ```shell
301
+ uv sync --all-extras --all-groups
302
+ ```
303
+
304
+ ### Update dependencies
305
+
306
+ ```shell
307
+ uv lock --upgrade
308
+ uv sync --all-extras --all-groups
309
+ ```
310
+
261
311
  ### Ruff
262
312
 
313
+ #### Report issues
314
+
263
315
  ```shell
264
316
  ruff check src
265
317
  ```
266
318
 
319
+ #### Fix issues
320
+
321
+ ```shell
322
+ ruff check src --fix
323
+ ```
324
+
267
325
  ### Test
268
326
 
269
327
  #### Standard (cobertura) XML Coverage Report
@@ -278,6 +336,12 @@ ruff check src
278
336
  python -m pytest tests -n auto --cov=src --cov-branch --doctest-modules --cov-report=html --junitxml=test_results.xml
279
337
  ```
280
338
 
339
+ #### Terminal Coverage Report
340
+
341
+ ```shell
342
+ python -m pytest tests -n auto --cov=src --cov-branch --doctest-modules --cov-report=term --junitxml=test_results.xml
343
+ ```
344
+
281
345
  ### Docs
282
346
 
283
347
  #### test
@@ -322,8 +386,12 @@ python -m mkdocs build
322
386
 
323
387
  <a href="https://www.jetbrains.com/pycharm/"><img height="60" style="background: linear-gradient(-45deg, #FCF84A, #3DEA62, #21D789);" src="https://resources.jetbrains.com/storage/products/company/brand/logos/PyCharm.png" alt="PyCharm logo"></a>
324
388
 
325
- ---------------------
389
+ --------------------------------
390
+
391
+ ![Alt](https://repobeats.axiom.co/api/embed/683f50f1d2de0e13e468c34a692612c2de4d56bd.svg "Repobeats analytics image")
392
+
393
+ --------------------------------
326
394
 
327
395
  <img alt="Star Chart" src="https://forthebadge.com/images/badges/works-on-my-machine.svg">
328
396
 
329
- Copyright © 2023 Eran Rivlis
397
+ Copyright © 2023-2025 Eran Rivlis
@@ -1,4 +1,4 @@
1
- # [𝔾raphinate. Data to Graphs.](https://erivlis.github.io/graphinate/)
1
+ # [Graphinate. 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
 
@@ -75,6 +75,38 @@
75
75
  </tr>
76
76
  </table>
77
77
 
78
+ ## Table of Contents
79
+
80
+ - [Introduction](#introduction)
81
+ - [What is Graphinate?](#what-is-graphinate)
82
+ - [Links](#links)
83
+ - [Quick Start](#quick-start)
84
+ - [Install](#install)
85
+ - [Example](#example)
86
+ - [CLI](#cli)
87
+ - [Commands](#commands)
88
+ - [Save](#save)
89
+ - [Server](#server)
90
+ - [Gallery](#gallery)
91
+ - [Python AST](#python-ast)
92
+ - [GitHub Repository](#github-repository)
93
+ - [Python AST - 3D Force-Directed Animation](#python-ast---3d-force-directed-animation)
94
+ - [Web Page Links](#web-page-links)
95
+ - [Development](#development)
96
+ - [Ruff](#ruff)
97
+ - [Test](#test)
98
+ - [Standard (cobertura) XML Coverage Report](#standard-cobertura-xml-coverage-report)
99
+ - [HTML Coverage Report](#html-coverage-report)
100
+ - [Docs](#docs)
101
+ - [test](#test-1)
102
+ - [build](#build)
103
+ - [Acknowledgements](#acknowledgements)
104
+ - [Dependencies](#dependencies)
105
+ - [Python](#python)
106
+ - [Javascript and HTML](#javascript-and-html)
107
+ - [Dev Tools](#dev-tools)
108
+ - [IDE](#ide)
109
+
78
110
  ## Introduction
79
111
 
80
112
  ### What is Graphinate?
@@ -115,6 +147,7 @@ pip install graphinate[server]
115
147
  ### Example
116
148
 
117
149
  ```python title="Octagonal Graph"
150
+ import examples.math.materializers
118
151
  import graphinate
119
152
 
120
153
  N: int = 8
@@ -132,10 +165,16 @@ def edge():
132
165
 
133
166
 
134
167
  # Choose builder and handler
135
- builder, handler = graphinate.materializers.Materializers.NetworkX_with_edge_labels.value
168
+ builder, handler = examples.math.materializers.Materializers.NetworkX_with_edge_labels.value
169
+
170
+ # Use the NetworkX Builder
171
+ builder = graphinate.builders.NetworkxBuilder(graph_model)
136
172
 
137
- # Materialize the GraphModel
138
- graphinate.materialize(graph_model, builder=builder, builder_output_handler=handler)
173
+ # build the NetworkX graph
174
+ graph = builder.build()
175
+
176
+ # plot the graph using matplotlib
177
+ graphinate.plot(graph, with_edge_labels=True)
139
178
  ```
140
179
 
141
180
  #### `graphinate.model` function
@@ -144,11 +183,6 @@ graphinate.materialize(graph_model, builder=builder, builder_output_handler=hand
144
183
  > This function creates `GraphModel` class that is used to declaratively register _Edge_ and/or _Node_ data
145
184
  > supplier functions by using the `GraphModel.node()` and `GraphModel.edge()` decorators.
146
185
 
147
- #### `graphinate.materialize` function
148
-
149
- > [!NOTE]
150
- > This function can be used to easily generate an output from a `GraphModel` instance.
151
-
152
186
  ## CLI
153
187
 
154
188
  ### Commands
@@ -215,12 +249,35 @@ Options:
215
249
 
216
250
  ## Development
217
251
 
252
+ ### Install dependencies
253
+
254
+ Use UV to install all dependencies
255
+
256
+ ```shell
257
+ uv sync --all-extras --all-groups
258
+ ```
259
+
260
+ ### Update dependencies
261
+
262
+ ```shell
263
+ uv lock --upgrade
264
+ uv sync --all-extras --all-groups
265
+ ```
266
+
218
267
  ### Ruff
219
268
 
269
+ #### Report issues
270
+
220
271
  ```shell
221
272
  ruff check src
222
273
  ```
223
274
 
275
+ #### Fix issues
276
+
277
+ ```shell
278
+ ruff check src --fix
279
+ ```
280
+
224
281
  ### Test
225
282
 
226
283
  #### Standard (cobertura) XML Coverage Report
@@ -235,6 +292,12 @@ ruff check src
235
292
  python -m pytest tests -n auto --cov=src --cov-branch --doctest-modules --cov-report=html --junitxml=test_results.xml
236
293
  ```
237
294
 
295
+ #### Terminal Coverage Report
296
+
297
+ ```shell
298
+ python -m pytest tests -n auto --cov=src --cov-branch --doctest-modules --cov-report=term --junitxml=test_results.xml
299
+ ```
300
+
238
301
  ### Docs
239
302
 
240
303
  #### test
@@ -279,8 +342,12 @@ python -m mkdocs build
279
342
 
280
343
  <a href="https://www.jetbrains.com/pycharm/"><img height="60" style="background: linear-gradient(-45deg, #FCF84A, #3DEA62, #21D789);" src="https://resources.jetbrains.com/storage/products/company/brand/logos/PyCharm.png" alt="PyCharm logo"></a>
281
344
 
282
- ---------------------
345
+ --------------------------------
346
+
347
+ ![Alt](https://repobeats.axiom.co/api/embed/683f50f1d2de0e13e468c34a692612c2de4d56bd.svg "Repobeats analytics image")
348
+
349
+ --------------------------------
283
350
 
284
351
  <img alt="Star Chart" src="https://forthebadge.com/images/badges/works-on-my-machine.svg">
285
352
 
286
- Copyright © 2023 Eran Rivlis
353
+ Copyright © 2023-2025 Eran Rivlis
@@ -0,0 +1,86 @@
1
+ {
2
+ "acknowledge.md": {
3
+ "created": "2023-08-20T00:21:55.621436",
4
+ "modified": "2024-07-23T19:55:37.245608"
5
+ },
6
+ "index.md": {
7
+ "created": "2023-08-15T00:05:21.586874",
8
+ "modified": "2025-03-08T22:16:20.899386"
9
+ },
10
+ "intro.md": {
11
+ "created": "2023-08-19T23:54:18.668094",
12
+ "modified": "2025-03-07T10:45:53.488431"
13
+ },
14
+ "start.md": {
15
+ "created": "2023-08-20T00:07:42.683716",
16
+ "modified": "2025-03-02T01:05:03.715683"
17
+ },
18
+ "tutorial.md": {
19
+ "created": "2025-02-26T00:03:30.194156",
20
+ "modified": "2025-03-07T12:16:22.526422"
21
+ },
22
+ "examples\\code.md": {
23
+ "created": "2023-08-20T00:09:32.677003",
24
+ "modified": "2025-03-07T10:14:05.629365"
25
+ },
26
+ "examples\\github.md": {
27
+ "created": "2023-10-05T11:43:15.316025",
28
+ "modified": "2025-01-28T23:47:41.840220"
29
+ },
30
+ "examples\\math.md": {
31
+ "created": "2023-10-05T11:43:22.861997",
32
+ "modified": "2025-01-28T23:54:42.968373"
33
+ },
34
+ "examples\\social.md": {
35
+ "created": "2025-02-24T23:49:35.972953",
36
+ "modified": "2025-02-24T23:51:09.584738"
37
+ },
38
+ "examples\\system.md": {
39
+ "created": "2024-03-27T01:28:38.922865",
40
+ "modified": "2024-03-27T01:51:20.126046"
41
+ },
42
+ "examples\\web.md": {
43
+ "created": "2023-10-05T11:43:30.550657",
44
+ "modified": "2025-03-07T10:25:30.054257"
45
+ },
46
+ "reference\\SUMMARY.md": {
47
+ "created": "2025-03-08T20:51:52.801367",
48
+ "modified": "2025-03-08T20:51:52.807370"
49
+ },
50
+ "usage\\cli.md": {
51
+ "created": "2023-09-27T21:23:44.140564",
52
+ "modified": "2025-03-01T23:56:33.595498"
53
+ },
54
+ "usage\\lib.md": {
55
+ "created": "2023-09-27T21:23:44.133584",
56
+ "modified": "2025-03-07T12:07:02.708943"
57
+ },
58
+ "reference\\graphinate\\builders.md": {
59
+ "created": "2025-03-08T20:51:52.788270",
60
+ "modified": "2025-03-08T20:51:52.792269"
61
+ },
62
+ "reference\\graphinate\\index.md": {
63
+ "created": "2025-03-08T20:51:52.786270",
64
+ "modified": "2025-03-08T20:51:52.788270"
65
+ },
66
+ "reference\\graphinate\\modeling.md": {
67
+ "created": "2025-03-08T20:51:52.792269",
68
+ "modified": "2025-03-08T20:51:52.795269"
69
+ },
70
+ "reference\\graphinate\\typing.md": {
71
+ "created": "2025-03-08T20:51:52.800360",
72
+ "modified": "2025-03-08T20:51:52.805368"
73
+ },
74
+ "reference\\graphinate\\renderers\\graphql.md": {
75
+ "created": "2025-03-08T20:51:52.796358",
76
+ "modified": "2025-03-08T20:51:52.800360"
77
+ },
78
+ "reference\\graphinate\\renderers\\index.md": {
79
+ "created": "2025-03-08T20:51:52.794269",
80
+ "modified": "2025-03-08T20:51:52.798361"
81
+ },
82
+ "reference\\graphinate\\renderers\\matplotlib.md": {
83
+ "created": "2025-03-08T20:51:52.798361",
84
+ "modified": "2025-03-08T20:51:52.803367"
85
+ }
86
+ }
@@ -1,10 +1,20 @@
1
1
  # Code
2
2
 
3
+ ## GIT Commits
4
+
5
+ === "GIT Commits"
6
+
7
+ ``` python title="examples/code/git_commits.py" linenums="1"
8
+ --8<-- "examples/code/git_commits.py"
9
+ ```
10
+
11
+ ---
12
+
3
13
  ## Python AST
4
14
 
5
15
  === "Python AST"
6
16
 
7
- ``` python title="examples/code/python_ast.py" linenums="1"
17
+ ```python title="examples/code/python_ast.py" linenums="1"
8
18
  --8<-- "examples/code/python_ast.py"
9
19
  ```
10
20
 
@@ -24,12 +34,7 @@
24
34
 
25
35
  === "Python Dependencies"
26
36
 
27
- ``` python title="examples/code/python_dependencies.py" linenums="1"
37
+ ```python title="examples/code/python_dependencies.py" linenums="1"
28
38
  --8<-- "examples/code/python_dependencies.py"
29
39
  ```
30
40
 
31
- === "Requirements"
32
-
33
- ``` text title="examples/code/requirements.txt" linenums="1"
34
- --8<-- "examples/code/requirements.txt"
35
- ```
@@ -0,0 +1,35 @@
1
+ # Web
2
+
3
+ ## Web Page Links
4
+
5
+ === "Web Page Links"
6
+
7
+ ``` python title="examples/web/page_links.py" linenums="1"
8
+ --8<-- "examples/web/page_links.py"
9
+ ```
10
+
11
+ === "Dependencies"
12
+
13
+ ``` text title="examples/web/requirements.txt" linenums="1"
14
+ --8<-- "examples/web/requirements.txt"
15
+ ```
16
+
17
+ === "Plot"
18
+
19
+ ![Web Page Links](https://github.com/erivlis/graphinate/assets/9897520/ea5b00a2-75d1-4d0e-86af-272f20973149)
20
+
21
+ ---
22
+
23
+ ## HTML DOM
24
+
25
+ === "HTML DOM"
26
+
27
+ ``` python title="examples/web/html_dom.py" linenums="1"
28
+ --8<-- "examples/web/html_page_dom.py"
29
+ ```
30
+
31
+ === "Dependencies"
32
+
33
+ ``` text title="examples/web/requirements.txt" linenums="1"
34
+ --8<-- "examples/web/requirements.txt"
35
+ ```
@@ -6,7 +6,7 @@ import mkdocs_gen_files
6
6
 
7
7
  nav = mkdocs_gen_files.Nav()
8
8
 
9
- ignore = ('server', 'cli.py', 'color.py', 'tools')
9
+ ignore = ('cli.py', 'color.py', 'converters.py', 'constants.py', 'server', 'tools')
10
10
 
11
11
  for path in sorted(Path("src").rglob("*.py")):
12
12
  if any(v in path.as_posix() for v in ignore):
@@ -0,0 +1,4 @@
1
+ # Graphinate. Data to Graphs.
2
+
3
+ <img height="360" src="https://github.com/erivlis/graphinate/assets/9897520/dae41f9f-69e5-4eb5-a488-87ce7f51fa32" alt="Graphinate. Data to Graphs.">
4
+
@@ -1,5 +1,18 @@
1
1
  # Introduction
2
2
 
3
+ ## Why?
4
+
5
+ ### Why Graphs?
6
+
7
+ Graphs are a powerful data structure that can be used to model a wide range of problems.
8
+ They are used in many fields, such as computer science, mathematics, physics, biology, and social sciences.
9
+
10
+ ### Why Graphinate?
11
+
12
+ Usually the creation phase of a Graph is a tedious and error-prone process.
13
+ It requires a lot of boilerplate code to transform data into a Graph.
14
+ This process can be automated and simplified. This is where **Graphinate** comes in.
15
+
3
16
  ## What?
4
17
 
5
18
  ### What is Graphinate?
@@ -51,14 +64,19 @@ A Graph consists of two types of elements:
51
64
 
52
65
  A Graph Node can be any Python Hashable object. Usually it will be a primitive type such as an integer or a string,
53
66
  in particular when the node in itself has no specific meaning.
67
+
54
68
  One can also add attributes to the node to describe additional information. This information can be anything.
55
69
  Often attributes are used to store scalar dimensions (e.g., weight, area, width, age, etc.)
56
70
  or stylistic information (e.g., color, size, shape, label, etc.).
57
71
 
72
+ Nodes are usually visualized as circles or points.
73
+
58
74
  #### Edges
59
75
 
60
76
  A Graph Edge is a pair of two node values. It can also have additional attributes in the same vain as a Graph Node.
61
77
 
78
+ Edges are usually visualized as lines connecting two nodes.
79
+
62
80
  ### Defining a Graph
63
81
 
64
82
  One can define a Graph in two general ways:
@@ -23,6 +23,7 @@ pip install graphinate[server]
23
23
  ## Demo
24
24
 
25
25
  ```python title="Octagonal Graph"
26
+ import examples.math.materializers
26
27
  import graphinate
27
28
 
28
29
  N: int = 8
@@ -40,8 +41,14 @@ def edge():
40
41
 
41
42
 
42
43
  # Choose builder and handler
43
- builder, handler = graphinate.materializers.Materializers.NetworkX_with_edge_labels.value
44
+ builder, handler = examples.math.materializers.Materializers.NetworkX_with_edge_labels.value
44
45
 
45
- # Materialize the GraphModel
46
- graphinate.materialize(graph_model, builder=builder, builder_output_handler=handler)
46
+ # Use the NetworkX Builder
47
+ builder = graphinate.builders.NetworkxBuilder(graph_model)
48
+
49
+ # build the NetworkX graph
50
+ graph = builder.build()
51
+
52
+ # plot the graph using matplotlib
53
+ graphinate.plot(graph, with_edge_labels=True)
47
54
  ```