Skip to main content

Capture side effects, safely.

Project description

Safely

Capture side effects, safely ⚔️

Continuous Integration Package Version Supported Python Versions

Installation

pip install safely

Usage

As a function (without second-order arguments):

def f(...): ...

result = safely(f)(...)

As a function (with second-order arguments):

def f(...): ...

result = safely(f, logger=logger.error, message="{exc_type}: {exc_value}")(...)

As a decorator (without second-order arguments):

@safely
def f(...): ...

result = f(...)

As a decorator (with second-order arguments):

@safely(logger=logger.error, message="{exc_type}: {exc_value}")
def f(...): ...

result = f(...)

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

safely-0.2.1.tar.gz (3.6 kB view hashes)

Uploaded source

Built Distribution

safely-0.2.1-py3-none-any.whl (3.8 kB view hashes)

Uploaded py3

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