Skip to main content

Get automated price alert based on investing.com prices

Project description

investify

Utility tool which scrapes investing.com website for price updates and send whatsapp notification if it breaches a predefined threshold.

Setup

You can clone the project and simply run the script. You need to have a twilio account (a free one would do as well). Setup your whatsapp dashboard in twilio first and use that numbers in the script. For the authentication export your Account SSID and Authentication token as follows :-

Account SSID

$ export TWILIO_ACCOUNT_SID='ACXXXXXXXXXXXXXXXXXXXXXXXXXXX'

Authentication token

$ export TWILIO_AUTH_TOKEN='XXXXXXXXXXXXXXXXXXXXXXXXX'

Usage

$ python investify.py +1456789012 +31234567789 crypto btc-usd 6600-6700 --sub-market bitcoin --threshold 10

This will notify when btc-usd prices breaches the price band of 6600-6700. It currently resets the price band from the last breached price.

The tool will logging INFO (or DEBUG) level messages in standard out. This can certainly be redirected to a specified log file.

Debug level messages as follows :-

$ python investify.py --debug +11234567890 +7112356789 crypto btc-usd 6600-6700 --sub-market bitcoin --threshold 10 --interval 0.1
2020-04-05 20:13:38 [DEBUG] main() - Logging set to debug
2020-04-05 20:13:38 [DEBUG] main() - crypto/bitcoin/btc-usd end point will be queried.
2020-04-05 20:13:39 [DEBUG]  run() - Fetched page successfully.
2020-04-05 20:13:39 [DEBUG]  run() - Price of btc-usd is $6804.9.
2020-04-05 20:13:39 [ INFO]  run() - Price 6804.9 breached price band [6600.0, 6700.0].
2020-04-05 20:13:39 [DEBUG]  run() - Resetting price band with threshold value 10.0.
2020-04-05 20:13:39 [ INFO]  run() - Resetting price band to [6798.0951, 6811.704899999999].
2020-04-05 20:13:39 [DEBUG]  run() - Sending text.
2020-04-05 20:13:46 [DEBUG]  run() - Fetched page successfully.
2020-04-05 20:13:46 [DEBUG]  run() - Price of btc-usd is $6803.6.
^C
2020-04-05 20:13:49 [ INFO] main() - Caught interrupt, exiting...

Help menu for the tool.

$ python investify.py -h
Usage: investify.py [options...] [to number] [from number] [market] [contract]
                    [priceband]

  Utiltiy script to notify if instrument price fluctuates out of price band.

Options:
  -s, --symbol TEXT      Contract symbol. [default: contract]
  -t, --threshold FLOAT  Threshold in bps.  [default: 100.0]
  -i, --interval FLOAT   Interval to perform check (mins).  [default: 1.0]
  -m, --sub-market TEXT  E.g. crypto is market and bitcoin is sub market.
  -d, --debug            Print debug messages.
  -h, --help             Show this message and exit.

to number should be your whatsapp number whereas from number should the number given by Twilio to be used for your whatsapp sandbox. You can consult official Twilio for whatsapp page.

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

investify-0.0.4.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

investify-0.0.4-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file investify-0.0.4.tar.gz.

File metadata

  • Download URL: investify-0.0.4.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.2 Darwin/19.3.0

File hashes

Hashes for investify-0.0.4.tar.gz
Algorithm Hash digest
SHA256 6ec510c78c137cd20aca830ab2d3020d2c912a01b8f0f13a118fa6ecad083a45
MD5 b2cce647f6b4f5f22fef3e274c6150ba
BLAKE2b-256 aa65770a856324c7e33140f0a497834567e7e6cbf8d443b4bdbef7a7d0dae0e1

See more details on using hashes here.

File details

Details for the file investify-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: investify-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.2 Darwin/19.3.0

File hashes

Hashes for investify-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fa4e44002b168815f3b2ee3737602bec3087e3854f8e001245d5b0ad6b20ef45
MD5 b2cdc2073317022aabdf0a3f2929ba6b
BLAKE2b-256 363879ccd90db40306950ad3611131ba6ce862ad7ccdd4b4b79e4b20efa48110

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