skillfed

pyfcm

Python client for FCM - Firebase Cloud Messaging (Android, iOS and Web)

pyfcm v2.1.0 250.4K downloads/30d#8,630 on PyPI814
Permissive license MIT License AGING released

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 pyfcm

uv

uv add pyfcm

poetry

poetry add pyfcm

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.2Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Topic :: CommunicationsTopic :: InternetTopic :: Software Development :: Libraries :: Python ModulesTopic :: Utilities

Tags

firebase cloud messaging pythonfcm push notificationssend notifications to mobile appsfirebase python clientandroid ios web push
push-notificationsfirebasemobile-messaging

More Python Modules packages