Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tingpy-0.1.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

tingpy-0.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

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

Hashes for tingpy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d7557359ae43e2e31af1673e75c2ae4d8fc10bab8a465e70438e18100d6afd50
MD5 d7c52f7ba2a8ba0bd206fc70f0ea472a
BLAKE2b-256 a9912278c811ddc7c967b2f28867df7a5ba6f95eb9a9f18cb3536731810748d6

See more details on using hashes here.

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

Hashes for tingpy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a745ea0ffe4cfda962f66fb819cfc541b14fa712195973723a6ff6e5ecc16ed4
MD5 26af4802a541d620ea434e6377e3f374
BLAKE2b-256 49742425df3e03cbba8f0456e8f5509bd4ca56e9fc5099f57a7f0bde145deaec

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