mantatech-sdk 0.5b0.dev65__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 (54) hide show
  1. manta/__init__.light.py +22 -0
  2. manta/__init__.py +83 -0
  3. manta/__main__.py +21 -0
  4. manta/apis/__init__.py +7 -0
  5. manta/apis/async_user_api.py +6458 -0
  6. manta/apis/graph.py +498 -0
  7. manta/apis/module.py +316 -0
  8. manta/apis/results.py +251 -0
  9. manta/apis/swarm.py +206 -0
  10. manta/apis/user_api.py +1016 -0
  11. manta/cli/__init__.py +1 -0
  12. manta/cli/commands/__init__.py +1 -0
  13. manta/cli/commands/base_handler.py +229 -0
  14. manta/cli/commands/doc.py +192 -0
  15. manta/cli/commands/install.py +346 -0
  16. manta/cli/commands/sdk.py +9 -0
  17. manta/cli/commands/sdk_cluster.py +211 -0
  18. manta/cli/commands/sdk_config.py +347 -0
  19. manta/cli/commands/sdk_globals.py +280 -0
  20. manta/cli/commands/sdk_logs.py +174 -0
  21. manta/cli/commands/sdk_main.py +167 -0
  22. manta/cli/commands/sdk_module.py +516 -0
  23. manta/cli/commands/sdk_nodes.py +168 -0
  24. manta/cli/commands/sdk_original.py +3873 -0
  25. manta/cli/commands/sdk_results.py +265 -0
  26. manta/cli/commands/sdk_swarm.py +454 -0
  27. manta/cli/commands/sdk_user.py +234 -0
  28. manta/cli/commands/status.py +292 -0
  29. manta/cli/component_detector.py +112 -0
  30. manta/cli/config_manager.py +445 -0
  31. manta/cli/main.py +265 -0
  32. manta/cli/utils/__init__.py +27 -0
  33. manta/cli/utils/converters.py +140 -0
  34. manta/clients/cluster_management_client.py +486 -0
  35. manta/clients/local_client.py +149 -0
  36. manta/clients/module_management_client.py +217 -0
  37. manta/clients/swarm_management_client.py +562 -0
  38. manta/clients/user_management_client.py +395 -0
  39. manta/clients/world_client.py +195 -0
  40. manta/light/__init__.py +31 -0
  41. manta/light/globals.py +245 -0
  42. manta/light/local.py +407 -0
  43. manta/light/logging_config.py +39 -0
  44. manta/light/path.py +116 -0
  45. manta/light/results.py +236 -0
  46. manta/light/task.py +100 -0
  47. manta/light/utils.py +217 -0
  48. manta/light/world.py +177 -0
  49. mantatech_sdk-0.5b0.dev65.dist-info/METADATA +1039 -0
  50. mantatech_sdk-0.5b0.dev65.dist-info/RECORD +54 -0
  51. mantatech_sdk-0.5b0.dev65.dist-info/WHEEL +5 -0
  52. mantatech_sdk-0.5b0.dev65.dist-info/entry_points.txt +2 -0
  53. mantatech_sdk-0.5b0.dev65.dist-info/licenses/LICENSE +683 -0
  54. mantatech_sdk-0.5b0.dev65.dist-info/top_level.txt +1 -0
@@ -0,0 +1,22 @@
1
+ # Minimal __init__.py for manta.light runtime in containers
2
+ # This file replaces the main __init__.py during Docker build to avoid heavy imports
3
+ import importlib.metadata
4
+
5
+ __version__ = importlib.metadata.version("mantatech-sdk")
6
+
7
+ # Only import the light module for container runtime
8
+ # No heavy API imports needed for task execution
9
+ from . import light
10
+
11
+ # Import essential conversions that manta.light exports
12
+ try:
13
+ from manta_common.conversions import bytes_to_dict, dict_to_bytes
14
+
15
+ __all__ = [
16
+ "light",
17
+ "bytes_to_dict",
18
+ "dict_to_bytes",
19
+ ]
20
+ except ImportError:
21
+ # If conversions are not available, just export light
22
+ __all__ = ["light"]
manta/__init__.py ADDED
@@ -0,0 +1,83 @@
1
+ import importlib.metadata
2
+
3
+ __version__ = importlib.metadata.version("mantatech-sdk")
4
+
5
+ from typing import Optional
6
+
7
+ # Import submodules for explicit access
8
+ from . import apis as api # Expose as manta.api
9
+
10
+ # Backwards compatibility - expose main API classes at top level
11
+ from .apis import *
12
+ from .apis.results import *
13
+ from manta_common.conversions import bytes_to_dict, dict_to_bytes
14
+
15
+ # from . import light # Expose as manta.light
16
+
17
+
18
+ def configure_from_config(config_name: Optional[str] = None) -> AsyncUserAPI:
19
+ """Configure AsyncUserAPI from SDK configuration.
20
+
21
+ Args:
22
+ config_name: Configuration name (uses active if None)
23
+
24
+ Returns:
25
+ Configured AsyncUserAPI instance
26
+
27
+ Raises:
28
+ ValueError: If configuration is not found or invalid
29
+
30
+ Examples:
31
+ # Use active configuration
32
+ api = manta.configure_from_config()
33
+
34
+ # Use specific configuration
35
+ api = manta.configure_from_config("production")
36
+ """
37
+ from .cli.config_manager import SDKConfigManager
38
+
39
+ config_manager = SDKConfigManager()
40
+
41
+ if config_name is None:
42
+ config = config_manager.get_active_config()
43
+ config_name = config_manager.get_active_config_name()
44
+ else:
45
+ config = config_manager.load_config(config_name)
46
+
47
+ if not config:
48
+ raise ValueError(
49
+ f"Configuration '{config_name}' not found. "
50
+ "Run 'manta sdk config init --interactive' to create a configuration."
51
+ )
52
+
53
+ # Validate configuration
54
+ errors = config_manager.validate_config(config)
55
+ if errors:
56
+ error_msg = f"Configuration '{config_name}' has validation errors:\n"
57
+ for error in errors:
58
+ error_msg += f" • {error}\n"
59
+ error_msg += "Run 'manta sdk config doctor' for more details."
60
+ raise ValueError(error_msg)
61
+
62
+ # Create AsyncUserAPI with validated configuration
63
+ return AsyncUserAPI(
64
+ token=config.token,
65
+ host=config.host,
66
+ port=config.port,
67
+ )
68
+
69
+
70
+ __all__ = [
71
+ # Submodules for explicit import
72
+ "api", # Access via: from manta.api import AsyncUserAPI
73
+ # Configuration utilities
74
+ "configure_from_config", # Main configuration function
75
+ # Backwards compatibility - legacy top-level imports
76
+ "AsyncUserAPI",
77
+ "Module",
78
+ "Swarm",
79
+ "Task",
80
+ "UserAPI",
81
+ "bytes_to_dict",
82
+ "dict_to_bytes",
83
+ ]
manta/__main__.py ADDED
@@ -0,0 +1,21 @@
1
+ """Manta SDK CLI entry point.
2
+
3
+ This module provides the command-line interface entry point for the Manta SDK.
4
+ When manta-sdk is installed, it serves as the primary CLI for all manta components.
5
+ It can be executed using 'python -m manta' or 'manta' (when installed).
6
+ """
7
+
8
+ import sys
9
+
10
+ from .cli.main import main as unified_main
11
+
12
+
13
+ def main():
14
+ """Main CLI entry point - primary handler when manta-sdk is installed."""
15
+ # When manta-sdk is installed, it's the primary CLI provider
16
+ # Use the unified CLI from manta-common which detects all installed components
17
+ return unified_main()
18
+
19
+
20
+ if __name__ == "__main__":
21
+ sys.exit(main())
manta/apis/__init__.py ADDED
@@ -0,0 +1,7 @@
1
+ # ClusterAPI has been removed in the refactoring
2
+ from .async_user_api import AsyncUserAPI
3
+ from .user_api import UserAPI
4
+ from .graph import Task as Task
5
+ from .module import Module as Module
6
+ from .results import *
7
+ from .swarm import Swarm as Swarm