cfl_data_utils.services package

pylint: disable=missing-docstring

Submodules

cfl_data_utils.services.services module

The purpose of this module is to provide functionality for interacting with services outside of this package.

These services should not be related to the core data management aspect of the package, and should instead be used as extra functionality

cfl_data_utils.services.services.log(db_creds=None, db_obj=None, script=None, description=None, text_content=None, json_content: dict = None, numeric_content=None, boolean_content=None, tables_affected=None, num_rows_affected=None)[source]

Logging utility to keep track of automated scripts

Parameters:
  • db_creds (dict) – Credentials for connecting to the logging table
  • db_obj (object) – A pre-instantiated database object
  • script (str) – The script calling the log function
  • description (str) – A short description of the log
  • text_content (str) – Any useful/contextual text content
  • json_content (dict) – Any useful/contextual JSON content
  • numeric_content (Union[int, float]) – Any useful/contextual numeric content
  • boolean_content (bool) – Any useful/contextual boolean content
  • tables_affected (list) – A list of tables affected by the action
  • num_rows_affected (int) – Number of rows affected by the action
Raises:
  • ValueError – if there’s no way of connecting to the database
  • ValueError – if there’s no content to log
cfl_data_utils.services.services.slack(webhook_url, m)[source]

Send a Slack message to a Slackbot

Parameters:
  • webhook_url (str) – Webhook of Slackbot
  • m (str) – The message
cfl_data_utils.services.services.stub(*args, **kwargs)[source]

Empty function

Parameters:
  • *args – Takes all non-default args
  • **kwargs – Takes all default args