A developer-friendly wrapper for Firebase Cloud Messaging with QR code pairing
Project description
tingpy
A developer-friendly wrapper for Firebase Cloud Messaging (FCM) that simplifies push notifications and handles mobile app pairing via QR code.
Features
- Notification Sender: Send push notifications to mobile apps using Firebase Cloud Messaging.
- Mobile Pairing: Generate QR codes in the terminal for easy connection of mobile apps to Firebase projects.
Installation
pip install tingpy
Dependencies
- firebase-admin
- segno
Usage
import tingpy
# 1. Setup (Sending)
bot = tingpy.Client("my-secret.json")
# 2. Pairing (Only needed once)
# This prints a giant QR code in the terminal
tingpy.pair_device("google-services.json")
# 3. Usage
bot.send(
topic="general",
title="Trade Executed",
body="Bought NIFTY 21500 CE @ 120"
)
API Reference
TingClient
__init__(config_path): Initialize with path to Firebase service account JSON.send(topic, title, body, color=None): Send a notification to the specified topic.
pair_device(json_path)
Parses the google-services.json file and prints a QR code containing the necessary pairing information.
Testing
Run unit tests:
python -m unittest tests/test_pairing.py
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tingpy-0.1.0.tar.gz.
File metadata
- Download URL: tingpy-0.1.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7557359ae43e2e31af1673e75c2ae4d8fc10bab8a465e70438e18100d6afd50
|
|
| MD5 |
d7c52f7ba2a8ba0bd206fc70f0ea472a
|
|
| BLAKE2b-256 |
a9912278c811ddc7c967b2f28867df7a5ba6f95eb9a9f18cb3536731810748d6
|
File details
Details for the file tingpy-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tingpy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a745ea0ffe4cfda962f66fb819cfc541b14fa712195973723a6ff6e5ecc16ed4
|
|
| MD5 |
26af4802a541d620ea434e6377e3f374
|
|
| BLAKE2b-256 |
49742425df3e03cbba8f0456e8f5509bd4ca56e9fc5099f57a7f0bde145deaec
|