Skip to main content

No project description provided

Project description

Run tests PyPI version

PyNom

A simple library to eat exceptions, until enough of a given exception type has been raised. The name has the word 'Nom' in it because it can sometimes sound like a person eating.

Installation

pip install pynom

Simple Usage Example

from pynom import PyNom
pn = PyNom([ValueError], 5)
while True:
    # This block will raise after 5 (so on the 6th) ValueErrors.
    #  It will raise an Exception containing tracebacks, exceptions, approx timestamps for each ValueError
    # If a non-ValueError is raised, it will be immediately raised (and not eaten)
    with pn:
        do_something()

Advanced Usage Example

from pynom import PyNom
pn = PyNom([ValueError], 5, throw_up_action=lambda ex: print(ex))
while True:
    # On the 6th value error will call the given throw_up_action
    #  a CombinedException will be passed to the throw_up_action.
    with pn:
        do_something()

See https://csm10495.github.io/pynom/ for full API documentation.

License

MIT License

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

pynom-0.0.11.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pynom-0.0.11-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file pynom-0.0.11.tar.gz.

File metadata

  • Download URL: pynom-0.0.11.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for pynom-0.0.11.tar.gz
Algorithm Hash digest
SHA256 fac0abb5f3979a44ef22227930b97a101c42a608ce50837c646b13349aecb321
MD5 ed8f615ed875fa9d5e956cb5bd4f614e
BLAKE2b-256 f3537fd27eaaed2b18334718256794b22747d40eb1ee0d245131bce9905ced8e

See more details on using hashes here.

File details

Details for the file pynom-0.0.11-py3-none-any.whl.

File metadata

  • Download URL: pynom-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for pynom-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 6e2aa59aff6649d2ef8a3fb025857f919897668ee1c6d2da4190b765a2c81d3f
MD5 96d47bb9ed7bd1cbb33377a5c236e881
BLAKE2b-256 081241f1351f4f1813a520195a2662864ce90f2bff66f2d53c2505fd165afbb3

See more details on using hashes here.

Supported by

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