Metadata-Version: 2.3
Name: downerhelper
Version: 0.0.4
Summary: Collection of functions to wrap the Azure SDK
Project-URL: Homepage, https://github.com/DownerEU/geospatialDesign-azure_helper
Author-email: Marcus Oates <marcus.oates@downergroup.com>
License: MIT
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Requires-Dist: azure-identity==1.18.0
Requires-Dist: azure-keyvault-secrets==4.8.0
Requires-Dist: psycopg2-binary==2.9.9
Description-Content-Type: text/markdown

# Downer Azure Helper

Collection of functions to wrap the Azure SDK.

## Get Secret Value

Retrieve the value of a keyvault secret.

### Example Usage

```python
from downerhelper.secret_helper import get_secret_value

value = get_secret_value(secret_name, keyvault_url)
```

## Postgres Log Handler

Simple handler to enter logs directly to postgres databases, uses psycopg2 for connection. Creates a new `table` if does not already exist, and groups logs by `job_id`.

### Example Usage

```python
from downerhelper.postgres_log_handler import PostgresLogHandler

db_config = {
    'dbname': <dbname>,
    'user': <user>,
    'password': <password>,
    'host': <host>,
}
logger_name = 'logger name'
job_id = 'test_id'
table = 'table name'

logger = PostgresLogHandler(logger_name, job_id, table, db_config)
logger.info("this is a test info message")
```