sc-utility 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.
File without changes
@@ -0,0 +1,75 @@
1
+ Metadata-Version: 2.4
2
+ Name: sc_utility
3
+ Version: 0.1.0
4
+ Summary: Shared utilities for logging and configuration management
5
+ Author-email: Nick Elsey <nick@spelloconsulting.com>
6
+ Project-URL: Homepage, https://github.com/YourUser/sc_utility
7
+ Project-URL: Repository, https://github.com/YourUser/sc_utility
8
+ Requires-Python: >=3.8
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: cerberus>=1.3.7
12
+ Requires-Dist: pyyaml>=6.0.2
13
+ Requires-Dist: requests>=2.32.3
14
+ Requires-Dist: tzdata>=2025.2
15
+ Dynamic: license-file
16
+
17
+ # Spello Consulting Utility Library
18
+
19
+ A Python utility library for log file management and YAML configuration file management
20
+
21
+ Details to follow
22
+
23
+ ## Example code
24
+
25
+ from config_schemas import ConfigSchema
26
+ from sc_config_mgr import SCConfigManager
27
+ from sc_logging import SCLogger
28
+
29
+ CONFIG_FILE = "config.yaml"
30
+
31
+
32
+ def main():
33
+ print("Hello from sc-utility!")
34
+
35
+ # Get our default schema, validation schema, and placeholders
36
+ schemas = ConfigSchema()
37
+
38
+ # Initialize the SC_ConfigManager class
39
+ config = SCConfigManager(
40
+ config_file=CONFIG_FILE,
41
+ default_config=schemas.default, # Replace with your default config if needed
42
+ validation_schema=schemas.validation, # Replace with your validation schema if needed
43
+ placeholders=schemas.placeholders # Replace with your placeholders if needed
44
+ )
45
+
46
+ config_value = config.get("AmberAPI", "APIKey", default="this is the default value")
47
+ if config_value is None:
48
+ print("Configuration value not found")
49
+ else:
50
+ print(f"Configuration loaded successfully. Sample value: {config_value}")
51
+
52
+ # Initialize the SC_Logger class
53
+ logger = SCLogger(config.get_logger_settings())
54
+
55
+ logger.log_message("This is a test message at the debug level.", "debug")
56
+ # logger.log_message("This is a test message at the error level.", "error")
57
+
58
+ # Setup email
59
+ email_settings = config.get_email_settings()
60
+ logger.register_email_settings(email_settings)
61
+
62
+ if logger.send_email("Hello world", "This is a test email from the sc-utility test harness."):
63
+ logger.log_message("Email sent OK.", "detailed")
64
+
65
+ if logger.get_fatal_error():
66
+ print("Prior fatal error detected.")
67
+ logger.clear_fatal_error()
68
+
69
+ # logger.log_fatal_error("This is a test fatal error message.")
70
+
71
+ logger.clear_fatal_error()
72
+
73
+ if __name__ == "__main__":
74
+ main()
75
+
@@ -0,0 +1,59 @@
1
+ # Spello Consulting Utility Library
2
+
3
+ A Python utility library for log file management and YAML configuration file management
4
+
5
+ Details to follow
6
+
7
+ ## Example code
8
+
9
+ from config_schemas import ConfigSchema
10
+ from sc_config_mgr import SCConfigManager
11
+ from sc_logging import SCLogger
12
+
13
+ CONFIG_FILE = "config.yaml"
14
+
15
+
16
+ def main():
17
+ print("Hello from sc-utility!")
18
+
19
+ # Get our default schema, validation schema, and placeholders
20
+ schemas = ConfigSchema()
21
+
22
+ # Initialize the SC_ConfigManager class
23
+ config = SCConfigManager(
24
+ config_file=CONFIG_FILE,
25
+ default_config=schemas.default, # Replace with your default config if needed
26
+ validation_schema=schemas.validation, # Replace with your validation schema if needed
27
+ placeholders=schemas.placeholders # Replace with your placeholders if needed
28
+ )
29
+
30
+ config_value = config.get("AmberAPI", "APIKey", default="this is the default value")
31
+ if config_value is None:
32
+ print("Configuration value not found")
33
+ else:
34
+ print(f"Configuration loaded successfully. Sample value: {config_value}")
35
+
36
+ # Initialize the SC_Logger class
37
+ logger = SCLogger(config.get_logger_settings())
38
+
39
+ logger.log_message("This is a test message at the debug level.", "debug")
40
+ # logger.log_message("This is a test message at the error level.", "error")
41
+
42
+ # Setup email
43
+ email_settings = config.get_email_settings()
44
+ logger.register_email_settings(email_settings)
45
+
46
+ if logger.send_email("Hello world", "This is a test email from the sc-utility test harness."):
47
+ logger.log_message("Email sent OK.", "detailed")
48
+
49
+ if logger.get_fatal_error():
50
+ print("Prior fatal error detected.")
51
+ logger.clear_fatal_error()
52
+
53
+ # logger.log_fatal_error("This is a test fatal error message.")
54
+
55
+ logger.clear_fatal_error()
56
+
57
+ if __name__ == "__main__":
58
+ main()
59
+
@@ -0,0 +1,28 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "sc_utility"
7
+ version = "0.1.0"
8
+ description = "Shared utilities for logging and configuration management"
9
+ authors = [{ name = "Nick Elsey", email = "nick@spelloconsulting.com" }]
10
+ readme = "README.md"
11
+ license = { file = "LICENSE" }
12
+ requires-python = ">=3.8"
13
+ dependencies = [
14
+ "cerberus>=1.3.7",
15
+ "pyyaml>=6.0.2",
16
+ "requests>=2.32.3",
17
+ "tzdata>=2025.2",
18
+ ]
19
+
20
+ [project.urls]
21
+ Homepage = "https://github.com/YourUser/sc_utility"
22
+ Repository = "https://github.com/YourUser/sc_utility"
23
+
24
+ [tool.setuptools]
25
+ package-dir = { "" = "src" }
26
+
27
+ [tool.setuptools.packages.find]
28
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,4 @@
1
+ from .sc_config_mgr import SCConfigManager
2
+ from .sc_logging import SCLogger
3
+
4
+ __all__ = ["SCConfigManager", "SCLogger"]
File without changes
File without changes
@@ -0,0 +1,75 @@
1
+ Metadata-Version: 2.4
2
+ Name: sc_utility
3
+ Version: 0.1.0
4
+ Summary: Shared utilities for logging and configuration management
5
+ Author-email: Nick Elsey <nick@spelloconsulting.com>
6
+ Project-URL: Homepage, https://github.com/YourUser/sc_utility
7
+ Project-URL: Repository, https://github.com/YourUser/sc_utility
8
+ Requires-Python: >=3.8
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: cerberus>=1.3.7
12
+ Requires-Dist: pyyaml>=6.0.2
13
+ Requires-Dist: requests>=2.32.3
14
+ Requires-Dist: tzdata>=2025.2
15
+ Dynamic: license-file
16
+
17
+ # Spello Consulting Utility Library
18
+
19
+ A Python utility library for log file management and YAML configuration file management
20
+
21
+ Details to follow
22
+
23
+ ## Example code
24
+
25
+ from config_schemas import ConfigSchema
26
+ from sc_config_mgr import SCConfigManager
27
+ from sc_logging import SCLogger
28
+
29
+ CONFIG_FILE = "config.yaml"
30
+
31
+
32
+ def main():
33
+ print("Hello from sc-utility!")
34
+
35
+ # Get our default schema, validation schema, and placeholders
36
+ schemas = ConfigSchema()
37
+
38
+ # Initialize the SC_ConfigManager class
39
+ config = SCConfigManager(
40
+ config_file=CONFIG_FILE,
41
+ default_config=schemas.default, # Replace with your default config if needed
42
+ validation_schema=schemas.validation, # Replace with your validation schema if needed
43
+ placeholders=schemas.placeholders # Replace with your placeholders if needed
44
+ )
45
+
46
+ config_value = config.get("AmberAPI", "APIKey", default="this is the default value")
47
+ if config_value is None:
48
+ print("Configuration value not found")
49
+ else:
50
+ print(f"Configuration loaded successfully. Sample value: {config_value}")
51
+
52
+ # Initialize the SC_Logger class
53
+ logger = SCLogger(config.get_logger_settings())
54
+
55
+ logger.log_message("This is a test message at the debug level.", "debug")
56
+ # logger.log_message("This is a test message at the error level.", "error")
57
+
58
+ # Setup email
59
+ email_settings = config.get_email_settings()
60
+ logger.register_email_settings(email_settings)
61
+
62
+ if logger.send_email("Hello world", "This is a test email from the sc-utility test harness."):
63
+ logger.log_message("Email sent OK.", "detailed")
64
+
65
+ if logger.get_fatal_error():
66
+ print("Prior fatal error detected.")
67
+ logger.clear_fatal_error()
68
+
69
+ # logger.log_fatal_error("This is a test fatal error message.")
70
+
71
+ logger.clear_fatal_error()
72
+
73
+ if __name__ == "__main__":
74
+ main()
75
+
@@ -0,0 +1,11 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/sc_utility/__init__.py
5
+ src/sc_utility/sc_config_mgr.py
6
+ src/sc_utility/sc_logging.py
7
+ src/sc_utility.egg-info/PKG-INFO
8
+ src/sc_utility.egg-info/SOURCES.txt
9
+ src/sc_utility.egg-info/dependency_links.txt
10
+ src/sc_utility.egg-info/requires.txt
11
+ src/sc_utility.egg-info/top_level.txt
@@ -0,0 +1,4 @@
1
+ cerberus>=1.3.7
2
+ pyyaml>=6.0.2
3
+ requests>=2.32.3
4
+ tzdata>=2025.2
@@ -0,0 +1 @@
1
+ sc_utility