• Stars
    star
    178
  • Rank 213,719 (Top 5 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created over 11 years ago
  • Updated almost 6 years ago

Reviews

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

Repository Details

Python library to interface with PushBullet

pyPushBullet

Python library to interface with PushBullet

My friend showed me PushBullet, I liked it. I like Python, combine the two to achieve greatness.

You will need...

  • Python (2 or 3 should be fine)

Dependencies

If you install pyPushBullet via pip install git+https://github.com/Azelphur/pyPushBullet.git the dependencies should be install automatically.

However, if you want to install manually, you will need:

  • websocket-client - pip install websocket-client
  • requests - pip install requests

And for automatic file type detection for pushFile (optional):

  • python-magic - pip install python-magic

You can get your API Key from https://www.pushbullet.com/#settings/account

Using the library:

from pushbullet.pushbullet import PushBullet

apiKey = "YOUR_API_KEY_HERE"
p = PushBullet(apiKey)
# Get a list of devices
devices = p.getDevices()

# Get a list of contacts
contacts = p.getContacts()

# Send a note
p.pushNote(devices[0]["iden"], 'Hello world', 'Test body')

# Send a map location
p.pushAddress(devices[0]["iden"], "Eiffel tower", "Eeiffel tower, france")

# Send a list
p.pushList(devices[0]["iden"], "Groceries", ["Apples", "Bread", "Milk"])

# Send a link
p.pushLink(devices[0]["iden"], "Google", "http://www.google.com")

# Send a file
p.pushFile(devices[0]["iden"], "file.txt", "This is a text file", open("file.txt", "rb"))

# Send a note to a channel
p.pushNote('channel_tag', 'Hello world', 'Test body', recipient_type='channel_tag')

# Send a note to an email
p.pushNote('[email protected]', 'Hello world', 'Test body', recipient_type='email')

Using the command line tool:

./pushbullet_cmd.py YOUR_API_KEY_HERE getdevices
./pushbullet_cmd.py YOUR_API_KEY_HERE note udeCmddJpl "Hello World" "Test Body"
./pushbullet_cmd.py YOUR_API_KEY_HERE address udeCmddJpl "Eiffel tower" "Eeiffel tower, france"
./pushbullet_cmd.py YOUR_API_KEY_HERE list udeCmddJpl Groceries Apples Bread Milk
./pushbullet_cmd.py YOUR_API_KEY_HERE link udeCmddJpl Google http://www.google.com
./pushbullet_cmd.py YOUR_API_KEY_HERE file udeCmddJpl test.jpg
./pushbullet_cmd.py YOUR_API_KEY_HERE note "#channel_tag" "Hello World" "Test Body"

Questions? Comments? Feel free to drop me a line on IRC, irc.azelphur.com #azelphur

More Repositories

1

PokemonGo-CalcyIV-Renamer

Uses adb to send fake tap events to your phone, alongside Calcy IV to automatically rename all your pokemon.
Python
71
star
2

ownCloud-share-tools

A tool to enable easy sharing of ownCloud files from your desktop, also a Python library.
Python
13
star
3

pyMPEx

Python frontend to the MPEx bitcoin exchange
Python
12
star
4

TwistedCat

Send notifications to an IRC channel using netcat
Python
6
star
5

SourceIRC

An easy to use SourcePawn API to the IRC protocol.
SourcePawn
5
star
6

qube-api

Interact with qube smart bulbs via the (unofficial) API
Python
4
star
7

srcds-detect-freeze

Detects srcds freezing by polling RCON, execute a command when the server is frozen (such as restarting it)
Python
3
star
8

AdvancedHighlights

ZNC Advanced Highlights module
3
star
9

Multiverse-Stargates

Stargates for multiverse
Java
2
star
10

backup_mysql

Automatically backs up all MySQL dabases
Shell
2
star
11

Monord

Python
2
star
12

Preview-Short-URLs

Chrome Extension Stop short URL abuse by previewing the URL automatically before visiting it.
JavaScript
2
star
13

BitcoinAssets

Bitcoin asset streaming module for supybot
Python
2
star
14

SourceIRC2

This is a version of SourceIRC I've been rewriting from the ground up. It is not functional, don't use it, and I don't mean that in a "it's unreliable" kind of way, I mean it in a "there are huge parts missing and it just won't work at all" kind of way.
2
star
15

gnome15-bitcoin-ticker

A simple bitcoin ticker that shows the current trade value for 1 bitcoin.
Python
1
star
16

django-bcauth

Bitcoin authentication for django, based on gribble.
Python
1
star
17

Bitbargain-tools

Various tools pertaining to bitbargain
Python
1
star
18

EkPoGo-Discord-Bot

This is the discord bot we use in east kent pogo, it helps us organise raids.
Python
1
star