Skip to main content

Python package for using the Airship API

Project description

https://github.com/urbanairship/python-library/actions/workflows/ci.yaml/badge.svg

urbanairship is a Python library for using the Airship REST API for push notifications, message center messages, email, and SMS.

Requirements

Python 2.7, 3.6, 3.7, 3.8, or 3.9 is required. Other requirements can be found in requirements.txt.

Questions

The best place to ask questions or report a problem is our support site: http://support.airship.com/

Usage

See the full documentation for this library, as well as the Airship API Documentation.

Simple iOS Push

>>> import urbanairship as ua
>>> airship = ua.Airship('application_key', 'master_secret')
>>> push = airship.create_push()
>>> push.audience = ua.or_(ua.alias('adam'), ua.ios_channel('some_ios_channel'))
>>> push.notification = ua.notification(alert='Hello')
>>> push.device_types = ua.device_types('ios')
>>> push.send()

Broadcast to iOS and Android devices

>>> push = airship.create_push()
>>> push.audience = ua.all_
>>> push.notification = ua.notification(
...     ios=ua.ios(alert='Hello iOS'),
...     android=ua.android(alert='Hello Android'))
>>> push.device_types = ua.device_types('ios', 'android')
>>> push.send()

Sending a message center message to a single iOS device

>>> import urbanairship as ua
>>> airship = ua.Airship('application_key', 'master_secret')
>>> push = airship.create_push()
>>> push.audience = ua.ios_channel('some_ios_channel')
>>> push.notification = ua.notification(alert='Hello')
>>> push.device_types = ua.device_types('ios')
>>> push.message = ua.message(
...     'Hello, message center user',
...     '<html><h1>Hello!</h1><p>Goodbye.</p></html>')
>>> push.send()

Web Push to a tag

>>> import urbanairship as ua
>>> airship = ua.Airship('application_key', 'master_secret')
>>> push = airship.create_push()
>>> push.audience = ua.tag('web_tag')
>>> push.notification = ua.notification(alert='Hello')
>>> push.device_types = ua.device_types('web')
>>> push.send()

History

  • 5.0 Support for SMS and Email messages. See changelog for other updates.

  • 4.0 Support for Automation, removed Feedback

  • 3.0 Support for Open Channels, several other significant changes

  • 2.0 Support for Web Notify and more iOS 10, stopped supporting Python 2.6

  • 1.0 Support for In-App and iOS 10

  • 0.8 Support for Reports APIs

  • 0.7 Support for Python 3, major refactoring

  • 0.6 Major refactoring, support for push api v3

  • 0.5 Added Android, Rich Push, and scheduled notifications

  • 0.4 Added batch push

  • 0.3 Added deregister, device token list, other minor improvements

  • 0.2 Added tags, broadcast, feedback

  • 0.1 Initial release

See the CHANGELOG file for more details.

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

urbanairship-5.7.0.tar.gz (52.7 kB view details)

Uploaded Source

Built Distribution

urbanairship-5.7.0-py3-none-any.whl (61.5 kB view details)

Uploaded Python 3

File details

Details for the file urbanairship-5.7.0.tar.gz.

File metadata

  • Download URL: urbanairship-5.7.0.tar.gz
  • Upload date:
  • Size: 52.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for urbanairship-5.7.0.tar.gz
Algorithm Hash digest
SHA256 e921aad95e59c96e05170aa9c9c69db5eb3c87aa560e27a0f5b323359a61c063
MD5 90a74f629507c4a9280ed3455e3e69a6
BLAKE2b-256 b7582d4c9009b6343b13e04fd965b1f2dc4261742760c2fd1f4493810fffe3be

See more details on using hashes here.

Provenance

File details

Details for the file urbanairship-5.7.0-py3-none-any.whl.

File metadata

  • Download URL: urbanairship-5.7.0-py3-none-any.whl
  • Upload date:
  • Size: 61.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for urbanairship-5.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 401ff497066adb27ed039d31a0eb2d0cfa7d2ea667ce170cdb9caa38250d9610
MD5 330fbb6fa6e81529f53e905b3bbe455e
BLAKE2b-256 fa1396e931a9f4031899323e53cb5c90c0cc9309c76be5f345435c2945a5d567

See more details on using hashes here.

Provenance

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