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

Uploaded Source

Built Distribution

ntfy_api-0.0.2-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

Hashes for ntfy_api-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f88c2e239baab6a1707d6fa3f9fe61e52b9121cd9d6413bd6d67407ad4be8af2
MD5 07c274b757572b6e662d74e65d2c04de
BLAKE2b-256 f3d10ba1d2d6240e10a7b5ebfa3770f131875f6c44af597def1ad38fe9489095

See more details on using hashes here.

File details

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

File metadata

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

Hashes for ntfy_api-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 242f31bbb1d2925526349b8dad28938e4f43a676c3ea44d32b9a5e5f814951a6
MD5 76f719d309adf770d1a1e075aa11379a
BLAKE2b-256 ed54890166d2ce6f184a1a4b291594ac9daeedb66d850a8dc5c8fc2f1a2a1cd2

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