Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

downerhelper-0.0.21.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

downerhelper-0.0.21-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file downerhelper-0.0.21.tar.gz.

File metadata

  • Download URL: downerhelper-0.0.21.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for downerhelper-0.0.21.tar.gz
Algorithm Hash digest
SHA256 00a80fd9ad716b19c804c49bad0f55e9fc190d433ffa9bd3fd8dffb31be3d755
MD5 f89e4809a64522b57264aa0e6546d551
BLAKE2b-256 f3e0234c6e6e5e680b6f2fc02855a7f9afa8618c8fc9cb8c7a2245e27c2fe748

See more details on using hashes here.

File details

Details for the file downerhelper-0.0.21-py3-none-any.whl.

File metadata

  • Download URL: downerhelper-0.0.21-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for downerhelper-0.0.21-py3-none-any.whl
Algorithm Hash digest
SHA256 a52bdb3587f6f05e9c76c6d8b0c0c81d24c9f22911867123be6dd24bc61f233d
MD5 eb1e4d4125fccd39e3751d335beeb3cb
BLAKE2b-256 d74cb26a69240ff3f9a0458bd160800d50930801952bec5ab3a125b6ddd737f4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page