pyfcm
Python client for FCM - Firebase Cloud Messaging (Android, iOS and Web)
What it is and what it does
PyFCM wraps the Firebase Cloud Messaging REST API to let Python applications send push notifications and data payloads to mobile and web clients. It handles authentication via service account files or Google OAuth2 credentials, supports sending to individual devices, topics, and conditional topic subscriptions, and allows platform-specific configuration for Android (android_config), iOS (apns_config), and Web (webpush_config). The package abstracts away HTTP details and credential management, letting developers focus on message construction and delivery.
The library supports both notification messages (which FCM displays on the client's behalf) and data-only messages (which the client app processes), as well as combined payloads. It includes support for Tornado and can route requests through HTTP proxies. Initialization requires either a Firebase service account JSON file or pre-configured Google credentials and a project ID; messages are sent via the notify() method with optional dry-run testing.
Use it for:
- Send push notifications to mobile app users when new data is available or to drive user re-engagement.
- Deliver time-sensitive alerts to Android, iOS, or Web clients subscribed to specific FCM topics.
- Send custom data payloads (up to 4KB) to client applications for in-app processing without displaying a system notification.
- Implement conditional topic messaging to reach users matching specific subscription criteria.
- Test notification delivery in a staging environment using the dry_run parameter before sending to production.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PyFCM is a Python client for Firebase Cloud Messaging (FCM) that sends push notifications and data messages to Android, iOS, and Web clients.
Yes, if you are building a Python application that needs to send Firebase Cloud Messaging notifications to mobile or web clients and can provide a service account or OAuth2 credentials. The package is stable (Production/Stable classifier), has no known vulnerabilities, and handles the FCM HTTP V1 API migration. However, be aware that maintenance is aging (382 days since last release); verify compatibility with your target Python version, as the classifiers list only up to Python 3.5.
Install
pyfcm on PyPI
pip
pip install pyfcmuv
uv add pyfcmpoetry
poetry add pyfcmInstalling pyfcm
Before you install
Low install friction with a pure-Python wheel distribution. Maintenance status is aging—last release was 382 days ago—but the repository remains active with a recent commit on 2026-01-16 and no archived status.
License in practice
MIT License (permissive) places no restrictions on use, modification, or distribution in commercial or private projects.
Quickstart
pip install pyfcm
from pyfcm import FCMNotification
fcm = FCMNotification(service_account_file="path/to/service-account.json", project_id="your-project-id")
result = fcm.notify(fcm_token="device-token", notification_body="Hello")
Requires a Firebase service account JSON file or valid Google OAuth2 credentials with firebase.messaging scope; project_id must be specified.
Verify before relying
- Whether the package supports modern Python versions beyond those listed in classifiers (3.5 is the highest listed).
- Current compatibility with the latest Firebase FCM HTTP V1 API after the June 2024 migration mentioned in the description.
Package facts
| License | MIT License (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — requests, urllib3, google-auth, aiohttp |
| Maintenance | aging — 382 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 250,414/month — #8,630 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyfcm-2.1.0-py3-none-any.whl
Keywords: firebase, fcm, apns, ios, gcm, android, push, notifications
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
fcm-djangoDjango app that integrates Firebase Cloud…
permissive · top 15,000 on PyPI
firebase-messagingReceives push notifications sent via Firebase…
permissive · top 15,000 on PyPI
pushbullet.pyA Python client library for the Pushbullet API…
permissive · top 15,000 on PyPI
django-push-notificationsA Django app that manages device registrations…
permissive · top 15,000 on PyPI
firebase-adminFirebase Admin Python SDK provides server-side…
permissive · top 1,000 on PyPI
firebase-functionsFirebase Functions Python SDK lets you write…
permissive · top 15,000 on PyPI
urbanairshipPython library for integrating Airship's push…
permissive · top 15,000 on PyPI
pywebpushEncrypts and sends web push notifications to…
copyleft · top 5,000 on PyPI
onesignal-python-apiA Python client library for the OneSignal API…
unclear · top 15,000 on PyPI
secopsA Python SDK for interacting with Google…
permissive · top 15,000 on PyPI