Graphinate 0.2.18__tar.gz → 0.2.19__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.2.18 → graphinate-0.2.19}/PKG-INFO +1 -1
- graphinate-0.2.19/docs/examples/system.md +15 -0
- graphinate-0.2.19/examples/code/requirements.txt +1 -0
- graphinate-0.2.19/examples/system/processes.py +64 -0
- graphinate-0.2.19/examples/system/requirements.txt +1 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/pyproject.toml +1 -1
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/server/web/graphiql/index.html +1 -1
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/server/web/viewer/index.html +3 -2
- graphinate-0.2.18/examples/code/requirements.txt +0 -1
- {graphinate-0.2.18 → graphinate-0.2.19}/.coveragerc +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/.github/dependabot.yml +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/.github/workflows/codeql.yml +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/.github/workflows/publish-docs.yaml +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/.github/workflows/publish.yml +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/.github/workflows/test-beta.yml +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/.github/workflows/test.yml +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/.gitignore +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/LICENSE +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/README.md +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/STATS.md +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/docs/acknowledge.md +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/docs/assets/images/logo-128.png +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/docs/assets/images/network_graph.png +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/docs/assets/stylesheets/extra.css +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/docs/dev.md +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/docs/examples/code.md +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/docs/examples/github.md +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/docs/examples/math.md +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/docs/examples/web.md +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/docs/gen_ref_pages.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/docs/index.md +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/docs/intro.md +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/docs/start.md +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/docs/usage/cli.md +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/docs/usage/lib.md +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/examples/code/python_ast.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/examples/code/python_dependencies.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/examples/github/_client.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/examples/github/commits_visibilty_graph.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/examples/github/followers.graphql +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/examples/github/followers.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/examples/github/graphql.config.yml +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/examples/github/repositories.graphql +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/examples/github/repositories.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/examples/github/requirements.txt +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/examples/math/graph_atlas.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/examples/math/polygonal_graph.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/examples/web/page_links.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/examples/web/requirements.txt +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/mkdocs.yml +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/playground/ethernet/traceroute.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/playground/genric_graph.graphql +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/playground/graphql.config.yml +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/playground/house_of_graphs.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/playground/social/albums.json +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/playground/social/musicisians.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/playground/text/nlp_graph.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/playground/text/requirements.txt +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/playground/time_series/requirements.txt +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/playground/time_series/visibility_graph.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/sonar-project.properties +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/__init__.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/__main__.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/builders.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/cli.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/color.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/materializers/__init__.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/materializers/matplotlib.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/modeling.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/server/__init__.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/server/starlette/__init__.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/server/starlette/views.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/server/web/__init__.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/server/web/elements/__init__.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/server/web/elements/index.html +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/server/web/graphiql/__init__.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/server/web/rapidoc/__init__.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/server/web/rapidoc/index.html +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/server/web/static/images/logo-128.png +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/server/web/static/images/network_graph.png +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/server/web/viewer/__init__.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/server/web/voyager/__init__.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/server/web/voyager/index.html +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/tools/__init__.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/tools/converters.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/tools/gui.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/tools/mutators.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/typing.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/tests/conftest.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/tests/graphinate/test_builders.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/tests/graphinate/test_cli.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/tests/graphinate/test_color.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/tests/graphinate/test_materializers.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/tests/graphinate/test_modeling.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/tests/graphinate/test_server.py +0 -0
- {graphinate-0.2.18 → graphinate-0.2.19}/tests/graphinate/test_tools.py +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# System
|
|
2
|
+
|
|
3
|
+
## Processes
|
|
4
|
+
|
|
5
|
+
=== "Processes"
|
|
6
|
+
|
|
7
|
+
``` python title="examples/system/processes.py" linenums="1"
|
|
8
|
+
--8<-- "examples/system/processes.py"
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
=== "Dependencies"
|
|
12
|
+
|
|
13
|
+
``` text title="examples/system/requirements.txt" linenums="1"
|
|
14
|
+
--8<-- "examples/system/requirements.txt"
|
|
15
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pipdeptree>=2.13.0
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import operator
|
|
2
|
+
from collections.abc import Iterable
|
|
3
|
+
|
|
4
|
+
import networkx as nx
|
|
5
|
+
import psutil
|
|
6
|
+
|
|
7
|
+
import graphinate
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def processes_graph_model():
|
|
11
|
+
graph_model = graphinate.model("Processes Graph")
|
|
12
|
+
|
|
13
|
+
def processes() -> Iterable[psutil.Process]:
|
|
14
|
+
for pid in psutil.pids():
|
|
15
|
+
if psutil.pid_exists(pid):
|
|
16
|
+
yield psutil.Process(pid)
|
|
17
|
+
|
|
18
|
+
processes_list = [{'pid': p.pid, 'name': p.name(), 'parent_pid': p.parent().pid if p.parent() else None} for p in
|
|
19
|
+
processes()]
|
|
20
|
+
|
|
21
|
+
@graph_model.node(key=operator.itemgetter('pid'), label=operator.itemgetter('name'))
|
|
22
|
+
def process():
|
|
23
|
+
yield from processes_list
|
|
24
|
+
|
|
25
|
+
@graph_model.edge()
|
|
26
|
+
def edge():
|
|
27
|
+
for p in processes_list:
|
|
28
|
+
parent_pid = p.get('parent_pid')
|
|
29
|
+
if parent_pid:
|
|
30
|
+
yield {'source': p.get('pid'), 'target': parent_pid}
|
|
31
|
+
|
|
32
|
+
return graph_model
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
model = processes_graph_model()
|
|
36
|
+
|
|
37
|
+
if __name__ == '__main__':
|
|
38
|
+
use_materialize = True
|
|
39
|
+
|
|
40
|
+
if use_materialize:
|
|
41
|
+
# Materialize the GraphModel
|
|
42
|
+
graphinate.materialize(
|
|
43
|
+
model,
|
|
44
|
+
builder=graphinate.builders.GraphQLBuilder,
|
|
45
|
+
actualizer=graphinate.graphql
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
else:
|
|
49
|
+
# Or
|
|
50
|
+
|
|
51
|
+
# 1. Define Graph Builder
|
|
52
|
+
builder = graphinate.builders.NetworkxBuilder(model=model)
|
|
53
|
+
|
|
54
|
+
# Then
|
|
55
|
+
# 2. Build the Graph object
|
|
56
|
+
graph: nx.Graph = builder.build()
|
|
57
|
+
|
|
58
|
+
# Then
|
|
59
|
+
# 3. Option A - Output to console
|
|
60
|
+
print(graph)
|
|
61
|
+
|
|
62
|
+
# Or
|
|
63
|
+
# 3. Option B - Output as a plot
|
|
64
|
+
graphinate.materializers.plot(graph)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
psutil>=5.9.8
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<title>Graphinate</title>
|
|
5
5
|
<style> body { margin: 0; } </style>
|
|
6
|
-
<script src="https://cdn.jsdelivr.net/npm/3d-force-graph@1.
|
|
7
|
-
integrity="
|
|
6
|
+
<script src="https://cdn.jsdelivr.net/npm/3d-force-graph@1.72.3/dist/3d-force-graph.min.js"
|
|
7
|
+
integrity="sha256-X4nSjPQnyc5QqQ88WM5oVzMx2KUKXj3hxRAvt2WxDRI="
|
|
8
8
|
crossorigin="anonymous"></script>
|
|
9
|
+
|
|
9
10
|
<script src="/static/scripts/murmurhash3_gc.js"
|
|
10
11
|
integrity="sha384-qmbe8KG4+frUnGS6DOKYZgFKbBvbhNNOL/LZ4hSpKauxmgrTX3LALg5+oQJS4AOn"></script>
|
|
11
12
|
</head>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
pipdeptree==2.13.0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/server/web/static/images/logo-128.png
RENAMED
|
File without changes
|
{graphinate-0.2.18 → graphinate-0.2.19}/src/graphinate/server/web/static/images/network_graph.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|