This project has been archived by its maintainers, and is no longer receiving any updates.
apns-worker
This is a client library for Apple’s push notification service. It is not the first such library for Python, but, as is often the way, the existing options didn’t quite meet our needs:
No dependencies (other than six).
Fire and forget. APNs is a quirky binary protocol that frequently requires reconnecting to the service and re-sending notifications after an error.
Robust. We don’t do quick and dirty here. Readability, tests, and documentation are not optional.
Quick start
An APNs client is by nature stateful. The default apns-worker backend uses Python threads to asynchronously process a queue of messages to send to the service. Most users will want to maintain a global ApnsManager instance to process messages. Note that if your own program is threaded, you may need to take care to create this global instance safely.
from apns_worker import ApnsManager
apns = None
def init_apns(key_path, cert_path):
""" Call this once at program init time. """
global apns
apns = ApnsManager(key_path, cert_path)
def send_badge(token, badge=1):
""" Badge the app on a single device. """
apns.send_aps([token], badge=badge)
Metadata
Release files for apns-worker 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| apns-worker-0.1.tar.gz | 26.8 kB | Without provenance | Details for apns-worker-0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| apns_worker-0.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for apns_worker-0.1-py2.py3-none-any.whl |
Total release size: 49.5 kB
Release files / apns-worker-0.1.tar.gz
| Download URL | apns-worker-0.1.tar.gz |
|---|---|
| Size | 26.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1fc300497e914456d06eee7cac22d191c7164214a32bf8a29e390ff877c0604d
|
|
BLAKE2b-256 checksum How to use checksums |
0eb32c08839ee9cb57740267c24ff99ccce87f90c8d4ebb307607bd34bb7c32d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / apns_worker-0.1-py2.py3-none-any.whl
| Download URL | apns_worker-0.1-py2.py3-none-any.whl |
|---|---|
| Size | 22.6 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
d5081549ed44a042971bf855bd794c288317f1a86e801e3ccd833057a32de089
|
|
BLAKE2b-256 checksum How to use checksums |
9a731db0dc1a14aadb72fd09bd4de3cafd04eedde61a5f25a501cbccee74aaf9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for apns-worker 0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.