Graphinate 0.8.1__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.
Files changed (122) hide show
  1. {graphinate-0.8.1 → graphinate-0.8.2}/.github/workflows/test-beta.yml +1 -1
  2. {graphinate-0.8.1 → graphinate-0.8.2}/PKG-INFO +1 -1
  3. {graphinate-0.8.1 → graphinate-0.8.2}/pyproject.toml +1 -1
  4. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/renderers/graphql.py +31 -18
  5. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/server/web/viewer/index.html +10 -6
  6. {graphinate-0.8.1 → graphinate-0.8.2}/.coveragerc +0 -0
  7. {graphinate-0.8.1 → graphinate-0.8.2}/.github/dependabot.yml +0 -0
  8. {graphinate-0.8.1 → graphinate-0.8.2}/.github/workflows/codeql.yml +0 -0
  9. {graphinate-0.8.1 → graphinate-0.8.2}/.github/workflows/publish-docs.yaml +0 -0
  10. {graphinate-0.8.1 → graphinate-0.8.2}/.github/workflows/publish.yml +0 -0
  11. {graphinate-0.8.1 → graphinate-0.8.2}/.github/workflows/test.yml +0 -0
  12. {graphinate-0.8.1 → graphinate-0.8.2}/.gitignore +0 -0
  13. {graphinate-0.8.1 → graphinate-0.8.2}/.sonarcloud.properties +0 -0
  14. {graphinate-0.8.1 → graphinate-0.8.2}/LICENSE +0 -0
  15. {graphinate-0.8.1 → graphinate-0.8.2}/README.md +0 -0
  16. {graphinate-0.8.1 → graphinate-0.8.2}/docs/.dates_cache.json +0 -0
  17. {graphinate-0.8.1 → graphinate-0.8.2}/docs/acknowledge.md +0 -0
  18. {graphinate-0.8.1 → graphinate-0.8.2}/docs/assets/badge/v0.json +0 -0
  19. {graphinate-0.8.1 → graphinate-0.8.2}/docs/assets/images/logo-128.png +0 -0
  20. {graphinate-0.8.1 → graphinate-0.8.2}/docs/assets/images/network_graph.png +0 -0
  21. {graphinate-0.8.1 → graphinate-0.8.2}/docs/assets/stylesheets/extra.css +0 -0
  22. {graphinate-0.8.1 → graphinate-0.8.2}/docs/examples/code.md +0 -0
  23. {graphinate-0.8.1 → graphinate-0.8.2}/docs/examples/github.md +0 -0
  24. {graphinate-0.8.1 → graphinate-0.8.2}/docs/examples/math.md +0 -0
  25. {graphinate-0.8.1 → graphinate-0.8.2}/docs/examples/social.md +0 -0
  26. {graphinate-0.8.1 → graphinate-0.8.2}/docs/examples/system.md +0 -0
  27. {graphinate-0.8.1 → graphinate-0.8.2}/docs/examples/web.md +0 -0
  28. {graphinate-0.8.1 → graphinate-0.8.2}/docs/gen_ref_pages.py +0 -0
  29. {graphinate-0.8.1 → graphinate-0.8.2}/docs/index.md +0 -0
  30. {graphinate-0.8.1 → graphinate-0.8.2}/docs/intro.md +0 -0
  31. {graphinate-0.8.1 → graphinate-0.8.2}/docs/start.md +0 -0
  32. {graphinate-0.8.1 → graphinate-0.8.2}/docs/tutorial.md +0 -0
  33. {graphinate-0.8.1 → graphinate-0.8.2}/docs/usage/cli.md +0 -0
  34. {graphinate-0.8.1 → graphinate-0.8.2}/docs/usage/lib.md +0 -0
  35. {graphinate-0.8.1 → graphinate-0.8.2}/examples/code/git_commits.py +0 -0
  36. {graphinate-0.8.1 → graphinate-0.8.2}/examples/code/python_ast.py +0 -0
  37. {graphinate-0.8.1 → graphinate-0.8.2}/examples/code/python_dependencies.py +0 -0
  38. {graphinate-0.8.1 → graphinate-0.8.2}/examples/code/requirements.txt +0 -0
  39. {graphinate-0.8.1 → graphinate-0.8.2}/examples/code/tokens.py +0 -0
  40. {graphinate-0.8.1 → graphinate-0.8.2}/examples/github/_client.py +0 -0
  41. {graphinate-0.8.1 → graphinate-0.8.2}/examples/github/commits_visibilty_graph.py +0 -0
  42. {graphinate-0.8.1 → graphinate-0.8.2}/examples/github/followers.graphql +0 -0
  43. {graphinate-0.8.1 → graphinate-0.8.2}/examples/github/followers.py +0 -0
  44. {graphinate-0.8.1 → graphinate-0.8.2}/examples/github/graphql.config.yml +0 -0
  45. {graphinate-0.8.1 → graphinate-0.8.2}/examples/github/repositories.graphql +0 -0
  46. {graphinate-0.8.1 → graphinate-0.8.2}/examples/github/repositories.py +0 -0
  47. {graphinate-0.8.1 → graphinate-0.8.2}/examples/github/requirements.txt +0 -0
  48. {graphinate-0.8.1 → graphinate-0.8.2}/examples/math/__init__.py +0 -0
  49. {graphinate-0.8.1 → graphinate-0.8.2}/examples/math/_test_materializers.py +0 -0
  50. {graphinate-0.8.1 → graphinate-0.8.2}/examples/math/graph_atlas.py +0 -0
  51. {graphinate-0.8.1 → graphinate-0.8.2}/examples/math/graphs.py +0 -0
  52. {graphinate-0.8.1 → graphinate-0.8.2}/examples/math/gui.py +0 -0
  53. {graphinate-0.8.1 → graphinate-0.8.2}/examples/math/materializers.py +0 -0
  54. {graphinate-0.8.1 → graphinate-0.8.2}/examples/math/polygonal_graph.py +0 -0
  55. {graphinate-0.8.1 → graphinate-0.8.2}/examples/math/requirements.txt +0 -0
  56. {graphinate-0.8.1 → graphinate-0.8.2}/examples/social/cache/13/dd/73ce25face7beb30b69b64feeb77.val +0 -0
  57. {graphinate-0.8.1 → graphinate-0.8.2}/examples/social/cache/21/9e/00846f323987ba16cfbe0127d8eb.val +0 -0
  58. {graphinate-0.8.1 → graphinate-0.8.2}/examples/social/cache/70/b6/2aefb0269adce7fedf877fa0d267.val +0 -0
  59. {graphinate-0.8.1 → graphinate-0.8.2}/examples/social/cache/87/f5/ec1739bc369e84c3fcb302bf532a.val +0 -0
  60. {graphinate-0.8.1 → graphinate-0.8.2}/examples/social/cache/ba/fe/3aca7b2c38abff60e7ce5eb486a8.val +0 -0
  61. {graphinate-0.8.1 → graphinate-0.8.2}/examples/social/cache/c7/9e/ce82b0288020b7152779df09bd73.val +0 -0
  62. {graphinate-0.8.1 → graphinate-0.8.2}/examples/social/cache/cache.db +0 -0
  63. {graphinate-0.8.1 → graphinate-0.8.2}/examples/social/cache/d2/53/3b88f2fc162561cfdbbe9abc352a.val +0 -0
  64. {graphinate-0.8.1 → graphinate-0.8.2}/examples/social/cache/e2/d5/5d079f200eabf9b625b0473f6fbe.val +0 -0
  65. {graphinate-0.8.1 → graphinate-0.8.2}/examples/social/gui.py +0 -0
  66. {graphinate-0.8.1 → graphinate-0.8.2}/examples/social/music_artists.py +0 -0
  67. {graphinate-0.8.1 → graphinate-0.8.2}/examples/social/requirements.txt +0 -0
  68. {graphinate-0.8.1 → graphinate-0.8.2}/examples/system/.ignore +0 -0
  69. {graphinate-0.8.1 → graphinate-0.8.2}/examples/system/files.py +0 -0
  70. {graphinate-0.8.1 → graphinate-0.8.2}/examples/system/processes.py +0 -0
  71. {graphinate-0.8.1 → graphinate-0.8.2}/examples/system/requirements.txt +0 -0
  72. {graphinate-0.8.1 → graphinate-0.8.2}/examples/web/html_dom.py +0 -0
  73. {graphinate-0.8.1 → graphinate-0.8.2}/examples/web/page_links.py +0 -0
  74. {graphinate-0.8.1 → graphinate-0.8.2}/examples/web/requirements.txt +0 -0
  75. {graphinate-0.8.1 → graphinate-0.8.2}/mkdocs.yml +0 -0
  76. {graphinate-0.8.1 → graphinate-0.8.2}/playground/ethernet/traceroute.py +0 -0
  77. {graphinate-0.8.1 → graphinate-0.8.2}/playground/genric_graph.graphql +0 -0
  78. {graphinate-0.8.1 → graphinate-0.8.2}/playground/graphql.config.yml +0 -0
  79. {graphinate-0.8.1 → graphinate-0.8.2}/playground/house_of_graphs.py +0 -0
  80. {graphinate-0.8.1/examples → graphinate-0.8.2/playground}/science/caffeine.py +0 -0
  81. {graphinate-0.8.1 → graphinate-0.8.2}/playground/social/albums.json +0 -0
  82. {graphinate-0.8.1 → graphinate-0.8.2}/playground/social/musicisians.py +0 -0
  83. {graphinate-0.8.1 → graphinate-0.8.2}/playground/text/nlp_graph.py +0 -0
  84. {graphinate-0.8.1 → graphinate-0.8.2}/playground/text/requirements.txt +0 -0
  85. {graphinate-0.8.1 → graphinate-0.8.2}/playground/time_series/requirements.txt +0 -0
  86. {graphinate-0.8.1 → graphinate-0.8.2}/playground/time_series/visibility_graph.py +0 -0
  87. {graphinate-0.8.1 → graphinate-0.8.2}/sonar-project.properties +0 -0
  88. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/__init__.py +0 -0
  89. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/__main__.py +0 -0
  90. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/builders.py +0 -0
  91. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/cli.py +0 -0
  92. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/color.py +0 -0
  93. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/constants.py +0 -0
  94. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/converters.py +0 -0
  95. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/modeling.py +0 -0
  96. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/renderers/__init__.py +0 -0
  97. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/renderers/matplotlib.py +0 -0
  98. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/server/__init__.py +0 -0
  99. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/server/starlette/__init__.py +0 -0
  100. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/server/starlette/views.py +0 -0
  101. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/server/web/__init__.py +0 -0
  102. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/server/web/elements/__init__.py +0 -0
  103. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/server/web/elements/index.html +0 -0
  104. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/server/web/graphiql/__init__.py +0 -0
  105. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/server/web/graphiql/index.html +0 -0
  106. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/server/web/rapidoc/__init__.py +0 -0
  107. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/server/web/rapidoc/index.html +0 -0
  108. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/server/web/static/images/logo-128.png +0 -0
  109. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/server/web/static/images/logo.svg +0 -0
  110. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/server/web/static/images/network_graph.png +0 -0
  111. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/server/web/viewer/__init__.py +0 -0
  112. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/server/web/voyager/__init__.py +0 -0
  113. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/server/web/voyager/index.html +0 -0
  114. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/tools.py +0 -0
  115. {graphinate-0.8.1 → graphinate-0.8.2}/src/graphinate/typing.py +0 -0
  116. {graphinate-0.8.1 → graphinate-0.8.2}/tests/conftest.py +0 -0
  117. {graphinate-0.8.1 → graphinate-0.8.2}/tests/graphinate/test_builders.py +0 -0
  118. {graphinate-0.8.1 → graphinate-0.8.2}/tests/graphinate/test_cli.py +0 -0
  119. {graphinate-0.8.1 → graphinate-0.8.2}/tests/graphinate/test_color.py +0 -0
  120. {graphinate-0.8.1 → graphinate-0.8.2}/tests/graphinate/test_converters.py +0 -0
  121. {graphinate-0.8.1 → graphinate-0.8.2}/tests/graphinate/test_modeling.py +0 -0
  122. {graphinate-0.8.1 → graphinate-0.8.2}/tests/graphinate/test_server.py +0 -0
@@ -16,7 +16,7 @@ jobs:
16
16
  fail-fast: false
17
17
  matrix:
18
18
  # https://github.com/actions/python-versions/blob/main/versions-manifest.json
19
- python-version: [ "3.14.0-alpha.5" ]
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 }}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Graphinate
3
- Version: 0.8.1
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "Graphinate"
3
- version = "0.8.1"
3
+ version = "0.8.2"
4
4
  description = "Graphinate. Data to Graphs."
5
5
  authors = [
6
6
  { name = "Eran Rivlis", email = "eran@rivlis.info" },
@@ -29,7 +29,7 @@ def _openapi_schema(request: Request) -> ASGIApp:
29
29
  """
30
30
  schema_data = {
31
31
  'openapi': '3.0.0',
32
- 'info': {'title': 'Graphinate API', 'version': '0.6.0'},
32
+ 'info': {'title': 'Graphinate API', 'version': '0.8.2'},
33
33
  'paths': {
34
34
  '/graphql': {'get': {'responses': {200: {'description': 'GraphQL'}}}},
35
35
  '/graphiql': {'get': {'responses': {200: {'description': 'GraphiQL UI.'}}}},
@@ -43,45 +43,58 @@ def _openapi_schema(request: Request) -> ASGIApp:
43
43
  return schema.OpenAPIResponse(request=request)
44
44
 
45
45
 
46
- def server(graphql_schema: strawberry.Schema, port: int = DEFAULT_PORT, **kwargs):
47
- """
48
- Args:
49
- graphql_schema: The Strawberry GraphQL schema.
50
- port: The port number to run the server on. Defaults to 8072.
51
-
52
- Returns:
53
- """
46
+ def _graphql_app(graphql_schema: strawberry.Schema) -> strawberry.asgi.GraphQL:
54
47
  graphql_schema.extensions.append(OpenTelemetryExtension)
48
+ graphql_app = GraphQL(graphql_schema, graphiql=True)
49
+ return graphql_app
50
+
55
51
 
56
- def open_url():
57
- for app_name in ('viewer',):
58
- webbrowser.open(f'http://localhost:{port}/{app_name}')
52
+ def _starlette_app(graphql_app: strawberry.asgi.GraphQL | None = None, port: int = DEFAULT_PORT, **kwargs) -> Starlette:
53
+ def open_url(endpoint):
54
+ webbrowser.open(f'http://localhost:{port}/{endpoint}')
59
55
 
60
56
  @contextlib.asynccontextmanager
61
57
  async def lifespan(app: Starlette): # pragma: no cover
62
58
  if kwargs.get('browse'):
63
- open_url()
59
+ open_url('viewer')
64
60
  yield
65
61
 
66
- graphql_app = GraphQL(graphql_schema, graphiql=True, graphql_ide='pathfinder')
67
62
  app = Starlette(
68
63
  lifespan=lifespan,
69
64
  routes=routes()
70
65
  )
71
- app.add_route(GRAPHQL_ROUTE_PATH, graphql_app)
72
- app.add_websocket_route(GRAPHQL_ROUTE_PATH, graphql_app)
73
66
 
74
67
  from starlette_prometheus import PrometheusMiddleware, metrics
75
68
  app.add_middleware(PrometheusMiddleware)
76
69
  app.add_route("/metrics", metrics)
77
- app.add_route("/schema", route=_openapi_schema, include_in_schema=False)
78
- app.add_route("/openapi.json", route=_openapi_schema, include_in_schema=False)
70
+
71
+ if graphql_app:
72
+ app.add_route(GRAPHQL_ROUTE_PATH, graphql_app)
73
+ app.add_websocket_route(GRAPHQL_ROUTE_PATH, graphql_app)
74
+ app.add_route("/schema", route=_openapi_schema, include_in_schema=False)
75
+ app.add_route("/openapi.json", route=_openapi_schema, include_in_schema=False)
79
76
 
80
77
  async def redirect_to_viewer(request):
81
78
  return RedirectResponse(url='/viewer')
82
79
 
83
80
  app.add_route('/', redirect_to_viewer)
84
81
 
82
+ return app
83
+
84
+
85
+ def server(graphql_schema: strawberry.Schema, port: int = DEFAULT_PORT, **kwargs):
86
+ """
87
+ Args:
88
+ graphql_schema: The Strawberry GraphQL schema.
89
+ port: The port number to run the server on. Defaults to 8072.
90
+
91
+ Returns:
92
+ """
93
+
94
+ graphql_app = _graphql_app(graphql_schema)
95
+
96
+ app = _starlette_app(graphql_app, port=port, **kwargs)
97
+
85
98
  import uvicorn
86
99
  uvicorn.run(app, host='0.0.0.0', port=port)
87
100
 
@@ -2,9 +2,15 @@
2
2
  <html lang="">
3
3
  <head>
4
4
  <title>Graphinate Viewer</title>
5
- <script type="module"
6
- integrity="sha384-Dt9sd/AA7KNs3M8XRJs7rNwUZ9bRWhsKjVz4UpCle+pCI/lqdylOH3mcYcKRBPKF"
7
- crossorigin="anonymous">
5
+ <link rel="modulepreload"
6
+ href="https://unpkg.com/tweakpane@4.0.5/dist/tweakpane.min.js"
7
+ integrity="sha384-Dt9sd/AA7KNs3M8XRJs7rNwUZ9bRWhsKjVz4UpCle+pCI/lqdylOH3mcYcKRBPKF"
8
+ crossorigin="anonymous">
9
+ <link rel="modulepreload"
10
+ href="https://unpkg.com/@tweakpane/plugin-essentials@0.2.1/dist/tweakpane-plugin-essentials.min.js"
11
+ integrity="sha384-q0QZoZn8RhBcEJYEcp7qn991YSevEjaL/GJwbQyuY0FlicmHWZmA384DCVgumN4u"
12
+ crossorigin="anonymous">
13
+ <script type="module">
8
14
  // Import ES module
9
15
  import * as Tweakpane from 'https://unpkg.com/tweakpane@4.0.5/dist/tweakpane.min.js';
10
16
  import * as TweakpaneEssentialsPlugin
@@ -13,10 +19,8 @@
13
19
  window.Tweakpane = Tweakpane;
14
20
  window.TweakpaneEssentialsPlugin = TweakpaneEssentialsPlugin;
15
21
  </script>
16
-
17
-
18
22
  <script src="https://unpkg.com/3d-force-graph@1.76.1/dist/3d-force-graph.min.js"
19
- integrity="sha384-7PiolihqoWLaY+8+zoccK5LLtWiGzovYvg5gjpKkQYhL51yq4JYt6owMj3bzQFBc"
23
+ integrity="sha384-hNwCF3Cb+c2HRg4oybw2YGB80Ytiml/p9GEMz87Ac4SiSMF4lZ/uywlTqHH+zWx0"
20
24
  crossorigin="anonymous"></script>
21
25
  <script src="https://unpkg.com/murmurhash-js@1.0.0/murmurhash3_gc.js"
22
26
  integrity="sha384-g+j9YCPmBDu4mlFm1UGyQFBh5P7x/xYGJvqbX/WFbzJC2V/wwBRCorSlQ1UaAED0"
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