commons-metrics 0.0.30__tar.gz → 0.0.31__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.30 → commons_metrics-0.0.31}/PKG-INFO +1 -1
- {commons_metrics-0.0.30 → commons_metrics-0.0.31}/commons_metrics/__init__.py +1 -1
- commons_metrics-0.0.31/commons_metrics/connection_database.py +25 -0
- {commons_metrics-0.0.30 → commons_metrics-0.0.31}/commons_metrics.egg-info/PKG-INFO +1 -1
- {commons_metrics-0.0.30 → commons_metrics-0.0.31}/setup.py +1 -1
- commons_metrics-0.0.30/commons_metrics/connection_database.py +0 -18
- {commons_metrics-0.0.30 → commons_metrics-0.0.31}/LICENSE +0 -0
- {commons_metrics-0.0.30 → commons_metrics-0.0.31}/README.md +0 -0
- {commons_metrics-0.0.30 → commons_metrics-0.0.31}/commons_metrics/azure_devops_client.py +0 -0
- {commons_metrics-0.0.30 → commons_metrics-0.0.31}/commons_metrics/cache_manager.py +0 -0
- {commons_metrics-0.0.30 → commons_metrics-0.0.31}/commons_metrics/commons_repos_client.py +0 -0
- {commons_metrics-0.0.30 → commons_metrics-0.0.31}/commons_metrics/database.py +0 -0
- {commons_metrics-0.0.30 → commons_metrics-0.0.31}/commons_metrics/date_utils.py +0 -0
- {commons_metrics-0.0.30 → commons_metrics-0.0.31}/commons_metrics/github_api_client.py +0 -0
- {commons_metrics-0.0.30 → commons_metrics-0.0.31}/commons_metrics/repositories.py +0 -0
- {commons_metrics-0.0.30 → commons_metrics-0.0.31}/commons_metrics/s3_file_manager.py +0 -0
- {commons_metrics-0.0.30 → commons_metrics-0.0.31}/commons_metrics/text_simplifier.py +0 -0
- {commons_metrics-0.0.30 → commons_metrics-0.0.31}/commons_metrics/update_design_components.py +0 -0
- {commons_metrics-0.0.30 → commons_metrics-0.0.31}/commons_metrics/util.py +0 -0
- {commons_metrics-0.0.30 → commons_metrics-0.0.31}/commons_metrics/variable_finder.py +0 -0
- {commons_metrics-0.0.30 → commons_metrics-0.0.31}/commons_metrics.egg-info/SOURCES.txt +0 -0
- {commons_metrics-0.0.30 → commons_metrics-0.0.31}/commons_metrics.egg-info/dependency_links.txt +0 -0
- {commons_metrics-0.0.30 → commons_metrics-0.0.31}/commons_metrics.egg-info/requires.txt +0 -0
- {commons_metrics-0.0.30 → commons_metrics-0.0.31}/commons_metrics.egg-info/top_level.txt +0 -0
- {commons_metrics-0.0.30 → commons_metrics-0.0.31}/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.31'
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from lib.commons_metrics.commons_metrics import DatabaseConnection, Util, ComponentRepository
|
|
2
|
+
|
|
3
|
+
class ConnectionDatabase:
|
|
4
|
+
"""Manager for connection with database"""
|
|
5
|
+
|
|
6
|
+
def __init__(self, secret_name: str, logger: str, aws_region: str):
|
|
7
|
+
self.secret_name = secret_name
|
|
8
|
+
self.logger = logger
|
|
9
|
+
self.aws_region = aws_region
|
|
10
|
+
|
|
11
|
+
def get_connection_database_from_secret(self) -> ComponentRepository:
|
|
12
|
+
"""
|
|
13
|
+
Retrieve connection database from AWS secrets manager
|
|
14
|
+
"""
|
|
15
|
+
secret_json = Util.get_secret_aws(self.secret_name, self.logger, self.aws_region)
|
|
16
|
+
db_connection = DatabaseConnection()
|
|
17
|
+
db_connection.connect({
|
|
18
|
+
'host': secret_json["host"],
|
|
19
|
+
'port': secret_json["port"],
|
|
20
|
+
'dbname': secret_json["dbname"],
|
|
21
|
+
'username': secret_json["username"],
|
|
22
|
+
'password': secret_json["password"]
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
return ComponentRepository(db_connection)
|
|
@@ -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.31',
|
|
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',
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
from lib.commons_metrics.commons_metrics import DatabaseConnection, Util, ComponentRepository
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def get_connection_database_from_secret(secret_name: str, logger: str, aws_region: str) -> ComponentRepository:
|
|
5
|
-
"""
|
|
6
|
-
Retrieve connection database from AWS secrets manager
|
|
7
|
-
"""
|
|
8
|
-
secret_json = Util.get_secret_aws(secret_name, logger, aws_region)
|
|
9
|
-
db_connection = DatabaseConnection()
|
|
10
|
-
db_connection.connect({
|
|
11
|
-
'host': secret_json["host"],
|
|
12
|
-
'port': secret_json["port"],
|
|
13
|
-
'dbname': secret_json["dbname"],
|
|
14
|
-
'username': secret_json["username"],
|
|
15
|
-
'password': secret_json["password"]
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
return ComponentRepository(db_connection)
|
|
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
|
|
File without changes
|
|
File without changes
|
{commons_metrics-0.0.30 → commons_metrics-0.0.31}/commons_metrics/update_design_components.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{commons_metrics-0.0.30 → commons_metrics-0.0.31}/commons_metrics.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|