Skip to main content

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.3.tar.gz (28.1 kB view details)

Uploaded Source

Built Distribution

ntfy_api-0.0.3-py3-none-any.whl (28.1 kB view details)

Uploaded Python 3

File details

Details for the file ntfy_api-0.0.3.tar.gz.

File metadata

  • Download URL: ntfy_api-0.0.3.tar.gz
  • Upload date:
  • Size: 28.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for ntfy_api-0.0.3.tar.gz
Algorithm Hash digest
SHA256 77872a70a74a1453b39baff526fdaa66116ea62ead83f676eced3f2b946b42f1
MD5 3986e2bada180af6463c70cc47fa5c9c
BLAKE2b-256 80b49a94099d7f923416fa9c4f686f5e57cd67703217d37e6f41588a9d43a585

See more details on using hashes here.

File details

Details for the file ntfy_api-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: ntfy_api-0.0.3-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

Hashes for ntfy_api-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f20eccbac212b30e3f98072e1ab3f95890bc0fbbb12dedec79682d703eef2353
MD5 bdce9fddec80735e209aaa288f6101cb
BLAKE2b-256 9bad29476ffa148faca123e723e91327666386082a476546f8106a44f2fd33cc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page