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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: ntfy_api-0.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 ce8811257f28aee52d8e5571cc77ff768331a1f4cc76b209de2a2d9d4622ff08
MD5 798fca79e655be4468de8e171e3ecbf5
BLAKE2b-256 0aa6b670b7cf41c100a0bf8b5646f2476538bfec93e4ab35106e29687b5653a2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ntfy_api-0.0.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d3653898445104534cbfd5a8cdd3521f10aa8756378ce358f220b5b3f3bccfdf
MD5 e5c3d9270ad0d38e72dda19c1b59c6a2
BLAKE2b-256 859f9a7e7b9417f0b7c1fd610e79cf524dcb077aeb6d5b470bbe88c9eac972ea

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