grctl-sdk-python 0.1.0__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.
@@ -0,0 +1,45 @@
1
+ Metadata-Version: 2.4
2
+ Name: grctl-sdk-python
3
+ Version: 0.1.0
4
+ Summary: The Python SDK for the grctl platform
5
+ Requires-Python: >=3.13
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: nats-py>=2.7.0
8
+ Requires-Dist: msgspec>=0.18.0
9
+ Requires-Dist: python-ulid>=2.0.0
10
+ Requires-Dist: pydantic-settings>=2.11.0
11
+ Requires-Dist: pyyaml>=6.0.3
12
+ Requires-Dist: pydantic>=2.12.5
13
+
14
+ # Ground Control Python SDK
15
+
16
+ The official Python SDK for [Ground Control](https://github.com/cemevren/grctl) — a lightweight workflow orchestration engine built for fail-safe execution.
17
+
18
+ **[Documentation](https://cemevren.github.io/grctl/)**
19
+
20
+ > [!WARNING]
21
+ > **Status: Pre-alpha**
22
+ > The API is currently unstable and subject to change.
23
+
24
+ ## Installation
25
+
26
+ ```bash
27
+ pip install grctl-sdk-python
28
+ ```
29
+
30
+ ## Requirements
31
+
32
+ - Python 3.13 or later
33
+ - A running Ground Control server (`grctld`)
34
+
35
+ ## Contributing
36
+
37
+ Contributions are welcome! Please read our [Contributing Guide](https://github.com/cemevren/grctl/blob/main/CONTRIBUTING.md) for more information.
38
+
39
+ ## Security
40
+
41
+ Please see our [Security Policy](https://github.com/cemevren/grctl/blob/main/SECURITY.md) for reporting vulnerabilities.
42
+
43
+ ## License
44
+
45
+ This project is licensed under the Apache License 2.0 - see the [LICENSE](https://github.com/cemevren/grctl/blob/main/LICENSE) file for details.
@@ -0,0 +1,32 @@
1
+ # Ground Control Python SDK
2
+
3
+ The official Python SDK for [Ground Control](https://github.com/cemevren/grctl) — a lightweight workflow orchestration engine built for fail-safe execution.
4
+
5
+ **[Documentation](https://cemevren.github.io/grctl/)**
6
+
7
+ > [!WARNING]
8
+ > **Status: Pre-alpha**
9
+ > The API is currently unstable and subject to change.
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ pip install grctl-sdk-python
15
+ ```
16
+
17
+ ## Requirements
18
+
19
+ - Python 3.13 or later
20
+ - A running Ground Control server (`grctld`)
21
+
22
+ ## Contributing
23
+
24
+ Contributions are welcome! Please read our [Contributing Guide](https://github.com/cemevren/grctl/blob/main/CONTRIBUTING.md) for more information.
25
+
26
+ ## Security
27
+
28
+ Please see our [Security Policy](https://github.com/cemevren/grctl/blob/main/SECURITY.md) for reporting vulnerabilities.
29
+
30
+ ## License
31
+
32
+ This project is licensed under the Apache License 2.0 - see the [LICENSE](https://github.com/cemevren/grctl/blob/main/LICENSE) file for details.
@@ -0,0 +1 @@
1
+ """Ground Control Python SDK package."""
@@ -0,0 +1,50 @@
1
+ """Custom logging configuration for Ground Control."""
2
+
3
+ import logging
4
+ import sys
5
+
6
+
7
+ class CustomFormatter(logging.Formatter):
8
+ def format(self, record: logging.LogRecord) -> str:
9
+ # Format: LEVEL TIME METHOD:LINE_NUM MESSAGE
10
+ timestamp = self.formatTime(record, "%H:%M:%S")
11
+
12
+ level = record.levelname
13
+
14
+ # Get class/function context
15
+ context = f"{record.module}"
16
+ if record.funcName != "<module>":
17
+ context = f"{context}.{record.funcName}:{record.lineno}"
18
+
19
+ # Format the message
20
+ msg = f"{level} {timestamp} [{context}] {record.getMessage()}"
21
+
22
+ # Add exception info if present
23
+ if record.exc_info:
24
+ msg += "\n" + self.formatException(record.exc_info)
25
+
26
+ return msg
27
+
28
+
29
+ def setup_logging(level: int = logging.INFO) -> None:
30
+ """Configure root logger with custom formatter."""
31
+ handler = logging.StreamHandler(sys.stdout)
32
+ handler.setLevel(level)
33
+
34
+ formatter = CustomFormatter()
35
+ handler.setFormatter(formatter)
36
+
37
+ root_logger = logging.getLogger()
38
+ root_logger.setLevel(level)
39
+ root_logger.addHandler(handler)
40
+
41
+
42
+ def get_logger(name: str) -> logging.Logger:
43
+ """Get a logger instance with the custom formatter already configured."""
44
+ logger = logging.getLogger(name)
45
+
46
+ # Set logger level to DEBUG to allow all messages through
47
+ # Actual filtering happens at handler level
48
+ logger.setLevel(logging.DEBUG)
49
+
50
+ return logger
@@ -0,0 +1,22 @@
1
+ from functools import lru_cache
2
+
3
+ from pydantic_settings import BaseSettings, SettingsConfigDict
4
+
5
+
6
+ class EngineSettings(BaseSettings):
7
+ nats_servers: list[str] = ["nats://localhost:4225"]
8
+ nats_connect_timeout: float = 2.0
9
+ nats_request_timeout: float = 5.0
10
+ nats_max_reconnect_attempts: int = 10
11
+ nats_reconnect_time_wait: float = 2.0
12
+ nats_worker_ack_wait: float = 5.0
13
+
14
+ model_config = SettingsConfigDict(
15
+ env_prefix="ENGINE_",
16
+ )
17
+
18
+
19
+ @lru_cache
20
+ def get_settings() -> EngineSettings:
21
+ """Get engine settings from environment variables."""
22
+ return EngineSettings()
@@ -0,0 +1,45 @@
1
+ Metadata-Version: 2.4
2
+ Name: grctl-sdk-python
3
+ Version: 0.1.0
4
+ Summary: The Python SDK for the grctl platform
5
+ Requires-Python: >=3.13
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: nats-py>=2.7.0
8
+ Requires-Dist: msgspec>=0.18.0
9
+ Requires-Dist: python-ulid>=2.0.0
10
+ Requires-Dist: pydantic-settings>=2.11.0
11
+ Requires-Dist: pyyaml>=6.0.3
12
+ Requires-Dist: pydantic>=2.12.5
13
+
14
+ # Ground Control Python SDK
15
+
16
+ The official Python SDK for [Ground Control](https://github.com/cemevren/grctl) — a lightweight workflow orchestration engine built for fail-safe execution.
17
+
18
+ **[Documentation](https://cemevren.github.io/grctl/)**
19
+
20
+ > [!WARNING]
21
+ > **Status: Pre-alpha**
22
+ > The API is currently unstable and subject to change.
23
+
24
+ ## Installation
25
+
26
+ ```bash
27
+ pip install grctl-sdk-python
28
+ ```
29
+
30
+ ## Requirements
31
+
32
+ - Python 3.13 or later
33
+ - A running Ground Control server (`grctld`)
34
+
35
+ ## Contributing
36
+
37
+ Contributions are welcome! Please read our [Contributing Guide](https://github.com/cemevren/grctl/blob/main/CONTRIBUTING.md) for more information.
38
+
39
+ ## Security
40
+
41
+ Please see our [Security Policy](https://github.com/cemevren/grctl/blob/main/SECURITY.md) for reporting vulnerabilities.
42
+
43
+ ## License
44
+
45
+ This project is licensed under the Apache License 2.0 - see the [LICENSE](https://github.com/cemevren/grctl/blob/main/LICENSE) file for details.
@@ -0,0 +1,10 @@
1
+ README.md
2
+ pyproject.toml
3
+ grctl/__init__.py
4
+ grctl/logging_config.py
5
+ grctl/settings.py
6
+ grctl_sdk_python.egg-info/PKG-INFO
7
+ grctl_sdk_python.egg-info/SOURCES.txt
8
+ grctl_sdk_python.egg-info/dependency_links.txt
9
+ grctl_sdk_python.egg-info/requires.txt
10
+ grctl_sdk_python.egg-info/top_level.txt
@@ -0,0 +1,6 @@
1
+ nats-py>=2.7.0
2
+ msgspec>=0.18.0
3
+ python-ulid>=2.0.0
4
+ pydantic-settings>=2.11.0
5
+ pyyaml>=6.0.3
6
+ pydantic>=2.12.5
@@ -0,0 +1,93 @@
1
+ [project]
2
+ name = "grctl-sdk-python"
3
+ version = "0.1.0"
4
+ description = "The Python SDK for the grctl platform"
5
+ readme = "README.md"
6
+ requires-python = ">=3.13"
7
+ dependencies = [
8
+ "nats-py>=2.7.0",
9
+ "msgspec>=0.18.0",
10
+ "python-ulid>=2.0.0",
11
+ "pydantic-settings>=2.11.0",
12
+ "pyyaml>=6.0.3",
13
+ "pydantic>=2.12.5",
14
+ ]
15
+
16
+ [dependency-groups]
17
+ dev = [
18
+ "pyright>=1.1.407",
19
+ "pytest>=9.0.2",
20
+ "pytest-asyncio>=1.2.0",
21
+ "ruff>=0.15.9",
22
+ ]
23
+
24
+
25
+ [tool.uv]
26
+ package = true
27
+
28
+ [tool.setuptools]
29
+ packages = ["grctl"]
30
+
31
+ [tool.pytest.ini_options]
32
+ addopts = "--ignore=tests/examples --ignore=tests/e2e"
33
+ testpaths = ["tests"]
34
+ log_cli = true
35
+ log_cli_level = "DEBUG"
36
+ pythonpath = "."
37
+ asyncio_mode = "auto"
38
+ markers = [
39
+ "integration: marks tests as integration tests",
40
+ ]
41
+
42
+
43
+ [tool.ruff]
44
+ line-length = 120
45
+
46
+ lint.select = ["ALL"] # Include all the rules, including new ones
47
+ lint.ignore = [
48
+ "BLE001",
49
+ "ANN401", # Dynamically typed expressions (typing.Any) are disallowed
50
+ "COM812",
51
+ "D100",
52
+ "D101",
53
+ "D102",
54
+ "D103",
55
+ "D105",
56
+ "D107",
57
+ "D203",
58
+ "D211",
59
+ "D213",
60
+ "EM101",
61
+ "EM102",
62
+ "G004",
63
+ "TRY003",
64
+ "TC001",
65
+ "TC003",
66
+ "S324",
67
+
68
+ ]
69
+ [tool.ruff.lint.extend-per-file-ignores]
70
+ # Specific rules to ignore for tests
71
+ "tests/**/*.py" = [
72
+ "S101", # Allow assert in tests
73
+ "ANN001", # Allow missing type annotations in tests
74
+ "ANN201", # Allow missing type annotations in tests
75
+ "ANN202", # Allow missing return type annotations in tests
76
+ "ANN204", # Allow missing type annotations for self and cls in tests
77
+ "ARG", # Unused function args for fixtures
78
+ "COM812",
79
+ "FBT", # Don't care about booleans as positional arguments in tests for @pytest.mark.parametrize
80
+ "INP001", # Ignore that its not in a real python module. Doesn't matter for tests
81
+ # The below are debateable
82
+ "PLR2004", # Magic value used in comparison, ...
83
+ "S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
84
+ "ERA001", # Commented out code
85
+ "F841", # Unused variable
86
+ "PGH003",
87
+ "SLF001", # Private member accessed outside of class
88
+ "TRY002", # Create your own exception classes
89
+ ]
90
+
91
+ "grctl/models/**/*.py" = [
92
+ "ERA001", # Commented out code
93
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+