Python library to call the APIs that the store itself calls.
To get good parsed results from those API calls see parser.py
.
Prerequisites
sudo apt-get install git
python -m ensurepip --upgrade
git clone https://github.com/allendema/rewe_dl && cd rewe_dl
pip install requirements.txt
pip install -e rewe_dl
Optional apprise can be used to send send notifications to more than 100 services/apps.
See Config options!
You can:
- save product infos to JSON
- save product infos to JSONL
- save product infos to SQL
- save product images
- save product calories or other details
- monitor your basket with your fav products
- compare prices and get notified when prices change
- save products to SQL for further analysis
- analyse the output data the way you like, for example: inflation analysis.
- and whatever you want.
examples/discounted_to_json.py
rewe_dl/rewe_dl/examples/discounted_to_json.py
Lines 26 to 37 in 7948de8
examples/discounted_to_sql.py
rewe_dl/rewe_dl/examples/discounted_to_sql.py
Lines 23 to 35 in 7948de8
examples/my_basket.py
rewe_dl/rewe_dl/examples/my_basket.py
Lines 23 to 37 in 7948de8
examples/newest_products_to_sql.py
rewe_dl/rewe_dl/examples/newest_products_to_sql.py
Lines 19 to 26 in 7948de8
examples/notify_when_price.py
rewe_dl/rewe_dl/examples/notify_when_price.py
Lines 54 to 66 in 7948de8
examples/raw_responses_to_json.py
rewe_dl/rewe_dl/examples/raw_responses_to_json.py
Lines 26 to 43 in 7948de8
See rewe_dl/examples
folder for some more starting examples to embedd it into your own project.
Depending on store location, some stores will have different prices.
To not use the default store, go to https://shop.rewe.de
and select your pickup store.
Right click -> Inspect source -> Web Storage -> Cookies
and copy the value from marketsCookie
into the config.json
file.
If you don't want to install apprise, you can use matrix.org or telegram.org.
- Matrix:
Fill the
matrix
dict inrewe_dl/config.json
file. - Telegram:
Fill the
telegram
dict inrewe_dl/config.json
file. - Apprise (Optional): The config file in
~/.config/apprise
(without any extension) will be used.
Configure your wanted notifications/webhooks options based on the wiki.
API endpoints or data structure might change! If you have any issues report them or open a pull request.
This project will be a part of another project which uses multiple stores using an REST API with Fastapi.
Development
If you want to modify something:
pip install requirements-dev.txt
- The
pyproject.toml
file is used for linting/formatting withruff
. - Make your changes.
- If you add tests, run them with
python3 ./scripts/run_tests.py
. - Run
ruff check --fix .
- Run
ruff format .
- Create a Pull Request.
Inspired from gallery-dl, the code structure is similiar and some is code straight reused.
Where applicable - docstrings point to original code creators.