pythonautomation-framework-utils 0.1.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.
@@ -0,0 +1,16 @@
1
+ Metadata-Version: 2.4
2
+ Name: pythonautomation-framework-utils
3
+ Version: 0.1.0
4
+ Summary: Reusable utilities for automation frameworks
5
+ Home-page: https://github.com/sabarishmurugan/automation-framework-utils
6
+ Author: SabarishM
7
+ Author-email: sabarishmurugan <mrsabarishmurugan@gmail.com>
8
+ License: MIT
9
+ Requires-Python: >=3.8
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Requires-Dist: requests
13
+ Dynamic: author
14
+ Dynamic: home-page
15
+ Dynamic: license-file
16
+ Dynamic: requires-python
@@ -0,0 +1,10 @@
1
+ pythonautomation_framework_utils-0.1.0.dist-info/licenses/LICENSE,sha256=VNMVJRpxqUrEkZmE6g5ZGakaX0Eoi7d-NgjKeI_0S9U,1085
2
+ utils/__init__.py,sha256=VuccFAEYGOopn_DjqXXLuGQmXNI3GcZ01lVoYHI9ahw,277
3
+ utils/api_utils.py,sha256=OnatJer8WS5YnyeuVb5mkh8NU3n3kT4qj7C3ROW13sE,360
4
+ utils/file_utils.py,sha256=OXa1dEUNxclsqQ78K7LdsK4hGE21NUMPh7yocgvwkPM,275
5
+ utils/logger.py,sha256=8VgYRzqReWT68cexa3acRoHxiMbnQs4D7vcbCJWVkpY,391
6
+ utils/wait_utils.py,sha256=UGu-hT7_8CC_5chiTkQRvKc0K7qbZpDleohhYZMoPYE,306
7
+ pythonautomation_framework_utils-0.1.0.dist-info/METADATA,sha256=tquZ4_P2U_Q4N38BJS9ZGRC2ic9hHo0_HTi97WWE-gE,501
8
+ pythonautomation_framework_utils-0.1.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
9
+ pythonautomation_framework_utils-0.1.0.dist-info/top_level.txt,sha256=BXdhaaHBJTl5WDScj-NdcpdW6F1g7hNN3YP0CLPxk-0,6
10
+ pythonautomation_framework_utils-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.10.2)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) [2026] [SabarishM]
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
utils/__init__.py ADDED
@@ -0,0 +1,13 @@
1
+ from .file_utils import read_file, write_file
2
+ from .api_utils import get_json, post_json
3
+ from .wait_utils import retry
4
+ from .logger import get_logger
5
+
6
+ __all__ = [
7
+ "read_file",
8
+ "write_file",
9
+ "get_json",
10
+ "post_json",
11
+ "retry",
12
+ "get_logger",
13
+ ]
utils/api_utils.py ADDED
@@ -0,0 +1,11 @@
1
+ import requests
2
+
3
+ def get_json(url, params=None, headers=None):
4
+ response = requests.get(url, params=params, headers=headers)
5
+ response.raise_for_status()
6
+ return response.json()
7
+
8
+ def post_json(url, data, headers=None):
9
+ response = requests.post(url, json=data, headers=headers)
10
+ response.raise_for_status()
11
+ return response.json()
utils/file_utils.py ADDED
@@ -0,0 +1,10 @@
1
+ import os
2
+
3
+ def read_file(path):
4
+ with open(path, "r", encoding="utf-8") as f:
5
+ return f.read()
6
+
7
+ def write_file(path, content):
8
+ os.makedirs(os.path.dirname(path), exist_ok=True)
9
+ with open(path, "w", encoding="utf-8") as f:
10
+ f.write(content)
utils/logger.py ADDED
@@ -0,0 +1,11 @@
1
+ import logging
2
+
3
+ def get_logger(name="framework", level=logging.INFO):
4
+ logger = logging.getLogger(name)
5
+ if not logger.handlers:
6
+ handler = logging.StreamHandler()
7
+ formatter = logging.Formatter("%(asctime)s - %(levelname)s - %(message)s")
8
+ handler.setFormatter(formatter)
9
+ logger.addHandler(handler)
10
+ logger.setLevel(level)
11
+ return logger
utils/wait_utils.py ADDED
@@ -0,0 +1,11 @@
1
+ import time
2
+
3
+ def retry(func, retries=3, delay=2, exceptions=(Exception,)):
4
+ for attempt in range(retries):
5
+ try:
6
+ return func()
7
+ except exceptions as e:
8
+ if attempt < retries - 1:
9
+ time.sleep(delay)
10
+ else:
11
+ raise e