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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: ntfy_api-0.0.5.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.5.tar.gz
Algorithm Hash digest
SHA256 8a8f84195abb5ef636d276c213cbdd7e2ba5777f70f408c0bfe738d7e83739d6
MD5 205873662d272f6f5639d05b11ad83c2
BLAKE2b-256 f5182114aae58fa212af8f8a355233d5a97dfe374a3e2d29424e6d2f96dc1f1d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ntfy_api-0.0.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 872be3fbfc2977bb72279bcd5596728d7aa753af23490cf99ce953398f6b257f
MD5 79b84616cb527c8ecaf513734b85eb4a
BLAKE2b-256 716032dec688465a3dba0435a09efe60ddf359a574b20459cd8f055c7de9aea8

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