Code Monkey home page Code Monkey logo

pushover's Introduction

A simple Python3.3 client for http://pushover.net/ API based off of https://github.com/pix0r/pushover by pix0r.

Install:

pip install https://github.com/Wyattjoh/pushover

Sample Python3 Usage:

from pushover import Pushover

po = Pushover("My App Token")
po.user("My User Token")

msg = po.msg("Hello, World!")

msg.set("title", "Best title ever!!!")

po.send(msg)

Sample Shell Usage:

./pushover "Hello, World!" --token="My App Token" --user="My User Token"

Python v3

Pushover Class:

class Pushover(builtins.object)
 |  Creates a Pushover handler.
 |  
 |  Usage:
 |  
 |      po = Pushover("My App Token")
 |      po.user("My User Token", "My User Device Name")
 |  
 |      msgid, msg = po.msg("Hello, World!")
 |  
 |      po.send(msgid)
 |  
 |  Methods defined here:
 |  
 |  __init__(self, token=None)
 |      Creates a Pushover object.
 |  
 |  msg(self, message)
 |      Creates a PushoverMessage object. Takes one "message" parameter (the message to be sent).
 |      Returns with message id (mid) and PushoverMessage object (msg).
 |  
 |  send(self, mid)
 |      Sends a specified message with id "mid".
 |  
 |  sendall(self)
 |      Sends all PushoverMessage's owned by the Pushover object.
 |  
 |  user(self, user_token, user_device=None)
 |      Sets a single user to be the recipient of all messages created with this Pushover object.

PushoverMessage Class:

 class PushoverMessage(builtins.object)
 |  Used for storing message specific data.
 |  
 |  Methods defined here:
 |  
 |  __init__(self, message)
 |      Creates a PushoverMessage object.
 |  
 |  __str__(self)
 |  
 |  get(self)
 |      Returns a dictionary with the values for the specified message.
 |  
 |  set(self, key, value)
 |      Sets the value of a field "key" to the value of "value".
 |  
 |  user(self, user_token, user_device=None)
 |      Sets a single user to be the recipient of this message with token "user_token" and device "user_device".

Shell

Usage:    pushover <message> --token=<TOKEN> --user=<USER> [options]

Options:
-h, --help            show this help message and exit
--token=<TOKEN>         Pushover app token (overrides environment
                      PUSHOVER_TOKEN)
--user=<USER>           Pushover user key

Optional:
--device DEVICE       Pushover device name
--title TITLE         Message title
--timestamp TIMESTAMP Optional UNIX timestamp
--priority PRIORITY   Optional priority setting (0=normal, 1=high)

pushover's People

Contributors

pix0r avatar wyattjoh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.