commons-metrics 0.0.30__py3-none-any.whl → 0.0.31__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.
@@ -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.30'
15
+ __version__ = '0.0.31'
@@ -1,18 +1,25 @@
1
1
  from lib.commons_metrics.commons_metrics import DatabaseConnection, Util, ComponentRepository
2
2
 
3
+ class ConnectionDatabase:
4
+ """Manager for connection with database"""
3
5
 
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
- })
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
17
10
 
18
- return ComponentRepository(db_connection)
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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: commons_metrics
3
- Version: 0.0.30
3
+ Version: 0.0.31
4
4
  Summary: A simple library for basic statistical calculations
5
5
  Author: Bancolombia
6
6
  Author-email: omar.david.pino@email.com
@@ -1,8 +1,8 @@
1
- commons_metrics/__init__.py,sha256=UQXQ22ORuDUbCXlDKo6QOfnEmnilYTdgKQY-O4IxH40,796
1
+ commons_metrics/__init__.py,sha256=Uu9NTPf8GhZ7_WmdIABwL4tuGUB301KGKZZ8Q8OItoc,796
2
2
  commons_metrics/azure_devops_client.py,sha256=XrGqhr4voFUtGkdB27tnzsMSiNdpfY4stQUU51e1a0U,16755
3
3
  commons_metrics/cache_manager.py,sha256=HOeup9twUizjJAbh1MNXdPT8BMVeLFoolOWlAzMTXkE,2651
4
4
  commons_metrics/commons_repos_client.py,sha256=PiAMLWuDnI8AlZzE3sfQ3s2P23UrYbbqaq63AFRroHc,4695
5
- commons_metrics/connection_database.py,sha256=JvmEuhnnaE3MyQJfN4nXZzVuXB-hfWUAbJq4DEKVtO8,680
5
+ commons_metrics/connection_database.py,sha256=5wkFshg3BJQ9c1tBBn2n_teqf-fZo3lT78p6KrIZaTQ,960
6
6
  commons_metrics/database.py,sha256=pFJAnkiPpEENDXJ6zqcGXO0CKpruxBt_8zokp4JLB-0,2995
7
7
  commons_metrics/date_utils.py,sha256=8465712QJDGcshqry97Gi90lbMEbvbX3uiuHRVwGHbE,2654
8
8
  commons_metrics/github_api_client.py,sha256=RMM-NyvTOGWv3jS__SFxWBzZX9_IjtbqgA-mr41D51o,18850
@@ -12,8 +12,8 @@ commons_metrics/text_simplifier.py,sha256=jRYckQ5APR0A3wY4hg70kOHxHUFuGzd6D-CJC3
12
12
  commons_metrics/update_design_components.py,sha256=QpY0GCCCMjdYOZ7b8oNigU9iTpiGx91CYsyWwN8WVDA,7660
13
13
  commons_metrics/util.py,sha256=RYpC0O9SRWFcLoAIFQp4PvpgCAiaKU0-ouY3c70oDMw,840
14
14
  commons_metrics/variable_finder.py,sha256=pxI_XSd-lq_AiUjDbcUC4knIZhWZwt7HQrQOa-F0ud4,8061
15
- commons_metrics-0.0.30.dist-info/licenses/LICENSE,sha256=jsHZ2Sh1wCL74HC25pDDGXCyQ0xgsTAy62FvEnehKIg,1067
16
- commons_metrics-0.0.30.dist-info/METADATA,sha256=uOX8wZZW1NN8LBZ5K7OH2CXYrfhTS5bUaGqjmfQuLbI,402
17
- commons_metrics-0.0.30.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
18
- commons_metrics-0.0.30.dist-info/top_level.txt,sha256=lheUN-3OKdU3A8Tg8Y-1IEB_9i_vVRA0g_FOiUsTQz8,16
19
- commons_metrics-0.0.30.dist-info/RECORD,,
15
+ commons_metrics-0.0.31.dist-info/licenses/LICENSE,sha256=jsHZ2Sh1wCL74HC25pDDGXCyQ0xgsTAy62FvEnehKIg,1067
16
+ commons_metrics-0.0.31.dist-info/METADATA,sha256=DgA6cUQUg8wFLC3lnENoaTjfILkQedTW38NE3WUliwI,402
17
+ commons_metrics-0.0.31.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
18
+ commons_metrics-0.0.31.dist-info/top_level.txt,sha256=lheUN-3OKdU3A8Tg8Y-1IEB_9i_vVRA0g_FOiUsTQz8,16
19
+ commons_metrics-0.0.31.dist-info/RECORD,,