commons-metrics 0.0.20__tar.gz → 0.0.22__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.
- {commons_metrics-0.0.20 → commons_metrics-0.0.22}/PKG-INFO +1 -1
- {commons_metrics-0.0.20 → commons_metrics-0.0.22}/commons_metrics/__init__.py +1 -1
- {commons_metrics-0.0.20 → commons_metrics-0.0.22}/commons_metrics/cache_manager.py +2 -3
- {commons_metrics-0.0.20 → commons_metrics-0.0.22}/commons_metrics/s3_file_manager.py +4 -7
- {commons_metrics-0.0.20 → commons_metrics-0.0.22}/commons_metrics.egg-info/PKG-INFO +1 -1
- {commons_metrics-0.0.20 → commons_metrics-0.0.22}/setup.py +1 -1
- {commons_metrics-0.0.20 → commons_metrics-0.0.22}/LICENSE +0 -0
- {commons_metrics-0.0.20 → commons_metrics-0.0.22}/README.md +0 -0
- {commons_metrics-0.0.20 → commons_metrics-0.0.22}/commons_metrics/azure_devops_client.py +0 -0
- {commons_metrics-0.0.20 → commons_metrics-0.0.22}/commons_metrics/commons_repos_client.py +0 -0
- {commons_metrics-0.0.20 → commons_metrics-0.0.22}/commons_metrics/database.py +0 -0
- {commons_metrics-0.0.20 → commons_metrics-0.0.22}/commons_metrics/date_utils.py +0 -0
- {commons_metrics-0.0.20 → commons_metrics-0.0.22}/commons_metrics/github_api_client.py +0 -0
- {commons_metrics-0.0.20 → commons_metrics-0.0.22}/commons_metrics/repositories.py +0 -0
- {commons_metrics-0.0.20 → commons_metrics-0.0.22}/commons_metrics/text_simplifier.py +0 -0
- {commons_metrics-0.0.20 → commons_metrics-0.0.22}/commons_metrics/update_design_components.py +0 -0
- {commons_metrics-0.0.20 → commons_metrics-0.0.22}/commons_metrics/util.py +0 -0
- {commons_metrics-0.0.20 → commons_metrics-0.0.22}/commons_metrics/variable_finder.py +0 -0
- {commons_metrics-0.0.20 → commons_metrics-0.0.22}/commons_metrics.egg-info/SOURCES.txt +0 -0
- {commons_metrics-0.0.20 → commons_metrics-0.0.22}/commons_metrics.egg-info/dependency_links.txt +0 -0
- {commons_metrics-0.0.20 → commons_metrics-0.0.22}/commons_metrics.egg-info/requires.txt +0 -0
- {commons_metrics-0.0.20 → commons_metrics-0.0.22}/commons_metrics.egg-info/top_level.txt +0 -0
- {commons_metrics-0.0.20 → commons_metrics-0.0.22}/setup.cfg +0 -0
|
@@ -12,4 +12,4 @@ from .text_simplifier import TextSimplifier
|
|
|
12
12
|
from .variable_finder import VariableFinder
|
|
13
13
|
|
|
14
14
|
__all__ = ['Util', 'DatabaseConnection', 'ComponentRepository', 'UpdateDesignSystemComponents', 'GitHubAPIClient', 'AzureDevOpsClient', 'S3FileManager', 'CacheManager', 'CommonsReposClient', 'DateUtils', 'TextSimplifier', 'VariableFinder']
|
|
15
|
-
__version__ = '0.0.
|
|
15
|
+
__version__ = '0.0.22'
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import requests
|
|
2
2
|
import urllib3
|
|
3
|
-
|
|
4
3
|
from .s3_file_manager import S3FileManager
|
|
5
4
|
|
|
6
5
|
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
|
@@ -9,8 +8,8 @@ urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
|
|
9
8
|
class CacheManager:
|
|
10
9
|
"""Manager for caching data in S3 and making API requests"""
|
|
11
10
|
|
|
12
|
-
def __init__(self):
|
|
13
|
-
self.s3 = S3FileManager()
|
|
11
|
+
def __init__(self, bucket: str, aws_region: str):
|
|
12
|
+
self.s3 = S3FileManager(bucket=bucket, aws_region=aws_region)
|
|
14
13
|
|
|
15
14
|
def load_cache_or_fetch(self, path: str, fetch_fn, clear_cache: bool = False):
|
|
16
15
|
"""
|
|
@@ -3,18 +3,15 @@ import json
|
|
|
3
3
|
import sys
|
|
4
4
|
from typing import List
|
|
5
5
|
import boto3
|
|
6
|
-
from awsglue.utils import getResolvedOptions
|
|
7
6
|
from botocore.exceptions import ClientError
|
|
8
7
|
|
|
9
|
-
args = getResolvedOptions(sys.argv, ['bucket', 'aws_region'])
|
|
10
|
-
|
|
11
8
|
class S3FileManager:
|
|
12
|
-
def __init__(self):
|
|
13
|
-
self.bucket =
|
|
9
|
+
def __init__(self, bucket: str, aws_region: str):
|
|
10
|
+
self.bucket = bucket
|
|
14
11
|
if not self.bucket:
|
|
15
|
-
raise ValueError("
|
|
12
|
+
raise ValueError("Bucket parameter is required")
|
|
16
13
|
|
|
17
|
-
region =
|
|
14
|
+
region = aws_region
|
|
18
15
|
|
|
19
16
|
client_params = {
|
|
20
17
|
"service_name": "s3",
|
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name='commons_metrics',
|
|
5
|
-
version='0.0.
|
|
5
|
+
version='0.0.22',
|
|
6
6
|
description='A simple library for basic statistical calculations',
|
|
7
7
|
#long_description=open('USAGE.md').read(),
|
|
8
8
|
#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
|
{commons_metrics-0.0.20 → commons_metrics-0.0.22}/commons_metrics/update_design_components.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{commons_metrics-0.0.20 → commons_metrics-0.0.22}/commons_metrics.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|