Skip to main content

build status latest Release Latest in dev

noti.py

Simple Python-based notification script to post to a matrix server via the Matrix client/server API

This is not an interactive chat bot. The use case is to have scripts send alerts to a single alert channel.

Documentation

Full documentation is available at notipy.readthedocs.io

How to install

Via PyPi

As of version 0.0.6, noti.py has been published to PyPi, so installing (should be) as easy as pip install noti_py

This will also create a notipy "entrypoint" to use as the binary to run.

Via git

  1. clone the repo
  2. install the requirements pip install -r requirements.txt
  3. cp example-config.yaml <config_dir>config.yaml
  4. Edit the config.yaml to your local needs
  5. Then just use ./noti.py --help to figure out what options you can specify

<config_dir> referenced in step 3 above will be checked in the following order or preference

  1. . (current directory)
  2. ~/.config/noti_py
  3. /etc/noti_py

If you want it in another location completely, specify the --config option to override.

How do I use this thing?

start with noti.py --help to see a list of the commands you can use. Generally you are going to need to do the following things:

  1. Create a user on your server for this script to connect as
  2. Connect to a room by either:
    1. Creating a new room noti.py create or
    2. Joining a room noti.py join if you've already invited the user from step 1 with a different user
  3. Edit the config.yaml to put in your access token and all your homeserver configuration. If you don't know your token, you can get it by running ./noti.py token

At this point you should be able to send a message with: ./noti.py send "message to send" or if you are so inclined, you can pipe stdin to the script with echo "message to send"|./noti.py send

Inspiration

I tried to use mnotify which is written in go. When I ran make, it gave a segfault upon running mnotify. Rather than try to learn go, I decided to just try to do the same thing in python.

Contribute

Feel free to fork, make updates and submit a pull request for new things or to fix some horrible python atrocity I have commited ;)

Chat

You can join me on matrix at https://matrix.to/#/#noti.py:arachnitech.com

Metadata

Release files for noti.py 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for noti.py 0.4.0
File Size Uploaded
noti.py-0.4.0.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for noti.py 0.4.0
File Interpreter ABI Platform
noti.py-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.6 kB

Release files / noti.py-0.4.0.tar.gz

Download URL noti.py-0.4.0.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1c252b9f7b7b745ce262cbcfab42094124d1301d4feb43c044cba0a5e7e6d855
BLAKE2b-256 checksum
How to use checksums
2f5a2a7a02ce727816aa7ec21332f3a0652795dea28777743ac46a1b10266a29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.10.0 Linux/5.14.16-301.fc35.x86_64

Release files / noti.py-0.4.0-py3-none-any.whl

Download URL noti.py-0.4.0-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e978a39682db9e061133327e2d783979b7162b9c95bbf7396b225cb0cfde3d4a
BLAKE2b-256 checksum
How to use checksums
2f6523e8d40625a860580076ec087fa138ae33a240ccabd089c53d697bb6c1a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.10.0 Linux/5.14.16-301.fc35.x86_64

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.1

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page