Get notified when your functions run
Sometimes, functions take a long time. I wanted to create something that automatically notifies you when they're completed without risking exposing your phone number.
$ pip install FuncNotify
# Add more as projects grow!
from FuncNotify import time_func, time_text, time_slack
@time_func(NotifyMethod="Text", use_env=True, env_path".env", update_env=True, cellphone="8001234567")
def wait_func():
"""This function will use the text method and pull env varaibles from
`.env`, it will update the already determined env variables too!"""
do_something()
@time_text()
def wait_func2():
"""All parameters are optional and each method has a personal decorator, even the
function call is optional see below"""
do_something()
@time_text
def wait_func3():
"""Auto pull from `.env` is enabled by default with Method specific time decorators"""
do_something()
if __name__ == "__main__":
"""You don't even need to use the timer as a decorator, use it as a normal function
This is how we do testing :) """
time_func(function=wait_func4)(*func4_args, **func4_kwargs)
Click above for instructions on how to contribute
Platform |
---|
Console Print |
Text |
Slack |
Microsoft Teams |
Project TODOs
Admin stuff/documentation
- Complete ReadMe
- Remove my environment variables
- Document environment variables
- Write some tests
Code stuff
- Add support for texts
- Add support for slack
- Add Default notify
- Add ENV variable support
- Use user email to search for slackID
- Add generic decorator support
- Add arguments to decorator support so you can specify keyword arguments like "(email={email}, token={token})"
- Add .env support
- Write Tests
- Add logger support
- Dropped support for 2.7, too annoying to mantain as metaclass was different
- Made super easy to add to (automated imports, define the decorator at the same time).
- Separate tests
- GitHub action auto deployment
- Add email
- Add whatsapp
- Add wechat
- Add Microsoft teams
- Add Some other