secploy 0.2.7__tar.gz → 0.2.9__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 (24) hide show
  1. {secploy-0.2.7 → secploy-0.2.9}/LICENSE +1 -1
  2. {secploy-0.2.7/secploy.egg-info → secploy-0.2.9}/PKG-INFO +2 -2
  3. {secploy-0.2.7 → secploy-0.2.9}/secploy/__init__.py +1 -1
  4. {secploy-0.2.7 → secploy-0.2.9}/secploy/client.py +26 -22
  5. {secploy-0.2.7 → secploy-0.2.9}/secploy/lib/config.py +7 -0
  6. secploy-0.2.9/secploy/utils.py +0 -0
  7. {secploy-0.2.7 → secploy-0.2.9/secploy.egg-info}/PKG-INFO +2 -2
  8. {secploy-0.2.7 → secploy-0.2.9}/secploy.egg-info/SOURCES.txt +1 -0
  9. {secploy-0.2.7 → secploy-0.2.9}/setup.py +2 -2
  10. {secploy-0.2.7 → secploy-0.2.9}/MANIFEST.in +0 -0
  11. {secploy-0.2.7 → secploy-0.2.9}/README.md +0 -0
  12. {secploy-0.2.7 → secploy-0.2.9}/secploy/enums.py +0 -0
  13. {secploy-0.2.7 → secploy-0.2.9}/secploy/events.py +0 -0
  14. /secploy-0.2.7/secploy/utils.py → /secploy-0.2.9/secploy/handlers.py +0 -0
  15. {secploy-0.2.7 → secploy-0.2.9}/secploy/lib/__init__.py +0 -0
  16. {secploy-0.2.7 → secploy-0.2.9}/secploy/lib/secploy_logger.py +0 -0
  17. {secploy-0.2.7 → secploy-0.2.9}/secploy/log_capture.py +0 -0
  18. {secploy-0.2.7 → secploy-0.2.9}/secploy/processor.py +0 -0
  19. {secploy-0.2.7 → secploy-0.2.9}/secploy/schemas.py +0 -0
  20. {secploy-0.2.7 → secploy-0.2.9}/secploy.egg-info/dependency_links.txt +0 -0
  21. {secploy-0.2.7 → secploy-0.2.9}/secploy.egg-info/entry_points.txt +0 -0
  22. {secploy-0.2.7 → secploy-0.2.9}/secploy.egg-info/requires.txt +0 -0
  23. {secploy-0.2.7 → secploy-0.2.9}/secploy.egg-info/top_level.txt +0 -0
  24. {secploy-0.2.7 → secploy-0.2.9}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 AGASTRONICS
3
+ Copyright (c) 2025 AGASTRONICX
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: secploy
3
- Version: 0.2.7
3
+ Version: 0.2.9
4
4
  Summary: Event tracking and monitoring SDK for Python applications
5
5
  Home-page: https://github.com/agastronics/secploy-python-sdk
6
6
  Author: Agastronics
7
- Author-email: support@agastronics.com
7
+ Author-email: support@secploy.com
8
8
  Classifier: Development Status :: 4 - Beta
9
9
  Classifier: Intended Audience :: Developers
10
10
  Classifier: License :: OSI Approved :: MIT License
@@ -6,7 +6,7 @@ from .client import SecployClient
6
6
  from .schemas import SecployConfig
7
7
  from .schemas import LogLevel
8
8
 
9
- __version__ = "0.2.5"
9
+ __version__ = "0.2.9"
10
10
  __author__ = "Agastronics"
11
11
  __email__ = "support@agastronics.com"
12
12
  __description__ = "Event tracking and monitoring SDK for Python applications"
@@ -3,6 +3,8 @@ import logging
3
3
  from typing import Any, Dict, Optional, List, Union
4
4
  import queue
5
5
 
6
+ from secploy.lib.config import config_to_namespace
7
+
6
8
  from .lib import setup_logger, load_config, DEFAULT_CONFIG, secploy_logger
7
9
  from .schemas import SecployConfig, LogLevel
8
10
  from .log_capture import SecployLogCapturer
@@ -34,8 +36,9 @@ class SecployClient:
34
36
  TypeError: If configuration values have invalid types
35
37
  """
36
38
  # Load config from file if provided else it will load from default locations or find .secploy
37
- config = load_config(config_file)
38
-
39
+ config_dict = load_config(config_file)
40
+ config = config_to_namespace(config_dict)
41
+
39
42
  if config is None:
40
43
  secploy_logger.error("No valid configuration found")
41
44
  return
@@ -49,40 +52,41 @@ class SecployClient:
49
52
  config.organization_id = organization_id
50
53
 
51
54
  # Special handling for log_level if it's a string
52
- if isinstance(config.get('log_level'), str):
55
+ log_level = getattr(config, 'log_level', None)
56
+ if isinstance(log_level, str):
53
57
  try:
54
- config['log_level'] = LogLevel(config['log_level'].upper())
58
+ setattr(config, 'log_level', LogLevel(log_level.upper()))
55
59
  except ValueError:
56
60
  raise ValueError(
57
- f"Invalid log level: {config.get('log_level')}. Must be one of: "
61
+ f"Invalid log level: {log_level}. Must be one of: "
58
62
  f"{', '.join(level.value for level in LogLevel)}"
59
63
  )
60
64
 
61
65
  # Validate required fields
62
- if not config.get('api_key'):
66
+ if not getattr(config, 'api_key', None):
63
67
  raise ValueError("API key is required")
64
- if not config.get('environment_key'):
68
+ if not getattr(config, 'environment_key', None):
65
69
  raise ValueError("Environment key is required")
66
- if not config.get('organization_id'):
70
+ if not getattr(config, 'organization_id', None):
67
71
  raise ValueError("Organization ID is required")
68
- if not config.get('ingest_url'):
72
+ if not getattr(config, 'ingest_url', None):
69
73
  raise ValueError("Ingest URL is required")
70
74
 
71
75
  # Set instance attributes from config
72
- self.api_key = config['api_key']
73
- self.environment_key = config.get('environment_key')
74
- self.organization_id = config.get('organization_id')
75
- self.environment = config.get('environment', 'development')
76
- self.sampling_rate = config.get('sampling_rate', 1.0)
77
- self.ingest_url = config['ingest_url'].rstrip("/")
78
- self.heartbeat_interval = config.get('heartbeat_interval', 60)
79
- self.max_retry = config.get('max_retry', 5)
80
- self.debug = config.get('debug', False)
81
- self.log_level = config.get('log_level', 'INFO')
82
-
76
+ self.api_key = getattr(config, 'api_key')
77
+ self.environment_key = getattr(config, 'environment_key', None)
78
+ self.organization_id = getattr(config, 'organization_id', None)
79
+ self.environment = getattr(config, 'environment', 'development')
80
+ self.sampling_rate = getattr(config, 'sampling_rate', 1.0)
81
+ self.ingest_url = getattr(config, 'ingest_url').rstrip("/")
82
+ self.heartbeat_interval = getattr(config, 'heartbeat_interval', 60)
83
+ self.max_retry = getattr(config, 'max_retry', 5)
84
+ self.debug = getattr(config, 'debug', False)
85
+ self.log_level = getattr(config, 'log_level', 'INFO')
86
+
83
87
  # Batch processing configuration
84
- self.batch_size = config.get('batch_size', 100) # Max events per batch
85
- self.flush_interval = config.get('flush_interval', 60) # Max seconds between flushes
88
+ self.batch_size = getattr(config, 'batch_size', 100) # Max events per batch
89
+ self.flush_interval = getattr(config, 'flush_interval', 60) # Max seconds between flushes
86
90
 
87
91
  # Initialize internal state
88
92
  self._event_queue = queue.Queue()
@@ -11,6 +11,7 @@ import os # For path checks
11
11
  import glob # For finding config files
12
12
  import logging
13
13
  from typing import Dict, Optional, Union
14
+ from types import SimpleNamespace
14
15
 
15
16
  logger = logging.getLogger(__name__)
16
17
 
@@ -160,6 +161,12 @@ def load_config(file_path: Optional[str] = None) -> Dict[str, Union[str, int, fl
160
161
 
161
162
  return config
162
163
 
164
+ def config_to_namespace(config: Dict[str, Union[str, int, float, bool, None]]) -> SimpleNamespace:
165
+ """
166
+ Converts a config dict to an object with attribute access.
167
+ """
168
+ return SimpleNamespace(**config)
169
+
163
170
 
164
171
  def validate_config(config: Dict[str, Union[str, int, float, bool, None]]) -> bool:
165
172
  """
File without changes
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: secploy
3
- Version: 0.2.7
3
+ Version: 0.2.9
4
4
  Summary: Event tracking and monitoring SDK for Python applications
5
5
  Home-page: https://github.com/agastronics/secploy-python-sdk
6
6
  Author: Agastronics
7
- Author-email: support@agastronics.com
7
+ Author-email: support@secploy.com
8
8
  Classifier: Development Status :: 4 - Beta
9
9
  Classifier: Intended Audience :: Developers
10
10
  Classifier: License :: OSI Approved :: MIT License
@@ -7,6 +7,7 @@ secploy/__init__.py
7
7
  secploy/client.py
8
8
  secploy/enums.py
9
9
  secploy/events.py
10
+ secploy/handlers.py
10
11
  secploy/log_capture.py
11
12
  secploy/processor.py
12
13
  secploy/schemas.py
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="secploy",
5
- version="0.2.7",
5
+ version="0.2.9",
6
6
  packages=find_packages(),
7
7
  install_requires=[
8
8
  "requests>=2.25.0",
@@ -10,7 +10,7 @@ setup(
10
10
  "pydantic>=2.0.0",
11
11
  ],
12
12
  author="Agastronics",
13
- author_email="support@agastronics.com",
13
+ author_email="support@secploy.com",
14
14
  description="Event tracking and monitoring SDK for Python applications",
15
15
  long_description=open("README.md").read() if open("README.md") else "",
16
16
  long_description_content_type="text/markdown",
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