Graphinate 0.2.21__tar.gz → 0.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {graphinate-0.2.21 → graphinate-0.3.1}/.github/workflows/test-beta.yml +2 -1
- {graphinate-0.2.21 → graphinate-0.3.1}/.github/workflows/test.yml +10 -1
- {graphinate-0.2.21 → graphinate-0.3.1}/.gitignore +1 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/PKG-INFO +33 -26
- {graphinate-0.2.21 → graphinate-0.3.1}/README.md +21 -14
- {graphinate-0.2.21 → graphinate-0.3.1}/STATS.md +7 -1
- {graphinate-0.2.21 → graphinate-0.3.1}/docs/acknowledge.md +1 -1
- {graphinate-0.2.21 → graphinate-0.3.1}/docs/index.md +1 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/docs/start.md +1 -1
- {graphinate-0.2.21 → graphinate-0.3.1}/examples/code/python_ast.py +14 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/examples/code/python_dependencies.py +7 -0
- graphinate-0.3.1/examples/github/_client.py +132 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/examples/github/followers.py +16 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/examples/github/repositories.py +7 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/examples/math/graph_atlas.py +30 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/examples/math/polygonal_graph.py +20 -7
- {graphinate-0.2.21 → graphinate-0.3.1}/examples/system/processes.py +7 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/examples/web/page_links.py +10 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/examples/web/requirements.txt +2 -1
- {graphinate-0.2.21 → graphinate-0.3.1}/pyproject.toml +12 -12
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/builders.py +4 -4
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/color.py +4 -3
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/materializers/matplotlib.py +9 -7
- graphinate-0.3.1/src/graphinate/server/__init__.py +80 -0
- graphinate-0.3.1/src/graphinate/tools/mutators.py +153 -0
- graphinate-0.2.21/examples/github/_client.py +0 -61
- graphinate-0.2.21/src/graphinate/server/__init__.py +0 -110
- graphinate-0.2.21/src/graphinate/tools/mutators.py +0 -66
- {graphinate-0.2.21 → graphinate-0.3.1}/.coveragerc +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/.github/dependabot.yml +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/.github/workflows/codeql.yml +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/.github/workflows/publish-docs.yaml +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/.github/workflows/publish.yml +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/LICENSE +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/docs/assets/images/logo-128.png +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/docs/assets/images/network_graph.png +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/docs/assets/stylesheets/extra.css +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/docs/dev.md +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/docs/examples/code.md +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/docs/examples/github.md +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/docs/examples/math.md +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/docs/examples/system.md +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/docs/examples/web.md +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/docs/gen_ref_pages.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/docs/intro.md +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/docs/usage/cli.md +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/docs/usage/lib.md +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/examples/code/requirements.txt +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/examples/github/commits_visibilty_graph.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/examples/github/followers.graphql +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/examples/github/graphql.config.yml +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/examples/github/repositories.graphql +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/examples/github/requirements.txt +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/examples/math/requirements.txt +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/examples/system/requirements.txt +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/mkdocs.yml +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/playground/ethernet/traceroute.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/playground/genric_graph.graphql +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/playground/graphql.config.yml +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/playground/house_of_graphs.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/playground/social/albums.json +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/playground/social/musicisians.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/playground/text/nlp_graph.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/playground/text/requirements.txt +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/playground/time_series/requirements.txt +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/playground/time_series/visibility_graph.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/sonar-project.properties +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/__init__.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/__main__.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/cli.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/materializers/__init__.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/modeling.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/server/starlette/__init__.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/server/starlette/views.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/server/web/__init__.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/server/web/elements/__init__.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/server/web/elements/index.html +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/server/web/graphiql/__init__.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/server/web/graphiql/index.html +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/server/web/rapidoc/__init__.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/server/web/rapidoc/index.html +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/server/web/static/images/logo-128.png +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/server/web/static/images/network_graph.png +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/server/web/viewer/__init__.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/server/web/viewer/index.html +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/server/web/voyager/__init__.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/server/web/voyager/index.html +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/tools/__init__.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/tools/converters.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/tools/gui.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/src/graphinate/typing.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/tests/conftest.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/tests/graphinate/test_builders.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/tests/graphinate/test_cli.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/tests/graphinate/test_color.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/tests/graphinate/test_materializers.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/tests/graphinate/test_modeling.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/tests/graphinate/test_server.py +0 -0
- {graphinate-0.2.21 → graphinate-0.3.1}/tests/graphinate/test_tools.py +0 -0
|
@@ -15,7 +15,8 @@ jobs:
|
|
|
15
15
|
strategy:
|
|
16
16
|
fail-fast: false
|
|
17
17
|
matrix:
|
|
18
|
-
python-
|
|
18
|
+
# https://github.com/actions/python-versions/blob/main/versions-manifest.json
|
|
19
|
+
python-version: [ "3.14.0-alpha.1" ]
|
|
19
20
|
steps:
|
|
20
21
|
- uses: actions/checkout@v4
|
|
21
22
|
- name: Set up Python ${{ matrix.python-version }}
|
|
@@ -15,7 +15,7 @@ jobs:
|
|
|
15
15
|
strategy:
|
|
16
16
|
fail-fast: false
|
|
17
17
|
matrix:
|
|
18
|
-
python-version: [ "3.
|
|
18
|
+
python-version: [ "3.10", "3.11", "3.12", "3.13"]
|
|
19
19
|
steps:
|
|
20
20
|
- uses: actions/checkout@v4
|
|
21
21
|
- name: Set up Python ${{ matrix.python-version }}
|
|
@@ -43,3 +43,12 @@ jobs:
|
|
|
43
43
|
uses: codecov/codecov-action@v4
|
|
44
44
|
with:
|
|
45
45
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
46
|
+
- name: Run codacy-coverage-reporter
|
|
47
|
+
uses: codacy/codacy-coverage-reporter-action@v1.3.0
|
|
48
|
+
with:
|
|
49
|
+
#project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
|
|
50
|
+
# or
|
|
51
|
+
api-token: ${{ secrets.CODACY_API_TOKEN }}
|
|
52
|
+
coverage-reports: coverage.xml
|
|
53
|
+
# or a comma-separated list for multiple reports
|
|
54
|
+
# coverage-reports: <PATH_TO_REPORT>, <PATH_TO_REPORT>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: Graphinate
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.1
|
|
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
|
|
@@ -9,7 +9,7 @@ Project-URL: Source, https://github.com/erivlis/graphinate
|
|
|
9
9
|
Author-email: Eran Rivlis <eran@rivlis.info>
|
|
10
10
|
License-File: LICENSE
|
|
11
11
|
Keywords: declarative,graph
|
|
12
|
-
Classifier: Development Status ::
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
13
|
Classifier: Intended Audience :: Developers
|
|
14
14
|
Classifier: Intended Audience :: Information Technology
|
|
15
15
|
Classifier: Intended Audience :: Science/Research
|
|
@@ -18,21 +18,21 @@ Classifier: Natural Language :: English
|
|
|
18
18
|
Classifier: Operating System :: OS Independent
|
|
19
19
|
Classifier: Programming Language :: Python :: 3
|
|
20
20
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
22
21
|
Classifier: Programming Language :: Python :: 3.10
|
|
23
22
|
Classifier: Programming Language :: Python :: 3.11
|
|
24
23
|
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
25
25
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
26
26
|
Classifier: Topic :: Scientific/Engineering
|
|
27
27
|
Classifier: Topic :: Software Development :: Libraries
|
|
28
28
|
Classifier: Typing :: Typed
|
|
29
|
-
Requires-Python: >=3.
|
|
29
|
+
Requires-Python: >=3.10
|
|
30
30
|
Requires-Dist: click>=8.1.7
|
|
31
|
-
Requires-Dist: inflect>=7.
|
|
31
|
+
Requires-Dist: inflect>=7.3.0
|
|
32
32
|
Requires-Dist: loguru>=0.7.2
|
|
33
|
-
Requires-Dist: matplotlib>=3.
|
|
33
|
+
Requires-Dist: matplotlib>=3.9.0
|
|
34
34
|
Requires-Dist: networkx>=3.3
|
|
35
|
-
Requires-Dist: strawberry-graphql[asgi,opentelemetry]>=0.
|
|
35
|
+
Requires-Dist: strawberry-graphql[asgi,opentelemetry]>=0.235.1
|
|
36
36
|
Provides-Extra: dev
|
|
37
37
|
Requires-Dist: pipdeptree; extra == 'dev'
|
|
38
38
|
Requires-Dist: ruff; extra == 'dev'
|
|
@@ -45,17 +45,17 @@ Requires-Dist: mkdocs-material; extra == 'docs'
|
|
|
45
45
|
Requires-Dist: mkdocs-section-index; extra == 'docs'
|
|
46
46
|
Requires-Dist: mkdocstrings-python; extra == 'docs'
|
|
47
47
|
Provides-Extra: plot
|
|
48
|
-
Requires-Dist: scipy>=1.
|
|
48
|
+
Requires-Dist: scipy>=1.14.0; extra == 'plot'
|
|
49
49
|
Provides-Extra: server
|
|
50
50
|
Requires-Dist: starlette-prometheus; extra == 'server'
|
|
51
|
-
Requires-Dist: uvicorn[standard]>=0.
|
|
51
|
+
Requires-Dist: uvicorn[standard]>=0.30.1; extra == 'server'
|
|
52
52
|
Provides-Extra: test
|
|
53
53
|
Requires-Dist: faker>=23.2.1; extra == 'test'
|
|
54
|
-
Requires-Dist: pytest-asyncio>=0.23.
|
|
54
|
+
Requires-Dist: pytest-asyncio>=0.23.7; extra == 'test'
|
|
55
55
|
Requires-Dist: pytest-cov>=5.0.0; extra == 'test'
|
|
56
56
|
Requires-Dist: pytest-randomly>=3.15.0; extra == 'test'
|
|
57
|
-
Requires-Dist: pytest-xdist>=3.
|
|
58
|
-
Requires-Dist: pytest>=8.
|
|
57
|
+
Requires-Dist: pytest-xdist>=3.6.1; extra == 'test'
|
|
58
|
+
Requires-Dist: pytest>=8.2.2; extra == 'test'
|
|
59
59
|
Description-Content-Type: text/markdown
|
|
60
60
|
|
|
61
61
|
# [Graphinate. Data to Graphs.](https://erivlis.github.io/graphinate/)
|
|
@@ -81,10 +81,10 @@ Description-Content-Type: text/markdown
|
|
|
81
81
|
<td>Tools</td>
|
|
82
82
|
<td>
|
|
83
83
|
<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>
|
|
84
|
-
<a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json"
|
|
85
|
-
<a href="https://github.com/astral-sh/uv"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json"
|
|
86
|
-
<a href="https://squidfunk.github.io/mkdocs-material/"><img src="https://img.shields.io/badge/Material_for_MkDocs-526CFE?&logo=MaterialForMkDocs&logoColor=white&labelColor=grey"></a>
|
|
87
|
-
<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>
|
|
84
|
+
<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>
|
|
85
|
+
<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>
|
|
86
|
+
<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>
|
|
87
|
+
<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>
|
|
88
88
|
</td>
|
|
89
89
|
</tr>
|
|
90
90
|
<tr>
|
|
@@ -110,6 +110,7 @@ Description-Content-Type: text/markdown
|
|
|
110
110
|
<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>
|
|
111
111
|
<br>
|
|
112
112
|
<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>
|
|
113
|
+
<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>
|
|
113
114
|
<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>
|
|
114
115
|
<!--a href="https://snyk.io/test/github/erivlis/graphinate"><img alt="Snyk" src="https://snyk.io/test/github/erivlis/Graphinate/badge.svg"></a -->
|
|
115
116
|
</td>
|
|
@@ -133,9 +134,9 @@ In addition, there are several modes of output to enable examination of the Grap
|
|
|
133
134
|
|
|
134
135
|
### Links
|
|
135
136
|
|
|
136
|
-
- Website (including documentation): https://erivlis.github.io/graphinate
|
|
137
|
-
- Source: https://github.com/erivlis/graphinate
|
|
138
|
-
- Package: https://pypi.org/project/graphinate
|
|
137
|
+
- Website (including documentation): <https://erivlis.github.io/graphinate>
|
|
138
|
+
- Source: <https://github.com/erivlis/graphinate>
|
|
139
|
+
- Package: <https://pypi.org/project/graphinate>
|
|
139
140
|
|
|
140
141
|
## Quick Start
|
|
141
142
|
|
|
@@ -153,7 +154,7 @@ To install with server support
|
|
|
153
154
|
pip install graphinate[server]
|
|
154
155
|
```
|
|
155
156
|
|
|
156
|
-
**Graphinate** officially supports Python >= 3.
|
|
157
|
+
**Graphinate** officially supports Python >= 3.10.
|
|
157
158
|
|
|
158
159
|
### Example
|
|
159
160
|
|
|
@@ -178,11 +179,17 @@ def edge():
|
|
|
178
179
|
graphinate.materialize(graph_model)
|
|
179
180
|
```
|
|
180
181
|
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
#### `graphinate.model` function
|
|
185
|
+
|
|
181
186
|
> [!NOTE]
|
|
182
|
-
> ### `graphinate.model` function
|
|
183
187
|
> This function creates `GraphModel` class that is used to declaratively register _Edge_ and/or _Node_ data
|
|
184
188
|
> supplier functions by using the `GraphModel.node()` and `GraphModel.edge()` decorators.
|
|
185
|
-
|
|
189
|
+
|
|
190
|
+
#### `graphinate.materialize` function
|
|
191
|
+
|
|
192
|
+
> [!NOTE]
|
|
186
193
|
> This function can be used to easily generate an output from a `GraphModel` instance.
|
|
187
194
|
> By default, it will prompt the user to choose the output format, using a popup GUI dialog box.
|
|
188
195
|
|
|
@@ -190,7 +197,7 @@ graphinate.materialize(graph_model)
|
|
|
190
197
|
|
|
191
198
|
### Commands
|
|
192
199
|
|
|
193
|
-
```
|
|
200
|
+
```text
|
|
194
201
|
Usage: python -m graphinate [OPTIONS] COMMAND [ARGS]...
|
|
195
202
|
|
|
196
203
|
Options:
|
|
@@ -203,7 +210,7 @@ Commands:
|
|
|
203
210
|
|
|
204
211
|
#### Save
|
|
205
212
|
|
|
206
|
-
```
|
|
213
|
+
```text
|
|
207
214
|
Usage: python -m graphinate save [OPTIONS]
|
|
208
215
|
|
|
209
216
|
Options:
|
|
@@ -216,7 +223,7 @@ Options:
|
|
|
216
223
|
|
|
217
224
|
#### Server
|
|
218
225
|
|
|
219
|
-
```
|
|
226
|
+
```text
|
|
220
227
|
Usage: python -m graphinate server [OPTIONS]
|
|
221
228
|
|
|
222
229
|
Options:
|
|
@@ -312,7 +319,7 @@ python -m mkdocs build
|
|
|
312
319
|
|
|
313
320
|
<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>
|
|
314
321
|
|
|
315
|
-
|
|
322
|
+
---------------------
|
|
316
323
|
|
|
317
324
|
<img alt="Star Chart" src="https://forthebadge.com/images/badges/works-on-my-machine.svg">
|
|
318
325
|
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
<td>Tools</td>
|
|
22
22
|
<td>
|
|
23
23
|
<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/ruff"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json"
|
|
25
|
-
<a href="https://github.com/astral-sh/uv"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json"
|
|
26
|
-
<a href="https://squidfunk.github.io/mkdocs-material/"><img src="https://img.shields.io/badge/Material_for_MkDocs-526CFE?&logo=MaterialForMkDocs&logoColor=white&labelColor=grey"></a>
|
|
27
|
-
<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>
|
|
24
|
+
<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>
|
|
25
|
+
<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>
|
|
26
|
+
<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>
|
|
27
|
+
<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>
|
|
28
28
|
</td>
|
|
29
29
|
</tr>
|
|
30
30
|
<tr>
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
<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>
|
|
51
51
|
<br>
|
|
52
52
|
<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>
|
|
53
|
+
<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
54
|
<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>
|
|
54
55
|
<!--a href="https://snyk.io/test/github/erivlis/graphinate"><img alt="Snyk" src="https://snyk.io/test/github/erivlis/Graphinate/badge.svg"></a -->
|
|
55
56
|
</td>
|
|
@@ -73,9 +74,9 @@ In addition, there are several modes of output to enable examination of the Grap
|
|
|
73
74
|
|
|
74
75
|
### Links
|
|
75
76
|
|
|
76
|
-
- Website (including documentation): https://erivlis.github.io/graphinate
|
|
77
|
-
- Source: https://github.com/erivlis/graphinate
|
|
78
|
-
- Package: https://pypi.org/project/graphinate
|
|
77
|
+
- Website (including documentation): <https://erivlis.github.io/graphinate>
|
|
78
|
+
- Source: <https://github.com/erivlis/graphinate>
|
|
79
|
+
- Package: <https://pypi.org/project/graphinate>
|
|
79
80
|
|
|
80
81
|
## Quick Start
|
|
81
82
|
|
|
@@ -93,7 +94,7 @@ To install with server support
|
|
|
93
94
|
pip install graphinate[server]
|
|
94
95
|
```
|
|
95
96
|
|
|
96
|
-
**Graphinate** officially supports Python >= 3.
|
|
97
|
+
**Graphinate** officially supports Python >= 3.10.
|
|
97
98
|
|
|
98
99
|
### Example
|
|
99
100
|
|
|
@@ -118,11 +119,17 @@ def edge():
|
|
|
118
119
|
graphinate.materialize(graph_model)
|
|
119
120
|
```
|
|
120
121
|
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
#### `graphinate.model` function
|
|
125
|
+
|
|
121
126
|
> [!NOTE]
|
|
122
|
-
> ### `graphinate.model` function
|
|
123
127
|
> This function creates `GraphModel` class that is used to declaratively register _Edge_ and/or _Node_ data
|
|
124
128
|
> supplier functions by using the `GraphModel.node()` and `GraphModel.edge()` decorators.
|
|
125
|
-
|
|
129
|
+
|
|
130
|
+
#### `graphinate.materialize` function
|
|
131
|
+
|
|
132
|
+
> [!NOTE]
|
|
126
133
|
> This function can be used to easily generate an output from a `GraphModel` instance.
|
|
127
134
|
> By default, it will prompt the user to choose the output format, using a popup GUI dialog box.
|
|
128
135
|
|
|
@@ -130,7 +137,7 @@ graphinate.materialize(graph_model)
|
|
|
130
137
|
|
|
131
138
|
### Commands
|
|
132
139
|
|
|
133
|
-
```
|
|
140
|
+
```text
|
|
134
141
|
Usage: python -m graphinate [OPTIONS] COMMAND [ARGS]...
|
|
135
142
|
|
|
136
143
|
Options:
|
|
@@ -143,7 +150,7 @@ Commands:
|
|
|
143
150
|
|
|
144
151
|
#### Save
|
|
145
152
|
|
|
146
|
-
```
|
|
153
|
+
```text
|
|
147
154
|
Usage: python -m graphinate save [OPTIONS]
|
|
148
155
|
|
|
149
156
|
Options:
|
|
@@ -156,7 +163,7 @@ Options:
|
|
|
156
163
|
|
|
157
164
|
#### Server
|
|
158
165
|
|
|
159
|
-
```
|
|
166
|
+
```text
|
|
160
167
|
Usage: python -m graphinate server [OPTIONS]
|
|
161
168
|
|
|
162
169
|
Options:
|
|
@@ -252,7 +259,7 @@ python -m mkdocs build
|
|
|
252
259
|
|
|
253
260
|
<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>
|
|
254
261
|
|
|
255
|
-
|
|
262
|
+
---------------------
|
|
256
263
|
|
|
257
264
|
<img alt="Star Chart" src="https://forthebadge.com/images/badges/works-on-my-machine.svg">
|
|
258
265
|
|
|
@@ -7,6 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
## Repos
|
|
9
9
|
|
|
10
|
-
### Graphinate
|
|
10
|
+
### Graphinate
|
|
11
11
|
|
|
12
12
|
<img alt="Graphinate Star Chart" src="https://starchart.cc/erivlis/graphinate.svg">
|
|
13
|
+
|
|
14
|
+
https://starchart.cc/erivlis/graphinate.svg
|
|
15
|
+
|
|
16
|
+
### MappingTools
|
|
17
|
+
|
|
18
|
+
<img alt="MappingTools Star Chart" src="https://starchart.cc/erivlis/mappingtools.svg">
|
|
@@ -25,4 +25,4 @@
|
|
|
25
25
|
|
|
26
26
|
## IDE
|
|
27
27
|
|
|
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>
|
|
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>
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
<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
50
|
<br>
|
|
51
51
|
<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
|
+
<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>
|
|
52
53
|
<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>
|
|
53
54
|
</td>
|
|
54
55
|
</tr>
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Define functions to create an abstract syntax tree (AST) graph model using the 'graphinate' library.
|
|
3
|
+
The 'ast_graph_model' function parses the AST of a specified class and creates nodes and edges for the graph model.
|
|
4
|
+
The nodes represent AST nodes with their type and label, while the edges represent relationships between AST nodes.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
|
|
1
8
|
import ast
|
|
2
9
|
import hashlib
|
|
3
10
|
import inspect
|
|
@@ -35,6 +42,13 @@ def _ast_edge(parsed_ast: AST):
|
|
|
35
42
|
|
|
36
43
|
|
|
37
44
|
def ast_graph_model():
|
|
45
|
+
"""
|
|
46
|
+
Create an abstract syntax tree (AST) graph model.
|
|
47
|
+
|
|
48
|
+
Returns:
|
|
49
|
+
GraphModel: A graph model representing the AST nodes and their relationships.
|
|
50
|
+
"""
|
|
51
|
+
|
|
38
52
|
graph_model = graphinate.model(name='AST Graph')
|
|
39
53
|
|
|
40
54
|
root_ast_node = ast.parse(inspect.getsource(graphinate.builders.D3Builder))
|
|
@@ -6,6 +6,13 @@ from pipdeptree._non_host import handle_non_host_target
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
def dependency_graph_model():
|
|
9
|
+
"""
|
|
10
|
+
Generate a dependency graph model.
|
|
11
|
+
|
|
12
|
+
Returns:
|
|
13
|
+
GraphModel: A graph model representing the dependency graph.
|
|
14
|
+
"""
|
|
15
|
+
|
|
9
16
|
options = get_options(args=None)
|
|
10
17
|
handle_non_host_target(options)
|
|
11
18
|
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import functools
|
|
2
|
+
import os
|
|
3
|
+
from collections.abc import Iterable
|
|
4
|
+
from typing import Optional, Union
|
|
5
|
+
|
|
6
|
+
# see requirements.txt
|
|
7
|
+
from github import Auth, Github
|
|
8
|
+
from github.AuthenticatedUser import AuthenticatedUser
|
|
9
|
+
from github.Commit import Commit
|
|
10
|
+
from github.File import File
|
|
11
|
+
from github.NamedUser import NamedUser
|
|
12
|
+
from github.Repository import Repository
|
|
13
|
+
|
|
14
|
+
# define a 'GITHUB_TOKEN' Env Var.
|
|
15
|
+
token = os.getenv('GITHUB_TOKEN')
|
|
16
|
+
|
|
17
|
+
# using an access token
|
|
18
|
+
auth = Auth.Token(token)
|
|
19
|
+
|
|
20
|
+
# Public Web GitHub
|
|
21
|
+
client = Github(auth=auth)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# or GitHub Enterprise with custom hostname
|
|
25
|
+
# g = Github(auth=auth, base_url='https://{hostname}/api/v3')
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@functools.lru_cache
|
|
29
|
+
def github_user(user_id: Optional[str] = None) -> Union[NamedUser, AuthenticatedUser]:
|
|
30
|
+
"""
|
|
31
|
+
Get the GitHub user object for the specified user ID or the authenticated user.
|
|
32
|
+
|
|
33
|
+
Parameters:
|
|
34
|
+
user_id (Optional[str]): The ID of the user to retrieve.
|
|
35
|
+
If not provided, retrieve the authenticated user.
|
|
36
|
+
|
|
37
|
+
Returns:
|
|
38
|
+
Union[NamedUser, AuthenticatedUser]: The GitHub user object corresponding to the user ID provided,
|
|
39
|
+
or the authenticated user if no user ID is specified.
|
|
40
|
+
Note:
|
|
41
|
+
This function requires authentication with a valid GitHub token.
|
|
42
|
+
"""
|
|
43
|
+
user = client.get_user(user_id) if user_id else client.get_user()
|
|
44
|
+
return user
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@functools.lru_cache
|
|
48
|
+
def github_repositories(
|
|
49
|
+
user_id: Optional[str] = None,
|
|
50
|
+
repo_id: Optional[str] = None) -> Iterable[Repository]:
|
|
51
|
+
"""
|
|
52
|
+
Get the GitHub repositories for the specified user ID or the authenticated user.
|
|
53
|
+
|
|
54
|
+
Parameters:
|
|
55
|
+
user_id (Optional[str]): The ID of the user whose repositories to retrieve.
|
|
56
|
+
If not provided, retrieve repositories of the authenticated user.
|
|
57
|
+
repo_id (Optional[str]): The ID of the repository to retrieve.
|
|
58
|
+
If provided, only that repository will be returned.
|
|
59
|
+
|
|
60
|
+
Returns:
|
|
61
|
+
Iterable[Repository]:
|
|
62
|
+
A list of GitHub repository objects corresponding to the user ID and/or repository ID provided.
|
|
63
|
+
|
|
64
|
+
Note:
|
|
65
|
+
This function requires authentication with a valid GitHub token.
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
user = github_user(user_id)
|
|
69
|
+
if repo_id and (repo := user.get_repo(name=repo_id)):
|
|
70
|
+
return [repo]
|
|
71
|
+
else:
|
|
72
|
+
return user.get_repos()
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def github_commits(
|
|
76
|
+
repo: Repository,
|
|
77
|
+
commit_id: Optional[str] = None) -> Iterable[Commit]:
|
|
78
|
+
"""
|
|
79
|
+
Retrieve commits from a GitHub repository.
|
|
80
|
+
|
|
81
|
+
Parameters:
|
|
82
|
+
repo (Repository): The GitHub repository object from which to retrieve commits.
|
|
83
|
+
commit_id (str, optional): The ID of the commit to retrieve.
|
|
84
|
+
If provided, only that commit will be returned.
|
|
85
|
+
Defaults to None.
|
|
86
|
+
|
|
87
|
+
Returns:
|
|
88
|
+
Iterable[Commit]: An Iterable of Commit objects representing the commits in the repository.
|
|
89
|
+
|
|
90
|
+
Example:
|
|
91
|
+
To retrieve all commits from a repository:
|
|
92
|
+
```
|
|
93
|
+
for commit in github_commits(repo):
|
|
94
|
+
print(commit)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
To retrieve a specific commit by ID:
|
|
98
|
+
```
|
|
99
|
+
for commit in github_commits(repo, commit_id='abcdef123456'):
|
|
100
|
+
print(commit)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Note:
|
|
104
|
+
This function requires authentication with a valid GitHub token.
|
|
105
|
+
"""
|
|
106
|
+
if commit_id and (commit := repo.get_commit(sha=commit_id)):
|
|
107
|
+
yield commit
|
|
108
|
+
else:
|
|
109
|
+
yield from repo.get_commits()
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def github_files(
|
|
113
|
+
commit: Commit,
|
|
114
|
+
file_id: Optional[str] = None) -> Iterable[File]:
|
|
115
|
+
"""
|
|
116
|
+
Retrieves Files from a GitHub Commit
|
|
117
|
+
|
|
118
|
+
Parameters:
|
|
119
|
+
commit (Commit): A Commit object from the GitHub API.
|
|
120
|
+
file_id (Optional[str]): An optional parameter specifying the filename to filter the files. Default is None.
|
|
121
|
+
|
|
122
|
+
Returns:
|
|
123
|
+
Iterable[File]: An Iterable of File objects based on the filtering criteria.
|
|
124
|
+
|
|
125
|
+
Note:
|
|
126
|
+
This function requires authentication with a valid GitHub token.
|
|
127
|
+
"""
|
|
128
|
+
files: list[File] = commit.files
|
|
129
|
+
if file_id:
|
|
130
|
+
yield from [file for file in files if file.filename == file_id]
|
|
131
|
+
else:
|
|
132
|
+
yield from files
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Defines a function `followers_graph_model` that creates a graph model representing GitHub followers.
|
|
3
|
+
It recursively fetches followers of a given user up to a specified maximum depth.
|
|
4
|
+
The function yields edges between users in the graph.
|
|
5
|
+
"""
|
|
6
|
+
|
|
1
7
|
from typing import Optional
|
|
2
8
|
|
|
3
9
|
import graphinate
|
|
@@ -7,6 +13,16 @@ DEPTH = 0
|
|
|
7
13
|
|
|
8
14
|
|
|
9
15
|
def followers_graph_model(max_depth: int = DEPTH):
|
|
16
|
+
"""
|
|
17
|
+
Create a graph model representing GitHub followers.
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
max_depth (int): The maximum depth to fetch followers recursively (default is 0).
|
|
21
|
+
|
|
22
|
+
Returns:
|
|
23
|
+
GraphModel: A graph model representing GitHub followers.
|
|
24
|
+
"""
|
|
25
|
+
|
|
10
26
|
graph_model = graphinate.model(name='Github Followers Graph')
|
|
11
27
|
|
|
12
28
|
def _followers(user_id: Optional[str] = None, depth: int = 0, **kwargs):
|
|
@@ -8,6 +8,13 @@ from _client import github_commits, github_files, github_repositories, github_us
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
def repo_graph_model(): # noqa: C901
|
|
11
|
+
"""
|
|
12
|
+
Create a graph model for GitHub repositories.
|
|
13
|
+
|
|
14
|
+
Returns:
|
|
15
|
+
GraphModel: A graph model representing GitHub repositories with nodes and edges.
|
|
16
|
+
"""
|
|
17
|
+
|
|
11
18
|
graph_model = graphinate.model(name='GitHub Repository Graph')
|
|
12
19
|
|
|
13
20
|
@graph_model.edge
|
|
@@ -35,6 +35,21 @@ def spiral_torus_edges(n, k):
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
def atlas():
|
|
38
|
+
"""
|
|
39
|
+
Generate a dictionary of various graph structures and models based on the provided atlas.
|
|
40
|
+
The function creates different types of graphs and models using NetworkX library.
|
|
41
|
+
The generated graphs include Tetrahedron, Cube, Octahedron, Dodecahedron, Icosahedron, Tesseract, Truncated Cube,
|
|
42
|
+
Truncated Tetrahedron, Ladder, Ring, Möbius, Cylinder, Spiral, Spiral Torus, and Circulant[10,[2]].
|
|
43
|
+
Additionally, the function includes adjacency mappings for specific named graphs like
|
|
44
|
+
Buckyball - Truncated Icosahedral Graph, D30 - Rhombic Triacontahedral Graph, Small Rhombicosidodecahedral Graph,
|
|
45
|
+
Small Rhombicuboctahedral Graph, Great Rhombicosidodecahedral Graph, Disdyakis Dodecahedral Graph,
|
|
46
|
+
Deltoidal Icositetrahedral Graph, Icosidodecahedral Graph, Deltoidal Hexecontahedral Graph, Kocohl74,
|
|
47
|
+
Utility Graph, Errara Graph, and Dragon Curve Blob 6.
|
|
48
|
+
The adjacency mappings define the connections between nodes in each named graph.
|
|
49
|
+
The function returns a dictionary
|
|
50
|
+
containing the named graphs as keys and their corresponding NetworkX graph objects as values.
|
|
51
|
+
"""
|
|
52
|
+
|
|
38
53
|
ladder_size = 16
|
|
39
54
|
ladder = nx.ladder_graph(ladder_size)
|
|
40
55
|
|
|
@@ -775,6 +790,21 @@ def atlas():
|
|
|
775
790
|
|
|
776
791
|
|
|
777
792
|
def models(iterable):
|
|
793
|
+
"""
|
|
794
|
+
Generate a graph model based on the provided iterable of graphs.
|
|
795
|
+
The function creates a graph model named 'Graph Atlas' using the 'graphinate' library.
|
|
796
|
+
It then combines all the graphs from the input iterable into a single disjoint union graph using NetworkX library.
|
|
797
|
+
The function defines edges for the combined graph by iterating over all edges in the disjoint union graph and
|
|
798
|
+
yielding dictionaries with 'source' and 'target' keys representing the edge connections.
|
|
799
|
+
Finally, the function yields the created graph model containing the combined graph with defined edges.
|
|
800
|
+
|
|
801
|
+
Args:
|
|
802
|
+
iterable: An iterable containing graphs to be combined into a single graph model.
|
|
803
|
+
|
|
804
|
+
Yields:
|
|
805
|
+
GraphModel: A graph model containing the combined graph with defined edges.
|
|
806
|
+
"""
|
|
807
|
+
|
|
778
808
|
graph_model = graphinate.model('Graph Atlas')
|
|
779
809
|
|
|
780
810
|
graph_atlas = nx.disjoint_union_all(g for _, g in iterable)
|