Name | downerhelper JSON |
Version |
0.0.8
JSON |
| download |
home_page | None |
Summary | Collection of functions to wrap the Azure SDK |
upload_time | 2024-10-08 23:34:59 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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.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
```python
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
```python
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.
```python
import downerhelper
value = downerhelper.secrets.get_secret_value(secret_name, keyvault_url)
```
Raw data
{
"_id": null,
"home_page": null,
"name": "downerhelper",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Marcus Oates <marcus.oates@downergroup.com>",
"download_url": "https://files.pythonhosted.org/packages/2c/3c/1f76d3fadf02786759225a33aeca45feb60ac1d014dfe49cf2a73fc2f096/downerhelper-0.0.8.tar.gz",
"platform": null,
"description": "# Downer Azure Helper\n\nCollection of functions to wrap the Azure SDK.\n\n## Get Secret Value\n\nRetrieve the value of a keyvault secret.\n\n### Example Usage\n\n```python\nfrom downerhelper.secrets import get_secret_value\n\nvalue = get_secret_value(secret_name, keyvault_url)\n```\n\n## Postgres Log Handler\n\nSimple 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`.\n\n### Quick Setup\n\nStore database config in Azure Key Vault with format `<dbname>,<user>,<password>,<host>`.\n\n#### Example Usage\n\n```python\nfrom downerhelper.logs import setup_handler\n\nlogger, job_id = setup_handler(secret_name: str, keyvault_url: str, logger_name: str, table: str, job_id=None: str)\nlogger.info(\"this is a test info message\")\n```\n\n### Manual Setup\n\nProvide database config dictionary.\n\n#### Example Usage\n\n\n```python\nfrom downerhelper.logs import PostgresLogHandler\n\ndb_config = {\n 'dbname': <dbname>,\n 'user': <user>,\n 'password': <password>,\n 'host': <host>,\n}\n\nlogger = PostgresLogHandler(logger_name: str, job_id: str, table: str, db_config: dict(str, str))\nlogger.info(\"this is a test info message\")\n```\n\n## Warning\n\nThe following snippet shows incorrect usage. Modules must be declared and imported seperately.\n\n```python\nimport downerhelper\n\nvalue = downerhelper.secrets.get_secret_value(secret_name, keyvault_url)\n```",
"bugtrack_url": null,
"license": "MIT",
"summary": "Collection of functions to wrap the Azure SDK",
"version": "0.0.8",
"project_urls": {
"Homepage": "https://github.com/DownerEU/geospatialDesign-azure_helper"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6c2cab881fad40acd5435e4e27f50833e9d9073eefafbd3a34a95f7e59ddda59",
"md5": "31d057cbd23d6c25e202f035108511e9",
"sha256": "cc6f871184cba675b3f8ee2446b69529bb2e362354e61d443cf3a3d6528ce5e0"
},
"downloads": -1,
"filename": "downerhelper-0.0.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "31d057cbd23d6c25e202f035108511e9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 6019,
"upload_time": "2024-10-08T23:34:58",
"upload_time_iso_8601": "2024-10-08T23:34:58.125128Z",
"url": "https://files.pythonhosted.org/packages/6c/2c/ab881fad40acd5435e4e27f50833e9d9073eefafbd3a34a95f7e59ddda59/downerhelper-0.0.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2c3c1f76d3fadf02786759225a33aeca45feb60ac1d014dfe49cf2a73fc2f096",
"md5": "e3f7128366012f7ceb41e7770ffdabf9",
"sha256": "ab61e11a52537588a1c4058f9d83b7970543e63a82b442efdf28d186248c0b5c"
},
"downloads": -1,
"filename": "downerhelper-0.0.8.tar.gz",
"has_sig": false,
"md5_digest": "e3f7128366012f7ceb41e7770ffdabf9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 5270,
"upload_time": "2024-10-08T23:34:59",
"upload_time_iso_8601": "2024-10-08T23:34:59.203650Z",
"url": "https://files.pythonhosted.org/packages/2c/3c/1f76d3fadf02786759225a33aeca45feb60ac1d014dfe49cf2a73fc2f096/downerhelper-0.0.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-08 23:34:59",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "DownerEU",
"github_project": "geospatialDesign-azure_helper",
"github_not_found": true,
"lcname": "downerhelper"
}