crypto-email-alerts is a command-line interface that alerts you regarding the price change of cryptocurrency. I made this mostly for personal use.
Dependencies include schedule to do job-scheduling and requests to handle API requests to Binance.
Modify config.py
with the appropriate SMTP
mail configuration (SSL is enabled by default, so your configuration must target port 465).
The alerts.json
file can be used to configure the conditions of when to alert the destination e-mail address(es) of the value of a pairing having satisfied the new condition(s).
A separate e-mail is sent for each condition. Once an e-mail alert is sent, the condition is removed from the conditions
array and alerts.json
is updated.
{
"alerts": [
{
"to": "[email protected]",
"conditions": [
"BTCUSDT < 300", "XRPUSDT < 0.5"
]
},
{
"to": "[email protected]",
"conditions": [
"BTCUSDT >= 1000"
]
}
]
}
will alert [email protected]
when the value of XRPUSDT
goes below 0.5, or BTCUSDT
is below 300, and [email protected]
when the value of BTCUSDT
is greater than or equal to 1000.
Using virtualenv
virtualenv -p python3 env
. env/bin/activate
pip install -r requirements.txt
After installation, in the virtual environment run python run.py
.
Using pm2
deployment is as simple as
pm2 start run.py --interpreter=env/bin/python
The interpreter flag is necessary since it forces the Python installation used to be the associated with the virtual environment created during the installation step.