https://github.com/bazbt3/crypto
A Python 3 script to send selected cryptocurrency alerts via a Pushover message. The code to post a message to a pnut.io channel is commented out.
https://github.com/bazbt3/crypto
cryptocurrency pnut pushover python pythonista
Last synced: 3 months ago
JSON representation
A Python 3 script to send selected cryptocurrency alerts via a Pushover message. The code to post a message to a pnut.io channel is commented out.
- Host: GitHub
- URL: https://github.com/bazbt3/crypto
- Owner: bazbt3
- License: mit
- Created: 2018-01-21T14:10:57.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-01T10:52:31.000Z (almost 8 years ago)
- Last Synced: 2025-02-21T10:38:59.486Z (12 months ago)
- Topics: cryptocurrency, pnut, pushover, python, pythonista
- Language: Python
- Homepage:
- Size: 227 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
## What is crypto?
A Python 3.5 application; this *example* app sends a Pushover alert. (Previously also sent a message to my pnut.io 'dev' channel; text retained below.)
* Three cryptocurrency value equivalents in GBP,
* the user's holding in total and per coin, also in GBP,
* their movement within the preceding hour,
* a message if any exceeds a value hard coded within the application.
* A graph of upto the last 24 hours' movements is created for each currency and saved in the application folder, and the BTC graph is added to the Pushover alert message (though not the pnut.io message yet.)
Application is currently tested in Pythonista and at pythonanywhere.com and my web host. Runs every hour either as a pythonanywhere 'task' or a cron job at my web host.
### Prerequisites:
* pnut.io and Pushover account application and user tokens - read from separate files to give some portability to the code:
* `pnut_app_token.txt`
* `pushover_app_token.txt`
* `pushover_user_token.txt`
* The PNUTpy libraries: `pip install pnutpy`.
* For graphing: `pip install matplotlib`. *(I thought this was installed already at my web host, but it's possibly not available at crypto v0.7.)*
* One text file for each of the cryptocurrencies desired, named as crypto_(currency 3 letter name)_values.txt, e.g. `crypto_btc_values.txt`. Note: the 'btc' file is necessary, it's the only one sent as a Pushover alert.
### The entire `get_price` function is taken from:
https://github.com/jakewmeyer/Crypto - which uses the basic data from https://www.cryptonator.com/api
Tiny modification: its `data` variable is converted to global for use outside the routine.
### What does it look like?
An alert (iOS):
An expanded message (iOS):
