A Python wrapper around the ntfy API.
Project description
A Python wrapper around the ntfy API.
Install
$ pip install ntfy-api
Usage
This package is in its early stages, and currently only supports sending messages:
from ntfy_api import *
# create NtfyPublisher instance
ntfy_pub = NtfyPublisher("https://ntfy.example.com", basic=..., bearer=...)
# create message
msg = Message(
topic="my-topic",
message="**Hello World**",
title="Super Cool Message",
priority=Priority.urgent, # or just `5`
tags=[Tag._100], # or just `["100"]`
markdown=True,
delay="10m",
actions=[
ViewAction(label="GOOGLE", url="https://google.com"),
BroadcastAction(
label="Take picture",
extras={"cmd": "pic", "camera": "front"}
)
],
click="https://youtube.com",
attach="https://docs.ntfy.sh/static/img/ntfy.png",
filename="ntfy.png",
icon="https://ntfy.sh/_next/static/media/logo.077f6a13.svg"
)
# send message
ntfy_pub.publish(msg)
# OR
ntfy_pub << msg
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
ntfy_api-0.0.6.tar.gz
(28.2 kB
view details)
Built Distribution
ntfy_api-0.0.6-py3-none-any.whl
(28.1 kB
view details)
File details
Details for the file ntfy_api-0.0.6.tar.gz
.
File metadata
- Download URL: ntfy_api-0.0.6.tar.gz
- Upload date:
- Size: 28.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f712b4e9ac93abf19861cd28c8ca06f21017c54749e184d1d5e4554304bf5f78 |
|
MD5 | 28d850ab816c49578108415348802c2e |
|
BLAKE2b-256 | e758bb3fc9c32fc2eadb8bbe0fc0e84d11094141d09dbeaf5c55e4195ef381ac |
File details
Details for the file ntfy_api-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: ntfy_api-0.0.6-py3-none-any.whl
- Upload date:
- Size: 28.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1d207a98c3e6bb8d7db6ccc78f3930840f6533c090d544351dccd61c08bf5c8 |
|
MD5 | 01d950b0f2882260d8d358c8c9b6363d |
|
BLAKE2b-256 | b167c523ed7a8229f1967894312df3c8e435763f9e768e7ca4ccdac489d1ebb9 |