Python library to interface with PushBullet
Latest commit d230d80 May 2, 2016 @Azelphur Merge pull request #37 from Lyude/pull/dismiss
Add PushBullet.dismissEphemeral()


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)


If you install pyPushBullet via pip install 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

Using the library:

from pushbullet.pushbullet import PushBullet

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", "")

# 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('', 'Hello world', 'Test body', recipient_type='email')

Using the command line tool:

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

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