Skip to main content

Helpers for common functional work done across several projects

Project description

pylib-helpers

Helpers for logging, sleeping, and other common functional work done across projects

Release GitHub release (latest SemVer including pre-releases) PyPI

Build

Total alerts Language grade: Python

Conventional Commits

RetryHandler

Samples can be found here in the tests

Example usage:

from somelib import ClientError
from helpers import Logger, RetryHandler, Sleeper

LOGGER = Logger()
SLEEPER = Sleeper()

def _client_error(err_obj):
    err_msg = str(err_obj)
    if "Recoverable" not in err_msg:
        raise err_obj
    else:
        LOGGER.print_error(err_msg)
        SLEEPER.normal_sleep()

@RetryHandler(
    (ClientError),
    max_retries=10,
    wait_time=0,
    err_callbacks={"ClientError": (_client_error, {})},
).wrap
def do_the_thing(data):
    pass

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

pylib-helpers-0.3.89.tar.gz (16.8 kB view hashes)

Uploaded Source

Built Distribution

pylib_helpers-0.3.89-py3-none-any.whl (16.1 kB view hashes)

Uploaded Python 3

Supported by

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