semvec/pypi-packages huggingface dataset:
digitec-galaxus-watcher 0.0.1
Price and availability tracker for Digitec and Galaxus
License: MIT
Requires Python: >=3
Keywords: python,watcher,price tracker,digitec,galaxus


# digitec-galaxus-watcher

[![Python application](https://github.com/SimonStaehli/digitec-galaxus-watcher/actions/workflows/python-app.yml/badge.svg)](https://github.com/SimonStaehli/digitec-galaxus-watcher/actions/workflows/python-app.yml) [![Python package](https://github.com/SimonStaehli/digitec-galaxus-watcher/actions/workflows/python-package.yml/badge.svg)](https://github.com/SimonStaehli/digitec-galaxus-watcher/actions/workflows/python-package.yml)

This repo implements a watcher for products located on the webpage
of digitec and galaxus (only). Supported features are the monitoring of 
changes in price and availability which then can be forwarded to a messaging bot.



## Features

Currently supported trackable features:
- product price
- product availability

Currently supported messaging bots:
- Telegram

## Usage/Examples

See docstrings for more infos

```python
# with messaging
from digitec_galaxus_watcher import DigitecGalaxusWatcher
from digitec_galaxus_watcher import TelegramConnector

telegram = TelegramConnector(bot_token='<your bot token>')
watcher = DigitecGalaxusWatcher(
                item_name=['PS5', 'PowerPro Staubsauger', 'Bosch Waschmaschine'], 
                check='price',
                product_url=[playstation_url, sauger_url, bosch_url], 
                time_delta=1, 
                message_bot=telegram,
                verbose=True, 
                logger_fp='log_price.csv'
)
watcher.watch()

Out:
==================== Watch Product Price ====================
This item is not available and thus has no price.
[Mon May  2 15:35:10 2022] - PS5 - Price: None CHF
[Mon May  2 15:35:15 2022] - PowerPro Staubsauger - Price: 124.0 CHF
...
```
Note; In order for `TelegramConnector` to connect to your chat you have to send a test message first to your bot from your phone. 


## Messaging Connectors

### Telegram Connector
Follow this tutorial to setup your messaging bot:
https://www.codementor.io/@karandeepbatra/part-1-how-to-create-a-telegram-bot-in-python-in-under-10-minutes-19yfdv4wrq

To use the Telegram Connector you need the bot_token. (like example above)
Then can be added as the example above.

### Custom Connector

If one wants to implement own connector, your connector needs to provide
a method

```python
custom_connector = CustomConnector(password='foo')

# Required method
custom_connector.send_message(message='something')
```
## Contributing

Contributions are always welcome!

1. Clone Repository 
2. Make adjustments
3. Add PR



## Appendix
Official websites:
https://www.digitec.ch/ 
https://www.galaxus.ch/de