Skip to main content

Supplementary package for usage with Pygeon mobile application

Project description

Introduction

Pygeon lets you monitor programs by enabling in-code alerts in the form of push notifications on your phone. Alerts can have a custom title, body and an optional context string that gets displayed as the subtitle of the notification on your phone. Sound and vibration for alerts are on by default but could be overriden by your phone's notification settings.

Install Pygeon

pip install pygeon-notifications

Usage with Python (>= 3.6)

Install and open the Pygeon app on your mobile (iOS only) and sign-in. After signing in you will recieve a private key. Use the private key to instantiate a Pygeon object that you can use to send alerts anywhere in your scripts

example

from pygeon import Pygeon
my_pygeon = Pygeon("YOUR_PRIVATE_KEY")

my_pygeon.send("Cool Title", "Even cooler description")

Usage with POST requests

The Pygeon python package under the hood is a simple program that sends a POST request to Pygeon servers. Hence you can send alerts using a simple POST request to https://pygeon.io/api/alert with your private key, title and description in the body of the request.

curl example

curl -X POST "https://pygeon.io/api/alert" -H 'Content-Type: application/json' -d '{"ppk":"YOUR_PRIVATE_KEY","title":"Cool Title", "desc": "Cool Body"}'

node example

const axios = require('axios')

axios.post('https://pygeon.io/api/alert', {
    ppk: 'YOUR_PRIVATE_KEY',
    title: 'Cool Title',
    desc: 'Even cooler description'
  })
  .then(res => {
    console.log(`statusCode: ${res.status}`)
    console.log(res)
  })
  .catch(error => {
    console.error(error)
  })

Example use cases

Pygeon is built for software developers and some use cases include but are not limited to:

example use case 1: You want to step away from your machine until a task finishes

from pygeon import Pygeon
my_pygeon = Pygeon("YOUR_PRIVATE_KEY")

long_task.execute()
# you step away for a beer 🍺
my_pygeon.send("Task finished!")

example use case 2: You want alerts in your trading bot about the stock market

from pygeon import Pygeon
my_pygeon = Pygeon("YOUR_PRIVATE_KEY")

#custom trading logic
if eth_price >= eth_strike:
    my_pygeon.send("Price Alert!", f"Eth above {eth_strike}")
drawing

Note that Pygeon alerts are also recieved on the apple watch if you have one connected to your phone.

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

pygeon-notifications-1.0.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pygeon_notifications-1.0.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file pygeon-notifications-1.0.1.tar.gz.

File metadata

  • Download URL: pygeon-notifications-1.0.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.6

File hashes

Hashes for pygeon-notifications-1.0.1.tar.gz
Algorithm Hash digest
SHA256 19aa5e3000567ec5cb6dcba2bc7712c0adb3647a2d1846a7d6bddf60b39deeaa
MD5 0d12344d2413833397a37999a61d04ab
BLAKE2b-256 9041e18408f90743407b41c27255ec482fcd1a7b0a7ab88e63bfb71575c56f9d

See more details on using hashes here.

File details

Details for the file pygeon_notifications-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pygeon_notifications-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1067c232185fd6a3d6d22ac838c1a5c0a31263729402f672c09afa7adac5034c
MD5 24afa99d34ebb941e0f41274ae90335b
BLAKE2b-256 1ef77765a5767719642e55fafa8955b2ef03c2944e80119bc2bec18b535f1dec

See more details on using hashes here.

Supported by

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