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.0.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

safely-0.2.0-py3-none-any.whl (3.6 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