Collection of functions to wrap the Azure SDK
Project description
Downer Azure Helper
Collection of functions to wrap the Azure SDK.
Get Secret Value
Retrieve the value of a keyvault secret.
Example Usage
from downerhelper.secrets 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.
Quick Setup
Store database config in Azure Key Vault with format <dbname>,<user>,<password>,<host>.
Example Usage
from downerhelper.logs import setup_handler
logger, job_id = setup_handler(secret_name: str, keyvault_url: str, logger_name: str, table: str, job_id=None: str)
logger.info("this is a test info message")
Manual Setup
Provide database config dictionary.
Example Usage
from downerhelper.logs import PostgresLogHandler
db_config = {
'dbname': <dbname>,
'user': <user>,
'password': <password>,
'host': <host>,
}
logger = PostgresLogHandler(logger_name: str, job_id: str, table: str, db_config: dict(str, str))
logger.info("this is a test info message")
Warning
The following snippet shows incorrect usage. Modules must be declared and imported seperately.
import downerhelper
value = downerhelper.secrets.get_secret_value(secret_name, keyvault_url)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file downerhelper-0.0.18.tar.gz.
File metadata
- Download URL: downerhelper-0.0.18.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69e7799f78d4f9ab8f011fa6d861b47d4a1621d928523a20a653d7e7badf3e7e
|
|
| MD5 |
aa56aff9f8d5461f9abe0fddd327a903
|
|
| BLAKE2b-256 |
01d7f967cbc6f57b6cbbc1c90124ea46b192f1317f31a7b8961bee4be3ba6a68
|
File details
Details for the file downerhelper-0.0.18-py3-none-any.whl.
File metadata
- Download URL: downerhelper-0.0.18-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3043c6d4d227725299d47fd6d117a3bedc5f3b3a59166e4734c93c736def845c
|
|
| MD5 |
d556fca367e5a37d59aafc9bfecd083b
|
|
| BLAKE2b-256 |
886df12b842cef64190a2cac641960e934f0b95b5965da1f899a195a8a295909
|