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.1.tar.gz
(28.0 kB
view details)
Built Distribution
ntfy_api-0.0.1-py3-none-any.whl
(28.0 kB
view details)
File details
Details for the file ntfy_api-0.0.1.tar.gz
.
File metadata
- Download URL: ntfy_api-0.0.1.tar.gz
- Upload date:
- Size: 28.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ec120f98b9005bbc783d85a45a999c304919ff04376efe46a1683724fae6f61 |
|
MD5 | abac65c1dc8dec3c428e9f17d6ba05f6 |
|
BLAKE2b-256 | 0b1f71a95683bff45e7bfc380261dff56e430b904cd33a24898518adccc5e36e |
File details
Details for the file ntfy_api-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: ntfy_api-0.0.1-py3-none-any.whl
- Upload date:
- Size: 28.0 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 | 6e1c9662bc00e9c8be71a5b24792d8f12c7948ed0fcb4d4a764e77a13cf32829 |
|
MD5 | 2a76c0cf9aa5d3493c6bc148e82bc34b |
|
BLAKE2b-256 | 873debd8638ea7f99a9e6600f99736fda30aaa9948c73592207bcefce6aa1788 |