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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file safely-0.2.1.tar.gz.

File metadata

  • Download URL: safely-0.2.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.9.13 Linux/5.15.0-1019-azure

File hashes

Hashes for safely-0.2.1.tar.gz
Algorithm Hash digest
SHA256 9c65b5e6eaf9419cf7b54d7f7ea699e6e09d3b57eb2fde05fa8047a848c44bca
MD5 386db5924bd2affa502dcdf95cfed2e6
BLAKE2b-256 69f043ae67b1fba1de87d4e695982980e1a351c3d92d4c013b5a8b338423a847

See more details on using hashes here.

File details

Details for the file safely-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: safely-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.9.13 Linux/5.15.0-1019-azure

File hashes

Hashes for safely-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9e26f4c8143ee6214add737ac26f032ef1ef1dc6f5e079fa363c293824d156ac
MD5 592f7aa8dc6be99bbdabbe61466a3844
BLAKE2b-256 c733cc40464b16aa2afe7265dc72dcb6cf554b4e17899b01d948956a6df74201

See more details on using hashes here.

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