• Stars
    star
    459
  • Rank 94,747 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created about 12 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python client for Google Cloud Messaging for Android (GCM)

python-gcm

Join the chat at https://gitter.im/geeknam/python-gcm Build Status Code Health https://coveralls.io/repos/geeknam/python-gcm/badge.svg?branch=master

Python client for Google Cloud Messaging for Android (GCM)

Installation

pip install python-gcm

Features

  • Supports multicast message
  • Resend messages using exponential back-off
  • Proxy support
  • Easily handle errors
  • Uses requests from version > 0.2
  • Topic Messaging
  • TCP connection pooling and Keep-Alive when passing an explict requests.Session object to the used GCM request call

Usage

Read about Google Cloud Messaging

from gcm import GCM

gcm = GCM(API_KEY)
data = {'param1': 'value1', 'param2': 'value2'}

# Downstream message using JSON request
reg_ids = ['token1', 'token2', 'token3']
response = gcm.json_request(registration_ids=reg_ids, data=data)

# Downstream message using JSON request with extra arguments
res = gcm.json_request(
    registration_ids=reg_ids, data=data,
    collapse_key='uptoyou', delay_while_idle=True, time_to_live=3600
)

# Topic Messaging
topic = 'topic name'
gcm.send_topic_message(topic=topic, data=data)

See examples directory for more usage details, including error handling.

Contributing

See CONTRIBUTING.md

Licensing

See LICENSE

More Repositories

1

messengerbot

Python client for Facebook Messenger Platform Bot
Python
144
star
2

Push-Contacts

Pushing SMS from/to Android phone via web browser (C2DM implementation)
Python
54
star
3

esser

Event Sourcing Serverlessly
Python
28
star
4

tastypie-angular-example

Boilerplate project for integrating Angular.js with django-tastypie.
JavaScript
26
star
5

asx-terminus

All things ASX in your terminal
Python
13
star
6

py-xiaomi-home

Pythonic bindings for Xiaomi Smart Home Suite
Python
13
star
7

tocker

tocker: TDD for Dockerfile
Python
12
star
8

docker-confluent-python

Docker image for confluent-python with librdkafka
8
star
9

aws-neptune-aml

Personal take on GraphDB + AML with AWS Neptune + Glue + Lambda.
Python
6
star
10

python-google-shopping

Python Google Shopping client for Humans
Python
5
star
11

midimoco

Django - Event sourcing - CQRS - Serverless
Python
5
star
12

django-fig-template

Django project template that quickly builds containerised development environment with Docker and Fig
Python
4
star
13

django-instant-api

Create instant REST API with Django
Python
3
star
14

django-sherlock

A customizable notifications framework
Python
3
star
15

Bitflurry

A proof-of-concept video streaming server with RAID-style of file splitting over a network, coded from scratch. Supports up to RAID6.
C
3
star
16

World-Heritage-Site

Android assignment, integration with GAE web service, eye-pleasing UI
Java
3
star
17

drone.io-fig

Fig template to quickly setup Drone.io in 5 min.
Nginx
2
star
18

cloudarmy

A better workflow for developing AWS Cloudformation templates
Python
2
star
19

zappa-bitbucket-pipelines

Docker image to use Zappa as part of Bitbucket Pipelines
2
star
20

python-postgres-bitbucket

Postgres image with python 2.7 for bitbucket pipelines
2
star
21

dotfiles

My dotfiles
Shell
2
star
22

django-kutter

Python
1
star
23

geeknam.github.com

My Octopress Blog
JavaScript
1
star
24

kogan-android

Kogan Android client
Java
1
star
25

thumbor-consul

Thumbor containers with configs populated by Consul
Shell
1
star
26

foneng.in

foneng.in
JavaScript
1
star
27

docker_workshop

Workshop
1
star
28

melbdjango-demo

Demo for "Learning Design Patterns from Django"
Python
1
star
29

spark-kogan

Spark DataSource for Kogan.com API
Scala
1
star