Graphinate 0.8.0__tar.gz → 0.8.2__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.8.2/.coveragerc +3 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/.github/workflows/publish-docs.yaml +1 -1
- {graphinate-0.8.0 → graphinate-0.8.2}/.github/workflows/test-beta.yml +1 -1
- {graphinate-0.8.0 → graphinate-0.8.2}/.github/workflows/test.yml +6 -1
- {graphinate-0.8.0 → graphinate-0.8.2}/PKG-INFO +63 -51
- {graphinate-0.8.0 → graphinate-0.8.2}/README.md +62 -50
- {graphinate-0.8.0 → graphinate-0.8.2}/docs/.dates_cache.json +8 -8
- {graphinate-0.8.0 → graphinate-0.8.2}/docs/acknowledge.md +8 -5
- graphinate-0.8.2/docs/examples/social.md +15 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/docs/examples/web.md +1 -1
- graphinate-0.8.2/docs/index.md +4 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/docs/intro.md +35 -28
- graphinate-0.8.2/docs/start.md +76 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/docs/tutorial.md +44 -49
- {graphinate-0.8.0 → graphinate-0.8.2}/docs/usage/lib.md +5 -12
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/code/git_commits.py +1 -1
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/math/materializers.py +1 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/mkdocs.yml +1 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/pyproject.toml +1 -15
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/builders.py +9 -7
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/converters.py +19 -15
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/modeling.py +4 -4
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/renderers/graphql.py +34 -18
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/server/web/viewer/index.html +10 -6
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/typing.py +4 -4
- {graphinate-0.8.0 → graphinate-0.8.2}/tests/graphinate/test_builders.py +15 -1
- graphinate-0.8.0/docs/examples/social.md +0 -15
- graphinate-0.8.0/docs/index.md +0 -4
- graphinate-0.8.0/docs/start.md +0 -54
- {graphinate-0.8.0 → graphinate-0.8.2}/.github/dependabot.yml +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/.github/workflows/codeql.yml +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/.github/workflows/publish.yml +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/.gitignore +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/.sonarcloud.properties +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/LICENSE +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/docs/assets/badge/v0.json +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/docs/assets/images/logo-128.png +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/docs/assets/images/network_graph.png +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/docs/assets/stylesheets/extra.css +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/docs/examples/code.md +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/docs/examples/github.md +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/docs/examples/math.md +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/docs/examples/system.md +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/docs/gen_ref_pages.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/docs/usage/cli.md +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/code/python_ast.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/code/python_dependencies.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/code/requirements.txt +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/code/tokens.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/github/_client.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/github/commits_visibilty_graph.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/github/followers.graphql +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/github/followers.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/github/graphql.config.yml +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/github/repositories.graphql +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/github/repositories.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/github/requirements.txt +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/math/__init__.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/math/_test_materializers.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/math/graph_atlas.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/math/graphs.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/math/gui.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/math/polygonal_graph.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/math/requirements.txt +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/social/cache/13/dd/73ce25face7beb30b69b64feeb77.val +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/social/cache/21/9e/00846f323987ba16cfbe0127d8eb.val +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/social/cache/70/b6/2aefb0269adce7fedf877fa0d267.val +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/social/cache/87/f5/ec1739bc369e84c3fcb302bf532a.val +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/social/cache/ba/fe/3aca7b2c38abff60e7ce5eb486a8.val +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/social/cache/c7/9e/ce82b0288020b7152779df09bd73.val +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/social/cache/cache.db +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/social/cache/d2/53/3b88f2fc162561cfdbbe9abc352a.val +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/social/cache/e2/d5/5d079f200eabf9b625b0473f6fbe.val +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/social/gui.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/social/music_artists.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/social/requirements.txt +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/system/.ignore +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/system/files.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/system/processes.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/system/requirements.txt +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/web/html_dom.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/web/page_links.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/examples/web/requirements.txt +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/playground/ethernet/traceroute.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/playground/genric_graph.graphql +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/playground/graphql.config.yml +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/playground/house_of_graphs.py +0 -0
- {graphinate-0.8.0/examples → graphinate-0.8.2/playground}/science/caffeine.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/playground/social/albums.json +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/playground/social/musicisians.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/playground/text/nlp_graph.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/playground/text/requirements.txt +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/playground/time_series/requirements.txt +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/playground/time_series/visibility_graph.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/sonar-project.properties +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/__init__.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/__main__.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/cli.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/color.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/constants.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/renderers/__init__.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/renderers/matplotlib.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/server/__init__.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/server/starlette/__init__.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/server/starlette/views.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/server/web/__init__.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/server/web/elements/__init__.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/server/web/elements/index.html +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/server/web/graphiql/__init__.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/server/web/graphiql/index.html +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/server/web/rapidoc/__init__.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/server/web/rapidoc/index.html +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/server/web/static/images/logo-128.png +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/server/web/static/images/logo.svg +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/server/web/static/images/network_graph.png +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/server/web/viewer/__init__.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/server/web/voyager/__init__.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/server/web/voyager/index.html +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/src/graphinate/tools.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/tests/conftest.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/tests/graphinate/test_cli.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/tests/graphinate/test_color.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/tests/graphinate/test_converters.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/tests/graphinate/test_modeling.py +0 -0
- {graphinate-0.8.0 → graphinate-0.8.2}/tests/graphinate/test_server.py +0 -0
|
@@ -25,5 +25,5 @@ jobs:
|
|
|
25
25
|
pip install uv
|
|
26
26
|
uv venv
|
|
27
27
|
source .venv/bin/activate
|
|
28
|
-
uv pip install mkdocs-material mkdocstrings-python mkdocs-git-revision-date-localized-plugin mkdocs-gen-files mkdocs-glightbox mkdocs-literate-nav mkdocs-section-index
|
|
28
|
+
uv pip install mkdocs-material mkdocstrings-python mkdocs-git-committers-plugin-2 "mkdocs-git-revision-date-localized-plugin<1.4.0" mkdocs-gen-files mkdocs-glightbox mkdocs-literate-nav mkdocs-section-index
|
|
29
29
|
mkdocs gh-deploy --force
|
|
@@ -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.6" ]
|
|
20
20
|
steps:
|
|
21
21
|
- uses: actions/checkout@v4
|
|
22
22
|
- name: Set up Python ${{ matrix.python-version }}
|
|
@@ -38,11 +38,16 @@ jobs:
|
|
|
38
38
|
- name: Test with pytest
|
|
39
39
|
run: |
|
|
40
40
|
python -m pip install faker pytest pytest-asyncio pytest-cov pytest-randomly pytest-xdist starlette-prometheus uvicorn[standard]
|
|
41
|
-
pytest tests --cov=src --cov-branch --cov-report=xml --junitxml=
|
|
41
|
+
pytest tests --cov=src --cov-branch --cov-report=xml --junitxml=junit.xml -o junit_family=legacy -n auto
|
|
42
42
|
- name: Upload coverage reports to Codecov
|
|
43
43
|
uses: codecov/codecov-action@v5
|
|
44
44
|
with:
|
|
45
45
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
46
|
+
- name: Upload test results to Codecov
|
|
47
|
+
if: ${{ !cancelled() }}
|
|
48
|
+
uses: codecov/test-results-action@v1
|
|
49
|
+
with:
|
|
50
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
46
51
|
- name: Run codacy-coverage-reporter
|
|
47
52
|
uses: codacy/codacy-coverage-reporter-action@v1.3.0
|
|
48
53
|
with:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Graphinate
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.2
|
|
4
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
|
|
@@ -122,34 +122,34 @@ Description-Content-Type: text/markdown
|
|
|
122
122
|
## Table of Contents
|
|
123
123
|
|
|
124
124
|
- [Introduction](#introduction)
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
- [What is Graphinate?](#what-is-graphinate)
|
|
126
|
+
- [Links](#links)
|
|
127
127
|
- [Quick Start](#quick-start)
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
- [Install](#install)
|
|
129
|
+
- [Example](#example)
|
|
130
130
|
- [CLI](#cli)
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
- [Commands](#commands)
|
|
132
|
+
- [Save](#save)
|
|
133
|
+
- [Server](#server)
|
|
134
134
|
- [Gallery](#gallery)
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
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
139
|
- [Development](#development)
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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
147
|
- [Acknowledgements](#acknowledgements)
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
148
|
+
- [Dependencies](#dependencies)
|
|
149
|
+
- [Python](#python)
|
|
150
|
+
- [Javascript and HTML](#javascript-and-html)
|
|
151
|
+
- [Dev Tools](#dev-tools)
|
|
152
|
+
- [IDE](#ide)
|
|
153
153
|
|
|
154
154
|
## Introduction
|
|
155
155
|
|
|
@@ -191,16 +191,15 @@ pip install graphinate[server]
|
|
|
191
191
|
### Example
|
|
192
192
|
|
|
193
193
|
```python title="Octagonal Graph"
|
|
194
|
-
import examples.math.materializers
|
|
195
194
|
import graphinate
|
|
196
195
|
|
|
197
196
|
N: int = 8
|
|
198
197
|
|
|
199
|
-
# Define a GraphModel
|
|
198
|
+
# First Define a GraphModel instance.
|
|
199
|
+
# It will be used to hold the graph definitions
|
|
200
200
|
graph_model: graphinate.GraphModel = graphinate.model(name="Octagonal Graph")
|
|
201
201
|
|
|
202
|
-
|
|
203
|
-
# Register in the Graph Model the edges' supplier function
|
|
202
|
+
# Register in the Graph Model the edges' supplier generator function
|
|
204
203
|
@graph_model.edge()
|
|
205
204
|
def edge():
|
|
206
205
|
for i in range(N):
|
|
@@ -208,25 +207,35 @@ def edge():
|
|
|
208
207
|
yield {'source': N, 'target': 0}
|
|
209
208
|
|
|
210
209
|
|
|
211
|
-
# Choose builder and handler
|
|
212
|
-
builder, handler = examples.math.materializers.Materializers.NetworkX_with_edge_labels.value
|
|
213
|
-
|
|
214
210
|
# Use the NetworkX Builder
|
|
215
211
|
builder = graphinate.builders.NetworkxBuilder(graph_model)
|
|
216
212
|
|
|
217
|
-
# build the NetworkX
|
|
213
|
+
# build the NetworkX GraphRepresentation
|
|
214
|
+
# the output in this case is a nx.Graph instance
|
|
218
215
|
graph = builder.build()
|
|
219
216
|
|
|
220
|
-
# plot the graph
|
|
221
|
-
graphinate.plot(graph, with_edge_labels=True)
|
|
222
|
-
|
|
217
|
+
# this supplied plot method uses matplotlib to display the graph
|
|
218
|
+
graphinate.matplotlib.plot(graph, with_edge_labels=True)
|
|
219
|
+
|
|
220
|
+
# or use the Mermaid Builder
|
|
221
|
+
builder = graphinate.builders.MermaidBuilder(graph_model)
|
|
223
222
|
|
|
224
|
-
|
|
223
|
+
# to create a Mermaid diagram
|
|
224
|
+
diagram: str = builder.build()
|
|
225
225
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
226
|
+
# and get Markdown or single page HTML to display it
|
|
227
|
+
mermaid_markdown: str = graphinate.mermaid.markdown(diagram)
|
|
228
|
+
mermaid_html: str = graphinate.mermaid.html(diagram, title=graph_model.name)
|
|
229
229
|
|
|
230
|
+
# or use the GraphQL Builder
|
|
231
|
+
builder = graphinate.builders.GraphQLBuilder(graph_model)
|
|
232
|
+
|
|
233
|
+
# to create a Strawberry GraphQL schema
|
|
234
|
+
schema = builder.build()
|
|
235
|
+
|
|
236
|
+
# and serve it using Uvicorn web server
|
|
237
|
+
graphinate.graphql.server(schema)
|
|
238
|
+
```
|
|
230
239
|
## CLI
|
|
231
240
|
|
|
232
241
|
### Commands
|
|
@@ -273,21 +282,24 @@ Options:
|
|
|
273
282
|
|
|
274
283
|
## Gallery
|
|
275
284
|
|
|
276
|
-
### Python AST
|
|
285
|
+
### Python Class AST
|
|
277
286
|
|
|
278
|
-
|
|
287
|
+
#### matplotlib
|
|
279
288
|
|
|
280
|
-
|
|
289
|
+

|
|
281
290
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
### Python AST - 3D Force-Directed Animation
|
|
291
|
+
#### 3D Force-Directed Animation
|
|
285
292
|
|
|
286
293
|
<video width="400" controls>
|
|
287
294
|
<source src="https://github.com/erivlis/graphinate/assets/9897520/2e9a53b1-5686-4683-a0e4-fbffa850a27b" type="video/mp4">
|
|
288
295
|
</video>
|
|
289
296
|
|
|
290
|
-
###
|
|
297
|
+
### GitHub Repository
|
|
298
|
+
|
|
299
|
+

|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
### Web Links
|
|
291
303
|
|
|
292
304
|

|
|
293
305
|
|
|
@@ -327,19 +339,19 @@ ruff check src --fix
|
|
|
327
339
|
#### Standard (cobertura) XML Coverage Report
|
|
328
340
|
|
|
329
341
|
```shell
|
|
330
|
-
python -m pytest tests -n auto --cov=src --cov-branch --doctest-modules --cov-report=xml --junitxml=
|
|
342
|
+
python -m pytest tests -n auto --cov=src --cov-branch --doctest-modules --cov-report=xml --junitxml=junit.xml
|
|
331
343
|
```
|
|
332
344
|
|
|
333
345
|
#### HTML Coverage Report
|
|
334
346
|
|
|
335
347
|
```shell
|
|
336
|
-
python -m pytest tests -n auto --cov=src --cov-branch --doctest-modules --cov-report=html --junitxml=
|
|
348
|
+
python -m pytest tests -n auto --cov=src --cov-branch --doctest-modules --cov-report=html --junitxml=junit.xml
|
|
337
349
|
```
|
|
338
350
|
|
|
339
351
|
#### Terminal Coverage Report
|
|
340
352
|
|
|
341
353
|
```shell
|
|
342
|
-
python -m pytest tests -n auto --cov=src --cov-branch --doctest-modules --cov-report=term --junitxml=
|
|
354
|
+
python -m pytest tests -n auto --cov=src --cov-branch --doctest-modules --cov-report=term --junitxml=junit.xml
|
|
343
355
|
```
|
|
344
356
|
|
|
345
357
|
### Docs
|
|
@@ -384,7 +396,7 @@ python -m mkdocs build
|
|
|
384
396
|
|
|
385
397
|
### IDE
|
|
386
398
|
|
|
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>
|
|
399
|
+
<a href="https://www.jetbrains.com/pycharm/"><img height="60" style="padding: 5px; background: linear-gradient(-45deg, #FCF84A, #3DEA62, #21D789);" src="https://resources.jetbrains.com/storage/products/company/brand/logos/PyCharm.png" alt="PyCharm logo"></a>
|
|
388
400
|
|
|
389
401
|
--------------------------------
|
|
390
402
|
|
|
@@ -392,6 +404,6 @@ python -m mkdocs build
|
|
|
392
404
|
|
|
393
405
|
--------------------------------
|
|
394
406
|
|
|
395
|
-
<img alt="
|
|
407
|
+
<img alt="Work on my Machine" src="https://forthebadge.com/images/badges/works-on-my-machine.svg">
|
|
396
408
|
|
|
397
409
|
Copyright © 2023-2025 Eran Rivlis
|
|
@@ -78,34 +78,34 @@
|
|
|
78
78
|
## Table of Contents
|
|
79
79
|
|
|
80
80
|
- [Introduction](#introduction)
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
- [What is Graphinate?](#what-is-graphinate)
|
|
82
|
+
- [Links](#links)
|
|
83
83
|
- [Quick Start](#quick-start)
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
- [Install](#install)
|
|
85
|
+
- [Example](#example)
|
|
86
86
|
- [CLI](#cli)
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
- [Commands](#commands)
|
|
88
|
+
- [Save](#save)
|
|
89
|
+
- [Server](#server)
|
|
90
90
|
- [Gallery](#gallery)
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
95
|
- [Development](#development)
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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
103
|
- [Acknowledgements](#acknowledgements)
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
104
|
+
- [Dependencies](#dependencies)
|
|
105
|
+
- [Python](#python)
|
|
106
|
+
- [Javascript and HTML](#javascript-and-html)
|
|
107
|
+
- [Dev Tools](#dev-tools)
|
|
108
|
+
- [IDE](#ide)
|
|
109
109
|
|
|
110
110
|
## Introduction
|
|
111
111
|
|
|
@@ -147,16 +147,15 @@ pip install graphinate[server]
|
|
|
147
147
|
### Example
|
|
148
148
|
|
|
149
149
|
```python title="Octagonal Graph"
|
|
150
|
-
import examples.math.materializers
|
|
151
150
|
import graphinate
|
|
152
151
|
|
|
153
152
|
N: int = 8
|
|
154
153
|
|
|
155
|
-
# Define a GraphModel
|
|
154
|
+
# First Define a GraphModel instance.
|
|
155
|
+
# It will be used to hold the graph definitions
|
|
156
156
|
graph_model: graphinate.GraphModel = graphinate.model(name="Octagonal Graph")
|
|
157
157
|
|
|
158
|
-
|
|
159
|
-
# Register in the Graph Model the edges' supplier function
|
|
158
|
+
# Register in the Graph Model the edges' supplier generator function
|
|
160
159
|
@graph_model.edge()
|
|
161
160
|
def edge():
|
|
162
161
|
for i in range(N):
|
|
@@ -164,25 +163,35 @@ def edge():
|
|
|
164
163
|
yield {'source': N, 'target': 0}
|
|
165
164
|
|
|
166
165
|
|
|
167
|
-
# Choose builder and handler
|
|
168
|
-
builder, handler = examples.math.materializers.Materializers.NetworkX_with_edge_labels.value
|
|
169
|
-
|
|
170
166
|
# Use the NetworkX Builder
|
|
171
167
|
builder = graphinate.builders.NetworkxBuilder(graph_model)
|
|
172
168
|
|
|
173
|
-
# build the NetworkX
|
|
169
|
+
# build the NetworkX GraphRepresentation
|
|
170
|
+
# the output in this case is a nx.Graph instance
|
|
174
171
|
graph = builder.build()
|
|
175
172
|
|
|
176
|
-
# plot the graph
|
|
177
|
-
graphinate.plot(graph, with_edge_labels=True)
|
|
178
|
-
|
|
173
|
+
# this supplied plot method uses matplotlib to display the graph
|
|
174
|
+
graphinate.matplotlib.plot(graph, with_edge_labels=True)
|
|
175
|
+
|
|
176
|
+
# or use the Mermaid Builder
|
|
177
|
+
builder = graphinate.builders.MermaidBuilder(graph_model)
|
|
179
178
|
|
|
180
|
-
|
|
179
|
+
# to create a Mermaid diagram
|
|
180
|
+
diagram: str = builder.build()
|
|
181
181
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
# and get Markdown or single page HTML to display it
|
|
183
|
+
mermaid_markdown: str = graphinate.mermaid.markdown(diagram)
|
|
184
|
+
mermaid_html: str = graphinate.mermaid.html(diagram, title=graph_model.name)
|
|
185
185
|
|
|
186
|
+
# or use the GraphQL Builder
|
|
187
|
+
builder = graphinate.builders.GraphQLBuilder(graph_model)
|
|
188
|
+
|
|
189
|
+
# to create a Strawberry GraphQL schema
|
|
190
|
+
schema = builder.build()
|
|
191
|
+
|
|
192
|
+
# and serve it using Uvicorn web server
|
|
193
|
+
graphinate.graphql.server(schema)
|
|
194
|
+
```
|
|
186
195
|
## CLI
|
|
187
196
|
|
|
188
197
|
### Commands
|
|
@@ -229,21 +238,24 @@ Options:
|
|
|
229
238
|
|
|
230
239
|
## Gallery
|
|
231
240
|
|
|
232
|
-
### Python AST
|
|
241
|
+
### Python Class AST
|
|
233
242
|
|
|
234
|
-
|
|
243
|
+
#### matplotlib
|
|
235
244
|
|
|
236
|
-
|
|
245
|
+

|
|
237
246
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
### Python AST - 3D Force-Directed Animation
|
|
247
|
+
#### 3D Force-Directed Animation
|
|
241
248
|
|
|
242
249
|
<video width="400" controls>
|
|
243
250
|
<source src="https://github.com/erivlis/graphinate/assets/9897520/2e9a53b1-5686-4683-a0e4-fbffa850a27b" type="video/mp4">
|
|
244
251
|
</video>
|
|
245
252
|
|
|
246
|
-
###
|
|
253
|
+
### GitHub Repository
|
|
254
|
+
|
|
255
|
+

|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
### Web Links
|
|
247
259
|
|
|
248
260
|

|
|
249
261
|
|
|
@@ -283,19 +295,19 @@ ruff check src --fix
|
|
|
283
295
|
#### Standard (cobertura) XML Coverage Report
|
|
284
296
|
|
|
285
297
|
```shell
|
|
286
|
-
python -m pytest tests -n auto --cov=src --cov-branch --doctest-modules --cov-report=xml --junitxml=
|
|
298
|
+
python -m pytest tests -n auto --cov=src --cov-branch --doctest-modules --cov-report=xml --junitxml=junit.xml
|
|
287
299
|
```
|
|
288
300
|
|
|
289
301
|
#### HTML Coverage Report
|
|
290
302
|
|
|
291
303
|
```shell
|
|
292
|
-
python -m pytest tests -n auto --cov=src --cov-branch --doctest-modules --cov-report=html --junitxml=
|
|
304
|
+
python -m pytest tests -n auto --cov=src --cov-branch --doctest-modules --cov-report=html --junitxml=junit.xml
|
|
293
305
|
```
|
|
294
306
|
|
|
295
307
|
#### Terminal Coverage Report
|
|
296
308
|
|
|
297
309
|
```shell
|
|
298
|
-
python -m pytest tests -n auto --cov=src --cov-branch --doctest-modules --cov-report=term --junitxml=
|
|
310
|
+
python -m pytest tests -n auto --cov=src --cov-branch --doctest-modules --cov-report=term --junitxml=junit.xml
|
|
299
311
|
```
|
|
300
312
|
|
|
301
313
|
### Docs
|
|
@@ -340,7 +352,7 @@ python -m mkdocs build
|
|
|
340
352
|
|
|
341
353
|
### IDE
|
|
342
354
|
|
|
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>
|
|
355
|
+
<a href="https://www.jetbrains.com/pycharm/"><img height="60" style="padding: 5px; background: linear-gradient(-45deg, #FCF84A, #3DEA62, #21D789);" src="https://resources.jetbrains.com/storage/products/company/brand/logos/PyCharm.png" alt="PyCharm logo"></a>
|
|
344
356
|
|
|
345
357
|
--------------------------------
|
|
346
358
|
|
|
@@ -348,6 +360,6 @@ python -m mkdocs build
|
|
|
348
360
|
|
|
349
361
|
--------------------------------
|
|
350
362
|
|
|
351
|
-
<img alt="
|
|
363
|
+
<img alt="Work on my Machine" src="https://forthebadge.com/images/badges/works-on-my-machine.svg">
|
|
352
364
|
|
|
353
365
|
Copyright © 2023-2025 Eran Rivlis
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"acknowledge.md": {
|
|
3
3
|
"created": "2023-08-20T00:21:55.621436",
|
|
4
|
-
"modified": "
|
|
4
|
+
"modified": "2025-03-12T00:39:57.859235"
|
|
5
5
|
},
|
|
6
6
|
"index.md": {
|
|
7
7
|
"created": "2023-08-15T00:05:21.586874",
|
|
8
|
-
"modified": "2025-03-
|
|
8
|
+
"modified": "2025-03-12T00:40:46.459147"
|
|
9
9
|
},
|
|
10
10
|
"intro.md": {
|
|
11
11
|
"created": "2023-08-19T23:54:18.668094",
|
|
12
|
-
"modified": "2025-03-
|
|
12
|
+
"modified": "2025-03-11T23:24:02.836144"
|
|
13
13
|
},
|
|
14
14
|
"start.md": {
|
|
15
15
|
"created": "2023-08-20T00:07:42.683716",
|
|
16
|
-
"modified": "2025-03-
|
|
16
|
+
"modified": "2025-03-11T23:45:05.567864"
|
|
17
17
|
},
|
|
18
18
|
"tutorial.md": {
|
|
19
19
|
"created": "2025-02-26T00:03:30.194156",
|
|
20
|
-
"modified": "2025-03-
|
|
20
|
+
"modified": "2025-03-12T00:12:38.290310"
|
|
21
21
|
},
|
|
22
22
|
"examples\\code.md": {
|
|
23
23
|
"created": "2023-08-20T00:09:32.677003",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"examples\\social.md": {
|
|
35
35
|
"created": "2025-02-24T23:49:35.972953",
|
|
36
|
-
"modified": "2025-
|
|
36
|
+
"modified": "2025-03-11T23:47:36.266891"
|
|
37
37
|
},
|
|
38
38
|
"examples\\system.md": {
|
|
39
39
|
"created": "2024-03-27T01:28:38.922865",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"examples\\web.md": {
|
|
43
43
|
"created": "2023-10-05T11:43:30.550657",
|
|
44
|
-
"modified": "2025-03-
|
|
44
|
+
"modified": "2025-03-12T00:42:43.742512"
|
|
45
45
|
},
|
|
46
46
|
"reference\\SUMMARY.md": {
|
|
47
47
|
"created": "2025-03-08T20:51:52.801367",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"usage\\lib.md": {
|
|
55
55
|
"created": "2023-09-27T21:23:44.133584",
|
|
56
|
-
"modified": "2025-03-
|
|
56
|
+
"modified": "2025-03-12T00:30:12.961397"
|
|
57
57
|
},
|
|
58
58
|
"reference\\graphinate\\builders.md": {
|
|
59
59
|
"created": "2025-03-08T20:51:52.788270",
|
|
@@ -14,15 +14,18 @@
|
|
|
14
14
|
|
|
15
15
|
<a href="https://vasturiano.github.io/3d-force-graph/"><img style="height: 50px; padding: 5px; background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);" src="http://gist.github.com/vasturiano/02affe306ce445e423f992faeea13521/raw/preview.png" alt="3D Force-Directed Graph Logo."></a>
|
|
16
16
|
<a href="https://github.com/graphql-kit/graphql-voyager"><img style="height: 50px; padding: 5px; background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);" src="https://github.com/graphql-kit/graphql-voyager/raw/main/docs/cover.png" alt="Graphql Voyager Logo."></a>
|
|
17
|
+
<a href="https://github.com/cocopon/tweakpane"><img style="height: 50px; background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);" src="https://user-images.githubusercontent.com/602961/184479032-38f50be3-e235-4914-85c0-dce316b33ed2.png" alt="Tweakpane Logo"></a>
|
|
17
18
|
|
|
18
19
|
## Dev Tools
|
|
19
20
|
|
|
20
|
-
<a href="https://hatch.pypa.io/"><img style="height: 50px; background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);" src="https://hatch.pypa.io/latest/assets/images/logo.svg" alt="Hatch logo."></a>
|
|
21
|
-
<a href="https://squidfunk.github.io/mkdocs-material/"><img style="height: 50px; background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);" src="https://raw.githubusercontent.com/squidfunk/mkdocs-material/master/.github/assets/logo.svg" alt="Material for MkDocs"></a>
|
|
22
|
-
<a href="https://pytest.org"><img style="height: 50px; background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);" src="https://docs.pytest.org/en/7.4.x/_static/pytest_logo_curves.svg" alt="pytest logo."></a>
|
|
23
|
-
<a href="https://astral.sh/ruff"><img style="height: 50px; background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);" src="https://astralcms.wpengine.com/wp-content/uploads/2023/03/Ruff-Logo.svg" alt="Ruff logo."></a>
|
|
24
21
|
<a href="https://astral.sh/uv"><img style="height: 50px; background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);" src="https://avatars.githubusercontent.com/u/115962839" alt="uv logo."></a>
|
|
22
|
+
<a href="https://astral.sh/ruff"><img style="height: 50px; background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);" src="https://astralcms.wpengine.com/wp-content/uploads/2023/03/Ruff-Logo.svg" alt="Ruff logo."></a>
|
|
23
|
+
<a href="https://squidfunk.github.io/mkdocs-material/"><img style="height: 50px; background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);" src="https://raw.githubusercontent.com/squidfunk/mkdocs-material/master/.github/assets/logo.svg" alt="Material for MkDocs"></a>
|
|
24
|
+
<a href="https://pytest.org"><img style="height: 50px; background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);" src="https://docs.pytest.org/en/7.4.x/_static/pytest_logo_curves.svg" alt="pytest logo."></a>
|
|
25
|
+
<a href="https://hatch.pypa.io/"><img style="height: 50px; background: linear-gradient(-45deg, #FFFFFF, #CCCCCC);" src="https://hatch.pypa.io/latest/assets/images/logo.svg" alt="Hatch logo."></a>
|
|
26
|
+
|
|
27
|
+
|
|
25
28
|
|
|
26
29
|
## IDE
|
|
27
30
|
|
|
28
|
-
<a href="https://www.jetbrains.com/pycharm/"><img style="height: 50px; background: linear-gradient(-45deg, #FCF84A, #3DEA62, #21D789);" src="https://resources.jetbrains.com/storage/products/company/brand/logos/PyCharm.png" alt="PyCharm logo."></a>
|
|
31
|
+
<a href="https://www.jetbrains.com/pycharm/"><img style="height: 50px; padding: 5px; background: linear-gradient(-45deg, #FCF84A, #3DEA62, #21D789);" src="https://resources.jetbrains.com/storage/products/company/brand/logos/PyCharm.png" alt="PyCharm logo."></a>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Social
|
|
2
|
+
|
|
3
|
+
## Music Artists
|
|
4
|
+
|
|
5
|
+
=== "Music Artists"
|
|
6
|
+
|
|
7
|
+
``` python title="examples/social/music_artists.py" linenums="1"
|
|
8
|
+
--8<-- "examples/social/music_artists.py"
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
=== "Dependencies"
|
|
12
|
+
|
|
13
|
+
``` text title="examples/social/requirements.txt" linenums="1"
|
|
14
|
+
--8<-- "examples/social/requirements.txt"
|
|
15
|
+
```
|