Registry / communication / urbanairship

urbanairship

JSON →
library7.3.2pypypi✓ verified 87d ago

The `urbanairship` library is a Python client for interacting with the Airship REST API, enabling programmatic access to features like sending push notifications, managing audiences, and retrieving reports. It is currently at version 7.3.1 and receives updates periodically, with major releases introducing significant changes.

pip install urbanairship
INSTALL
IMPORT
SIG · URBANAIRSHIP
U
urbanairship
communicationpythonv7.3.2
Install
2.3s avg
Import
875ms
Disk
21MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v7.3.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.747s · 22.7MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 2.3s · import 0.653s · 23MB
21MB installed
● package 21MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BasicAuthClient
from urbanairship import BasicAuthClient
BearerTokenAuthClient
from urbanairship import BearerTokenAuthClient
Airship
N/A (removed in v7.0.0)
from urbanairship import Airship
The `Airship` class was removed in v7.0.0. Use `BasicAuthClient` or `BearerTokenAuthClient` instead.
Push
from urbanairship import Push
Audience
from urbanairship import Audience
Notification
from urbanairship import Notification
Platform
from urbanairship import Platform

This quickstart demonstrates how to send a basic push notification to all devices using `BasicAuthClient`, which is the recommended client for key/secret authentication. Ensure your Airship App Key and Master Secret are configured either as environment variables or directly in the code (for development purposes).

import os from urbanairship import BasicAuthClient, Push, Audience, Notification, Platform # Replace with your actual credentials or set as environment variables APP_KEY = os.environ.get('URBAN_AIRSHIP_APP_KEY', 'YOUR_APP_KEY') MASTER_SECRET = os.environ.get('URBAN_AIRSHIP_MASTER_SECRET', 'YOUR_MASTER_SECRET') if APP_KEY == 'YOUR_APP_KEY' or MASTER_SECRET == 'YOUR_MASTER_SECRET': print("Please set URBAN_AIRSHIP_APP_KEY and URBAN_AIRSHIP_MASTER_SECRET environment variables or replace placeholders.") # exit(1) # Uncomment to prevent execution with dummy credentials # Initialize the client with Basic Authentication client = BasicAuthClient(APP_KEY, MASTER_SECRET) try: # Create a Push object push = Push(client) # Target all devices push.audience = Audience.all() # Define the notification message push.notification = Notification(alert="Hello from Urban Airship Python Library!") # Specify device types (platforms) to target push.device_types = Platform.all() # Send the push notification response = push.send() print(f"Push notification sent successfully! Status: {response.status_code}") print(f"Response body: {response.json()}") except Exception as e: print(f"An error occurred: {e}")
Debug
Known issues
breakingThe primary `urbanairship.Airship` client class was removed in version 7.0.0. Code using this class will raise an `AttributeError` or `ImportError` on v7.x.x.
fix
Migrate to `urbanairship.BasicAuthClient` for key/secret authentication or `urbanairship.BearerTokenAuthClient` for token-based authentication.
affects: >=7.0.0
breakingVersion 7.0.0 dropped support for Python versions prior to 3.10. Older versions (e.g., v6.0.1) dropped support for Python 2 and prior to 3.6.
fix
Ensure your project is running on Python 3.10 or newer. Upgrade your Python environment if necessary.
affects: >=7.0.0
gotchaThe official GitHub README for the `urbanairship/python-library` project may contain outdated quickstart examples that still reference the removed `urbanairship.Airship` class, even for current 7.x.x versions. Following these examples will lead to errors.
fix
Always refer to the library's source code or release notes for the most accurate usage patterns, especially for client instantiation. Use `BasicAuthClient` or `BearerTokenAuthClient`.
affects: >=7.0.0
breakingSupport for location APIs, including the `LocationFinder` class and location-based audience selectors, was removed in version 6.0.1.
fix
If your application relies on location-based targeting or data, you will need to find alternative methods or use an older version of the library (prior to 6.0.1), though this is not recommended due to lack of updates.
affects: >=6.0.1
Errors
Common errors & fixes
AttributeError: module 'urbanairship' has no attribute 'Airship'
Attempting to use the `Airship` client class in `urbanairship` versions 7.0.0 or newer. This class was removed.
fix
Replace `urbanairship.Airship(key, secret)` with `urbanairship.BasicAuthClient(key, secret)` or `urbanairship.BearerTokenAuthClient(token)`.
TypeError: 'int' object is not subscriptable
In `urbanairship` versions before 7.3.1, sending a `message` without a `notification` could improperly raise a `TypeError`.
fix
Upgrade to `urbanairship` version 7.3.1 or newer. If upgrading is not possible, ensure that when sending a `message`, a `notification` object is also included or structure your payload appropriately to avoid this edge case.
ImportError: cannot import name 'Airship' from 'urbanairship'
Attempting to import the `Airship` client class directly from the `urbanairship` package in versions 7.0.0 or newer. This class no longer exists.
fix
Change your import statement from `from urbanairship import Airship` to `from urbanairship import BasicAuthClient` or `from urbanairship import BearerTokenAuthClient`.
Upgrade
Version history
7.3.2latest on PyPI · released Jun 12, 2026
Audit
Dependencies
requestsrequiredHTTP client for API requests
pytzrequiredTime zone handling
iso8601requiredISO 8601 date parsing
python-dateutilrequiredExtends datetime functionality
Agent activity
31 hits · last 30 days
node
30
OpenAI (training)
1
Resources
urbanairship — pip install urbanairship · libregistry