:py:mod:`GeoHealthCheck.util` ============================= .. py:module:: GeoHealthCheck.util Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: GeoHealthCheck.util.average GeoHealthCheck.util.format_checked_datetime GeoHealthCheck.util.format_run_status GeoHealthCheck.util.format_obj_value GeoHealthCheck.util.create_hash GeoHealthCheck.util.verify_hash GeoHealthCheck.util.percentage GeoHealthCheck.util.get_python_snippet GeoHealthCheck.util.render_template2 GeoHealthCheck.util.send_email GeoHealthCheck.util.geocode GeoHealthCheck.util.transform_bbox GeoHealthCheck.util.read GeoHealthCheck.util.encode GeoHealthCheck.util.decode GeoHealthCheck.util.create_requests_retry_session GeoHealthCheck.util.expand_url Attributes ~~~~~~~~~~ .. autoapisummary:: GeoHealthCheck.util.APP GeoHealthCheck.util.CONFIG GeoHealthCheck.util.LOGGER .. py:data:: APP .. py:data:: CONFIG .. py:data:: LOGGER .. py:function:: average(values) calculates average from a list .. py:function:: format_checked_datetime(run, default='-') common formatting datetime fields .. py:function:: format_run_status(run, default='-') common formatting success boolean field .. py:function:: format_obj_value(obj, default='-') common formatting object field .. py:function:: create_hash(string) .. py:function:: verify_hash(hash1, hash2) .. py:function:: percentage(number, total) calculates a percentage .. py:function:: get_python_snippet(resource) return sample interactive session .. py:function:: render_template2(template, template_vars) convenience function to render template in a non-Flask context .. py:function:: send_email(mail_config, fromaddr, toaddr, msg) convenience function to send an email .. py:function:: geocode(value, spatial_keyword_type='hostname') convenience function to geocode a value .. py:function:: transform_bbox(epsg1, epsg2, bbox) convenience function to transform a bbox array .. py:function:: read(filename, encoding='utf-8') read file contents .. py:function:: encode(key, string) .. py:function:: decode(key: str, string: str) -> str .. py:function:: create_requests_retry_session(retries=3, backoff_factor=0.3, status_forcelist=(500, 502, 504), session=None) .. py:function:: expand_url(url, query_clause)