Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

A collection of various snippets that come up regularly

Project description

https://travis-ci.org/AFriemann/simple_tools.svg?branch=master

A collection of various snippets and tools that come up regularly.

decorators

timeout

>>> import time
>>> from simple_tools.decorators.time import timeout
>>> from simple_tools.exceptions import TimeoutException

>>> @timeout(3)
... def long_running_task():
...     time.sleep(5)

>>> long_running_task() # doctest: +ELLIPSIS +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
    ...
TimeoutException: execution of <function long_running_task at ...> timed out after 3s

regular expressions

>>> from simple_tools.regex import true

>>> for value in ('y', 'yE', 'tru', 'True', '1'):
...     assert true.match(value)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for simple_tools, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size simple_tools-0.0.2.tar.gz (3.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page