An open API service indexing awesome lists of open source software.

https://github.com/tikerlade/exec-notifier

Tool to notify you when execution of command will be ended. :computer: :arrow_right: :iphone:
https://github.com/tikerlade/exec-notifier

bash notifications pypi python telegram-bot terminal

Last synced: 11 months ago
JSON representation

Tool to notify you when execution of command will be ended. :computer: :arrow_right: :iphone:

Awesome Lists containing this project

README

          

Execution Notifier :speech_balloon:

[![PyPI](https://img.shields.io/pypi/v/exec-notifier)](https://pypi.org/project/exec-notifier/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Actions Status](https://github.com/tikerlade/exec-notifier/workflows/Deploy%20Bot/badge.svg)](https://github.com/tikerlade/exec-notifier/actions/)
[![Actions Status](https://github.com/tikerlade/exec-notifier/workflows/Release%20to%20PyPI/badge.svg)](https://github.com/tikerlade/exec-notifier/actions/)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/tikerlade/exec-notifier/master.svg)](https://results.pre-commit.ci/latest/github/tikerlade/exec-notifier/master)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/exec-notifier)

This tool provides you ability to send yourself information about looong executed command when it is done. Information will be sent using Telegram Bot. Logs and error messages (if they'll occur) will be delivered too.

**_CLI execution notification_**

![Notification example](img/bot_report_cli.png)

**_Notebook execution notification_**

![Notification example](img/bot_report_nbextension.png)

:warning: If your log will be too long (longer 1_000_000 signs we'll not send it).

## Prerequisites :bookmark_tabs:

1. Python 3.4 or higher
2. Telegram ID - get it from [@exec_notifier_bot](https://telegram.me/exec_notifier_bot) by using `/start` command.

## CLI Installation and running
You need to run your commands in quotes(`""`) when passing script to run.

```shell
>>> pip install exec-notifier
>>> exec_notifier config --telegram_id=YOUR_TELEGRAM_ID
>>> exec_notifier notify "[your_command_here]"
```

## Jupyter extension installation

If you didn't have any nbextensions yet you need to download them by the following [instrucions](https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/install.html).

Run the code from `install_nbextenstion.sh` locally. You can do this by the following command:

```shell
curl -LJO https://raw.githubusercontent.com/tikerlade/exec-notifier/master/install_nbextension.sh
chmod +x install_nbextension.sh
./install_nbextension.sh
rm -rf install_nbextension.sh
```

After this command go to your [Jupyter nbextensions setup page](http://localhost:8888/tree?#nbextensions_configurator): provide your Telegram ID and activate `exec_notifier`.

## Examples

[comment]: <> ()

```shell
>>> exec_notifier notify "ls -l | head"
>>> exec_notifier notify "ls -l > output.txt"
>>> exec_notifier notify "ls -l && sleep 3 && ps"
>>> exec_notifier notify "zip Downloads"
```

## Future :soon:
* Your own bot support will be added