A simple Python wrapper for Gotify
pip install gotipy
from gotipy import Gotify
g = Gotify(host_address='https://yourdomain.com')
g.create_app(admin_username='admin',
admin_password='admin',
app_name='demo',
desc='My first app!')
# {
# 'id': 1,
# 'token': 'xxxxxxxxxx',
# 'name': 'demo',
# 'description': 'My first app!',
# 'internal': False,
# 'image': 'static/defaultapp.png'
# }
g.push(title='My message',
message='Hello, World!',
priority=9,
token='xxxxxxxxxx')
# {
# 'id': 1,
# 'appid': 1,
# 'message': 'Hello, World!',
# 'title': 'My message',
# 'priority': 9,
# 'date': '2022-05-16T05:25:29.367216435Z'
# }
- You can set
GOTIFY_HOST_ADDRESS
as an envionmnt variable instead of passinghost_address
to the class instance. - If you want to use the same app in all your
push
calls, you can omittoken
from the method, and passfixed_token=...
to the class instance or setGOTIFY_APP_TOKEN
as an envionmnt variable instead. - If you want to set a fixed priority level for all your
push
calls, passfixed_priority
to the class instance.