Skip to main content

Python API wrapper for the pushbullet API

Project description

Pyshbullet v1.1.50

Pyshbullet is a async-based API wrapper for the Pushbullet API service.

Example usage:

import pyshbullet
import asyncio
import os
client = pyshbullet.APIClient(TOKEN)
async def main():
  userobj = await client.get_current_user()
  print(userobj.created)
  pushesobj = await client.get_push_history(limit=2)
  print([message.sent.strftime('%m-%d-%Y') for message in pushesobj])
  chats = await client.list_chats()
  print([chat.created.strftime('%m-%d-%Y') for chat in chats])
  print([chat.chatting_with.name for chat in chats if chat.chatting_with != None])
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
@client.event
async def on_message(message):
  print(f"Message sent: {message.sent.strftime('%m-%d-%Y')}")
  print(f'Message content: {message.content}')
  print(f'Message type: {message.type}')
  print(f'Message image url: {message.image_url}')
  print(f'Message file url: {message.file_url}')
  print(f'Message author: {message.author.name}')
  print(f'Message author email: {message.author.email}')
@client.event
async def on_run():
  print('Started running.')
client.run()

Replace TOKEN with your Pushbullet API token.

The code above gets the user associated with the API token, and will listen to the websocket. Once a new message is sent, it prints out the data of the message.

Documentation will be added in the future.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyshbullet-1.1.50.tar.gz (28.0 kB view hashes)

Uploaded Source

Built Distribution

pyshbullet-1.1.50-py3-none-any.whl (43.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page