A simple Python wrapper for Gotify
Project description
Gotipy
A simple Python wrapper for Gotify
Requirements
Installation
pip install gotipy
Usage
from gotipy import Gotify
g = Gotify(host_address='https://yourdomain.com')
Create a new application
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'
# }
Push messages to an application
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'
# }
Notes:
- 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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gotipy-0.2.2.tar.gz
(3.7 kB
view details)
Built Distribution
File details
Details for the file gotipy-0.2.2.tar.gz
.
File metadata
- Download URL: gotipy-0.2.2.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.14 CPython/3.10.5 Darwin/21.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4bdf4db0892689044d82fa5136d0af58ead469c1ec4dd6eb75a65df247d35d3 |
|
MD5 | 3d99620ebb25c0692b8233e8360f5d9e |
|
BLAKE2b-256 | 4198c0f980963fad84ebfb36cbfd8fdb97205359f7be459fdc16e4c8ac2cca9b |
File details
Details for the file gotipy-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: gotipy-0.2.2-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.14 CPython/3.10.5 Darwin/21.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d482ca52300dcf4a55c87c85f4ff8a4eb037ab47a581ad3f731132d1ba3ab93f |
|
MD5 | 6bf29320b6b16b40255027190f7eb79b |
|
BLAKE2b-256 | cd1da032115f42e54c12bb76a81425b79ef7ae3cda2f4b95b5974776312f5457 |