Skip to main content

rewerse

Python bindings for the REWE mobile API.

Notes

  • FFI wrapper around compiled Go library (Github), not native Python
  • ~9 MB package size (includes .so and .dll)
  • Linux x86_64 and Windows x86_64 only (macOS: build from source)
  • Response types are untyped dicts; see Go structs for field definitions

Requirements

Installation

pip install rewerse

Alternatively, build from source on Windows (requires Go 1.21+ and gcc):

python python/build_lib.py
cd python && pip install -e .

This builds both the Linux .so and Windows .dll. For macOS, see building from source.

Usage

from rewerse import Rewerse

client = Rewerse(cert="certificate.pem", key="private.key")

markets = client.market_search("Berlin")
# [
#     {
#         "wwIdent": "8547534",
#         "name": "REWE Markt",
#         "companyName": "REWE Karsten Schmidt oHG",
#         "street": "Schönhauser Allee 80",
#         "zipCode": "10439",
#         "city": "Berlin",
#         "location": {"latitude": 52.54984, "longitude": 13.41488},
#         "openingStatus": {"openState": "CLOSED", "statusText": "Geschlossen", ...},
#         "serviceFlags": {"hasPickup": true},
#         ...
#     },
#     ...
# ]

market_id = markets[0]["wwIdent"]

products = client.get_products(market_id, "Milch")
# {
#     "products": [
#         {
#             "productId": "677067",
#             "title": "Weihenstephan H-Milch 3,5% 1l",
#             "listing": {
#                 "currentRetailPrice": 99,
#                 "grammage": "1l",
#                 "discount": {"__typename": "RegularProductDiscount", "validTo": "04.04."},
#                 "loyaltyBonus": {"bonusType": "CENT", "bonusValue": 10},
#                 ...
#             },
#             "attributes": {"isOrganic": false, "isVegan": false, "isBulkyGood": true, ...},
#             ...
#         },
#         ...
#     ],
#     "pagination": {"objectsPerPage": 30, "currentPage": 1, "pageCount": 24, "objectCount": 706},
#     "searchTerm": {"original": "Milch", "corrected": null}
# }

discounts = client.get_discounts(market_id)
# {
#     "categories": [
#         {
#             "id": "markt-topangebote",
#             "title": "Top-Angebote in deinem Markt",
#             "index": 3,
#             "offers": [
#                 {
#                     "title": "Kinder Riegel",
#                     "subtitle": "je 18 x 21-g-Pckg. (1 kg = 11.56)",
#                     "price": 3.99,
#                     "priceRaw": "3,99 €",
#                     "loyaltyBonus": 0.1,
#                     "manufacturer": "FERRERO",
#                     "articleNo": "249183",
#                     "productCategory": "suesses-und-salziges",
#                     ...
#                 },
#                 ...
#             ]
#         },
#         ...
#     ],
#     "validUntil": "2026-04-05T00:00:00Z"
# }

Methods

All methods raise RewerseError on failure. Responses are untyped dicts; field definitions, filter constants, and enum values are documented in the Go reference.

Markets

Method Description
market_search(query) Search markets by PLZ, city, street or name
get_market_details(market_id) Get market details (hours, address, etc.)

Products

Method Description
get_products(market_id, search, *, page=1, objects_per_page=30, filters=None) Search products in a market
get_category_products(market_id, category_slug, *, page=1, objects_per_page=30, filters=None) Get products by category slug
get_product_by_id(market_id, product_id) Get product details
get_product_recommendations(market_id, listing_id) Related product recommendations

See ProductFilter. Prices in currentRetailPrice are in cents (divide by 100 for euros).

Discounts

Method Description
get_discounts(market_id) Get parsed weekly discounts
get_discounts_raw(market_id) Get raw discount data including handout links

Shop & Services

Method Description
get_shop_overview(market_id, *, service_type="PICKUP", zip_code="") Get product categories for a market's online shop
get_service_portfolio(zipcode) Get available REWE services for a zip code
get_recalls() Get current product recalls

See ServiceType. Must match market capabilities (check serviceFlags.hasPickup from get_market_details()).

Basket

Method Description
create_basket(market_id, zip_code, service_type="PICKUP") Create a new shopping basket
get_basket(basket_id, market_id, zip_code, service_type, version=0) Get current basket state
set_basket_item(basket_id, market_id, zip_code, service_type, listing_id, quantity, version) Add/update item quantity in basket
remove_basket_item(basket_id, market_id, zip_code, service_type, listing_id) Remove item from basket

See ServiceType. version: basket state version for optimistic locking (from previous basket response). Prices in cents.

Delivery

Method Description
get_bulky_goods_config(market_id, service_type="DELIVERY") Get beverage crate limits and surcharges

Recipes

Method Description
recipe_search(*, search_term="", page=1, objects_per_page=20, collections=None, difficulties=None, tags=None, tag_concat="AND", include_recipe_of_the_day=False) Search recipes by term, collection, difficulty and tags
get_recipe_details(recipe_id) Get a full recipe with ingredients, steps and nutrients
get_recipe_popular_terms() Get the search terms shown on the recipe landing page
results = client.recipe_search(search_term="Lachs", difficulties=[1])
recipe = client.get_recipe_details("blt4aaa7361ba69f8c8")
terms = client.get_recipe_popular_terms()

macOS

The PyPI wheel doesn't include a macOS binary. Build from source on a Mac:

git clone https://github.com/ByteSizedMarius/rewerse-engineering.git
cd rewerse-engineering
python python/build_lib.py --platform darwin
cd python && pip install -e .

Requires Go 1.21+ and Xcode command line tools (xcode-select --install).

License

MIT

Metadata

Release files for rewerse 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rewerse 1.4.0
File Size Uploaded
rewerse-1.4.0.tar.gz 9.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for rewerse 1.4.0
File Interpreter ABI Platform
rewerse-1.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.1 MB

Release files / rewerse-1.4.0.tar.gz

Download URL rewerse-1.4.0.tar.gz
Size 9.0 MB
Tags Source
SHA-256 checksum
How to use checksums
3e68dfb57977dca256d91430e5ffdee5afe8407d4e7ab9200b0b141363f40363
BLAKE2b-256 checksum
How to use checksums
9d2be3c5a4b59a20393e5395adf0de7057e1a4fa8cfa1d4f29b817feff721ac4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / rewerse-1.4.0-py3-none-any.whl

Download URL rewerse-1.4.0-py3-none-any.whl
Size 9.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
79b3c8fd23be7305341431d97bb999d7af3d25f7e8b9455e5a673c5d153b0142
BLAKE2b-256 checksum
How to use checksums
d85e1c9302d7bd98d403144a4725dd21644a0f62fe8c5399676cc765a438d4c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 release files

1.3.0

2 release files

1.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page