
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
rewe-ebon-parser
Advanced tools
Homepage and Documentation: https://www.ekotov.pro/rewe-ebon-parser
PyPI: https://pypi.org/project/rewe-ebon-parser/
Changelog: View Full Changelog
Releases: View Release History on GitHub
The REWE eBon Parser is a Python package designed to parse REWE eBons (receipts) from PDF files and convert them into structured JSON format or CSV. It supports parsing receipts with both the older PAYBACK system and the new REWE Bonus loyalty program. The package also provides functionality to output raw text extracted from the PDFs for debugging purposes. This project is a re-write of the the rewe-ebon-parser TypeScript library, example PDFs are borrowed from the same library.
pdfplumber).You can install the package using pip:
pip install rewe-ebon-parser
You can find PDF receipt files to test on in the examples/eBons folder in this repo borrowed from rewe-ebon-parser.
rewe-ebon-parser [--file] <input_pdf_path> [output_csv_path] [--csv-table]
Example:
rewe-ebon-parser examples/eBons/1.pdf --csv-table
This saves to a csv file in the same folder as the input PDF with the same name but .csv extension, but feel free to specify a different output path for the csv file by addin a path to it after the input PDF path.
rewe-ebon-parser [--folder] <input_folder> [output_folder] [--nthreads <number_of_threads>] [--csv-table]
Example:
rewe-ebon-parser examples/eBons/ --csv-table examples/all-purchases-table.csv
rewe-ebon-parser [--file] <input_pdf_path> [output_json_path]
Example:
rewe-ebon-parser examples/eBons/1.pdf
rewe-ebon-parser [--folder] <input_folder> [output_folder] [--nthreads <number_of_threads>]
Example:
rewe-ebon-parser examples/eBons/
Example (the module automatically detects if its a folder of PDFs or JSONs):
rewe-ebon-parser examples/eBons/ --csv-table
Note: the module will fail if the folder contains both JSON and PDF files to avoid duplicating the same data.
rewe-ebon-parser [--folder] <input_folder> [output_csv_path] [--combine-json] [--nthreads <number_of_threads>]
Example (the module automatically detects if its a folder of PDFs or JSONs):
rewe-ebon-parser examples/eBons/ --csv-table
Note: the module will fail if the folder contains both JSON and PDF files to avoid duplicating the same data.
--file: Explicitly specify if the input and output paths are files.--folder: Explicitly specify if the input and output paths are folders.--nthreads: Number of concurrent threads to use for processing files.--txt-dump: Instead of parsing to JSON, this saves the raw extracted text from the PDF to a .txt file. Useful for debugging or inspection.--preserve-privacy: Anonymizes sensitive information (like addresses, payment details, and personal data) in the output. This works for both JSON and text dump modes.--rawtext-file: Output raw text extracted from the PDF files to .txt files (mostly for debugging).--rawtext-stdout: Print raw text extracted from the PDF files to the console (mostly for debugging).--csv-table: Output parsed data as a CSV table.--version: show module version.-h, --help: show help.When --csv-table is used, each row in the exported CSV contains:
datetime_local: Localized timestamp of the receipt.market: REWE market identifier (store number).marketStreet, marketZip, marketCity: Address of the market from marketAddress in the JSON output.name, subTotal, amount, pricePerUnit, unit, taxCategory: Item-level data from the parsed receipt.loyaltyProgramQualified: Name of the qualifying loyalty program for the item or empty if not qualified.If neither --file nor --folder is specified, the script will automatically detect if the input path is a file or a folder and process accordingly.
output_json_path is not specified for a single file, the output will be saved in the same directory as the input file with a .json extension.output_folder is not specified for a folder, a subfolder named rewe_json_out will be created in the input folder, and the output JSON files will be saved there.--rawtext-file with a folder, the output text files will be saved in a rewe_txt_out subfolder.A detailed log of processing results will be saved in the output folder as processing_log.csv, containing information on which files were successfully processed and which failed, along with error messages if any.
from rewe_ebon_parser.parse import parse_pdf_ebon
parse_pdf_ebon("examples/eBons/1.pdf")
from rewe_ebon_parser.parse import parse_ebon
# here the function is once again getting the data from a file,
# but input can come from anywhere
def process_pdf(pdf_path):
with open(pdf_path, 'rb') as f:
data = f.read()
result = parse_ebon(data)
return result
process_pdf("examples/eBons/1.pdf")
Note: Breaking Changes
To support multiple loyalty programs, the JSON output format has been updated. These changes are breaking for users who rely on the old structure.
The parser now uses a generalized loyalty object instead of a hardcoded payback object.
loyalty ObjectThe top-level payback key in the JSON output has been replaced by a loyalty key. This new object contains a program field ("PAYBACK" or "REWE Bonus") and a details field with the program-specific data.
Old PAYBACK Format:
{
"payback": {
"card": "#########9334",
"earnedPoints": 19
}
}
New PAYBACK Format:
{
"loyalty": {
"program": "PAYBACK",
"details": {
"card": "#########9334",
"earnedPoints": 19
}
}
}
New REWE Bonus Format:
{
"loyalty": {
"program": "REWE Bonus",
"details": {
"earnedCredit": 6.28,
"newTotalCredit": 7.26,
"usedCoupons": [
{
"name": "10% auf REWE Bio",
"value": 1.53
}
]
}
}
}
items ObjectWithin each item, the boolean paybackQualified field has been replaced by a string field named loyaltyProgramQualified. This field will contain the name of the loyalty program ("PAYBACK" or "REWE Bonus") if the item qualifies, or it will be null if it does not.
Old Item Format:
{
"name": "SALAMI SPITZENQ.",
"paybackQualified": true
}
New Item Format:
{
"name": "SALAMI SPITZENQ.",
"loyaltyProgramQualified": "PAYBACK"
}
This project is licensed under the MIT License. For details, see the LICENSE file.
For a detailed history of changes, see the CHANGELOG.md file.
While the parser is tested against several receipt formats, REWE occasionally updates the layout of their eBons. A new or unusual layout might cause parsing errors, especially in the loyalty program section.
tomek272 💻 🐛 | brain0100power 🐛 | Felix Jung 💻 |
|
|
FAQs
Parse and convert REWE eBons (digital receipts) to JSON and CSV.
We found that rewe-ebon-parser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.