nodetool-core 0.7.0__py3-none-any.whl

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 (121) hide show
  1. nodetool/config/__init__.py +0 -0
  2. nodetool/config/configuration.py +82 -0
  3. nodetool/config/env_guard.py +34 -0
  4. nodetool/config/environment.py +818 -0
  5. nodetool/config/logging_config.py +149 -0
  6. nodetool/config/settings.py +556 -0
  7. nodetool/integrations/__init__.py +0 -0
  8. nodetool/integrations/huggingface/__init__.py +0 -0
  9. nodetool/integrations/huggingface/artifact_inspector.py +319 -0
  10. nodetool/integrations/huggingface/async_downloader.py +498 -0
  11. nodetool/integrations/huggingface/gguf_models.json +312951 -0
  12. nodetool/integrations/huggingface/hf_auth.py +28 -0
  13. nodetool/integrations/huggingface/hf_cache.py +127 -0
  14. nodetool/integrations/huggingface/hf_fast_cache.py +721 -0
  15. nodetool/integrations/huggingface/hf_utils.py +23 -0
  16. nodetool/integrations/huggingface/huggingface_file.py +76 -0
  17. nodetool/integrations/huggingface/huggingface_models.py +2154 -0
  18. nodetool/integrations/huggingface/llama_cpp_download.py +202 -0
  19. nodetool/integrations/huggingface/mlx_models.json +34946 -0
  20. nodetool/integrations/huggingface/progress_download.py +579 -0
  21. nodetool/integrations/huggingface/safetensor_layout.py +124 -0
  22. nodetool/integrations/huggingface/safetensors_inspector.py +572 -0
  23. nodetool/integrations/vectorstores/__init__.py +0 -0
  24. nodetool/integrations/vectorstores/chroma/__init__.py +0 -0
  25. nodetool/integrations/vectorstores/chroma/async_chroma_client.py +225 -0
  26. nodetool/integrations/vectorstores/chroma/chroma_client.py +229 -0
  27. nodetool/integrations/vectorstores/chroma/provider_embedding_function.py +196 -0
  28. nodetool/io/__init__.py +0 -0
  29. nodetool/io/asset_utils.py +30 -0
  30. nodetool/io/get_files.py +59 -0
  31. nodetool/io/media_fetch.py +264 -0
  32. nodetool/io/path_utils.py +86 -0
  33. nodetool/io/uri_utils.py +29 -0
  34. nodetool/media/__init__.py +0 -0
  35. nodetool/media/audio/__init__.py +0 -0
  36. nodetool/media/audio/audio_helpers.py +318 -0
  37. nodetool/media/common/__init__.py +0 -0
  38. nodetool/media/common/media_constants.py +9 -0
  39. nodetool/media/common/media_utils.py +230 -0
  40. nodetool/media/image/__init__.py +0 -0
  41. nodetool/media/image/font_utils.py +97 -0
  42. nodetool/media/image/image_utils.py +166 -0
  43. nodetool/media/image/web_font_utils.py +417 -0
  44. nodetool/media/video/__init__.py +0 -0
  45. nodetool/media/video/video_utils.py +447 -0
  46. nodetool/metadata/__init__.py +0 -0
  47. nodetool/metadata/node_metadata.py +206 -0
  48. nodetool/metadata/tool_types.py +61 -0
  49. nodetool/metadata/type_metadata.py +306 -0
  50. nodetool/metadata/typecheck.py +249 -0
  51. nodetool/metadata/types.py +2752 -0
  52. nodetool/metadata/utils.py +136 -0
  53. nodetool/ml/__init__.py +0 -0
  54. nodetool/ml/core/__init__.py +0 -0
  55. nodetool/ml/core/model_manager.py +904 -0
  56. nodetool/ml/models/__init__.py +0 -0
  57. nodetool/ml/models/asr_models.py +42 -0
  58. nodetool/ml/models/image_models.py +47 -0
  59. nodetool/ml/models/language_models.py +61 -0
  60. nodetool/ml/models/model_cache.py +193 -0
  61. nodetool/ml/models/tts_models.py +61 -0
  62. nodetool/ml/models/video_models.py +40 -0
  63. nodetool/package_metadata/nodetool-core.json +9 -0
  64. nodetool/package_tools/__init__.py +9 -0
  65. nodetool/package_tools/__main__.py +101 -0
  66. nodetool/package_tools/enrich.py +135 -0
  67. nodetool/package_tools/scanner.py +294 -0
  68. nodetool/providers/README.md +14 -0
  69. nodetool/providers/__init__.py +187 -0
  70. nodetool/providers/base.py +1008 -0
  71. nodetool/providers/types.py +129 -0
  72. nodetool/py.typed +0 -0
  73. nodetool/runtime/__init__.py +6 -0
  74. nodetool/runtime/resources.py +138 -0
  75. nodetool/security/README.md +25 -0
  76. nodetool/security/__init__.py +16 -0
  77. nodetool/security/crypto.py +119 -0
  78. nodetool/security/master_key.py +245 -0
  79. nodetool/security/secret_helper.py +60 -0
  80. nodetool/storage/__init__.py +0 -0
  81. nodetool/storage/abstract_storage.py +15 -0
  82. nodetool/storage/file_storage.py +47 -0
  83. nodetool/storage/memory_storage.py +27 -0
  84. nodetool/types/api_graph.py +148 -0
  85. nodetool/types/content_types.py +181 -0
  86. nodetool/types/message_types.py +21 -0
  87. nodetool/types/model.py +67 -0
  88. nodetool/types/prediction.py +74 -0
  89. nodetool/types/wrap_primitive_types.py +23 -0
  90. nodetool/utils/__init__.py +0 -0
  91. nodetool/utils/message_parsing.py +118 -0
  92. nodetool/utils/network.py +47 -0
  93. nodetool/worker/__init__.py +15 -0
  94. nodetool/worker/__main__.py +75 -0
  95. nodetool/worker/context_stub.py +137 -0
  96. nodetool/worker/executor.py +439 -0
  97. nodetool/worker/node_loader.py +265 -0
  98. nodetool/worker/protocol.py +186 -0
  99. nodetool/worker/provider_handler.py +548 -0
  100. nodetool/worker/server.py +120 -0
  101. nodetool/worker/stdio_server.py +191 -0
  102. nodetool/worker/stdio_stdout_guard.py +68 -0
  103. nodetool/workflows/README.md +18 -0
  104. nodetool/workflows/__init__.py +1 -0
  105. nodetool/workflows/asset_storage.py +515 -0
  106. nodetool/workflows/base_node.py +2461 -0
  107. nodetool/workflows/channel.py +472 -0
  108. nodetool/workflows/graph.py +581 -0
  109. nodetool/workflows/inbox.py +472 -0
  110. nodetool/workflows/io.py +331 -0
  111. nodetool/workflows/memory_utils.py +933 -0
  112. nodetool/workflows/processing_context.py +2491 -0
  113. nodetool/workflows/processing_offload.py +279 -0
  114. nodetool/workflows/property.py +155 -0
  115. nodetool/workflows/torch_support.py +298 -0
  116. nodetool/workflows/types.py +382 -0
  117. nodetool_core-0.7.0.dist-info/METADATA +175 -0
  118. nodetool_core-0.7.0.dist-info/RECORD +121 -0
  119. nodetool_core-0.7.0.dist-info/WHEEL +4 -0
  120. nodetool_core-0.7.0.dist-info/entry_points.txt +2 -0
  121. nodetool_core-0.7.0.dist-info/licenses/LICENSE +661 -0
File without changes
@@ -0,0 +1,82 @@
1
+ from dataclasses import dataclass
2
+
3
+
4
+ @dataclass
5
+ class Setting:
6
+ package_name: str
7
+ env_var: str
8
+ group: str
9
+ description: str
10
+ enum: list[str] | None
11
+
12
+
13
+ @dataclass
14
+ class Secret:
15
+ package_name: str
16
+ env_var: str
17
+ group: str
18
+ description: str
19
+
20
+
21
+ _registry: list[Setting] = []
22
+ _secrets_registry: list[Secret] = []
23
+
24
+
25
+ def register_secret(
26
+ package_name: str,
27
+ env_var: str,
28
+ group: str,
29
+ description: str,
30
+ ) -> list[Secret]:
31
+ """Register a new secret."""
32
+ secret = Secret(package_name=package_name, env_var=env_var, group=group, description=description)
33
+ _secrets_registry.append(secret)
34
+ return list(_secrets_registry)
35
+
36
+
37
+ def register_setting(
38
+ package_name: str,
39
+ env_var: str,
40
+ group: str,
41
+ description: str,
42
+ enum: list[str] | None = None,
43
+ ) -> list[Setting]:
44
+ """Register a new setting.
45
+
46
+ Parameters
47
+ ----------
48
+ package_name: str
49
+ Name of the package registering the setting.
50
+ env_var: str
51
+ The environment variable name.
52
+ group: str
53
+ Group the setting belongs to.
54
+ description: str
55
+ Human readable description of the setting.
56
+ enum: List[str] | None
57
+ List of possible values for the setting.
58
+
59
+ Returns
60
+ -------
61
+ List[Setting]
62
+ The list of all registered settings.
63
+ """
64
+ setting = Setting(
65
+ package_name=package_name,
66
+ env_var=env_var,
67
+ group=group,
68
+ description=description,
69
+ enum=enum,
70
+ )
71
+ _registry.append(setting)
72
+ return list(_registry)
73
+
74
+
75
+ def get_settings_registry() -> list[Setting]:
76
+ """Return the list of all registered settings."""
77
+ return list(_registry)
78
+
79
+
80
+ def get_secrets_registry() -> list[Secret]:
81
+ """Return the list of all registered secrets."""
82
+ return list(_secrets_registry)
@@ -0,0 +1,34 @@
1
+ import os
2
+ import sys
3
+ from typing import Any
4
+
5
+
6
+ def _is_running_under_pytest() -> bool:
7
+ """Detect pytest presence from command-line arguments or environment.
8
+
9
+ This checks both sys.argv (for main pytest process) and PYTEST_CURRENT_TEST
10
+ environment variable (which is set in all pytest workers, including xdist workers).
11
+ """
12
+ # Check if PYTEST_CURRENT_TEST is set (works for all pytest workers)
13
+ if "PYTEST_CURRENT_TEST" in os.environ:
14
+ return True
15
+ # Fallback to checking sys.argv for main process
16
+ return any(arg and "pytest" in str(arg).lower() for arg in sys.argv)
17
+
18
+
19
+ RUNNING_PYTEST = _is_running_under_pytest()
20
+
21
+
22
+ def get_system_env_value(key: str, default: Any = None) -> Any:
23
+ """Return an environment variable value.
24
+
25
+ Tests may monkeypatch os.environ to drive configuration, so we always
26
+ read from the current process environment instead of short-circuiting
27
+ when pytest is detected.
28
+ """
29
+ return os.environ.get(key, default)
30
+
31
+
32
+ def get_system_env() -> dict[str, str]:
33
+ """Return the current process environment."""
34
+ return dict(os.environ)