Skip to main content

Python client for Notifire (https://notifire.dvdblk.com)

Project description

Notifire - Python client for Notifire

Build Status PyPi page link -- version

Notifire-Python is Python client used for sending Apple push notifications from your code to your iOS device with the Notifire application. Notification is sent as a HTTP request to the Notifire server through various implemented transports.

Usage

Notifire has an account management system. This allows you to preserve your data across various iOS devices. You can either create Notifire account or use 3rd party accounts (e.g. Google).
Create a service in the Notifire iOS application. Then you obtain service api key that you can either pass directly to the client class or through the environment variable NOTIFIRE_SERVICE_API_KEY.

Install notifire with pip:

pip install notifire

Create and configure a client:

from notifire import Client

client = Client('service_api_key')
client.send_notification('Hello from Python')

Notification

The notification consists of

  • body (required) - title of the iOS notification pop-up
  • level - one of info/error/warning to filter the notification
  • text - additional text of the notification shown in notification tab
  • url - url displayed in the notification

These parameters are accepted by send_notification method. Notifications are aggregated under a service which you create in the Notifire iOS application.
Service is a representation of your code/script/application from which you send these notifications.

Transports

A transport is the mechanism through which Notifire sends the HTTP request to the Notifire server. There are 6 types of transports implemented:

  • AioHTTPTransport - sends concurrent message via aiohttp library, should be used in asyncio based environments
  • GeventedHTTPTransport - sends non-blocking message via gevent library, should be used in gevent based environments
  • HTTPTransport - synchronous blocking transport, can be used in any environment
  • RequestsHTTPTransport - synchronous blocking transport using requests library, can be used in any environment
  • ThreadedHTTPTransport (Default) - spawns a thread (async worker) that is processing messages
  • ThreadedRequestsHTTPTransport - spawns a thread (async worker) that is using requests library for processing messages

To use aiohhtp/gevent/requests transport, install it's appropriate library:

pip install aiohttp
pip install gevent
pip install requests

To use your desired transport, simply import and pass it to the Client class.

from notifire import Client
from notifire.transport import ThreadedHTTPTransport

client = Client('service_api_key', transport=ThreadedHTTPTransport)

Integrations

You can use Notifire with the legacy Sentry python client Raven. This will allow you to receive errors to Notifire as well as to Sentry.

Install notifire and raven from pip:

pip install notifire[raven]

Create and configure a client which serves as both Notifire and Sentry client:

from notifire.integrations.raven import Client

client = Client(service_api_key='service_api_key',
                sentry_dsn='__DSN__')

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

notifire-0.1.2.tar.gz (21.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

notifire-0.1.2-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file notifire-0.1.2.tar.gz.

File metadata

  • Download URL: notifire-0.1.2.tar.gz
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0.post20201221 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.6.0

File hashes

Hashes for notifire-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ad7e5b3ad46ec62f65d6a02438dde193fc4b37d1ad8afeaf1cd319b2f089f0fe
MD5 03053121a26f63474ee6f9f793fed969
BLAKE2b-256 fd868f2eefc2553ffc691ee135b928472568a76ecec44c594d04ff70248c0508

See more details on using hashes here.

File details

Details for the file notifire-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: notifire-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 20.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0.post20201221 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.6.0

File hashes

Hashes for notifire-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 595c554142fc98227e18f48e231d67a03bedaeffaa33e444a782f88cc5c3a401
MD5 005724d9ad7437b0633ea505e0ad2323
BLAKE2b-256 acd1b80d099c0a5e849b370301ccce925a9bf4ef6d0a4b5cdba1e180f7ddd674

See more details on using hashes here.

Supported by

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