Skip to content

SciTee/orderlens

Repository files navigation

OrderLens

Make your Amazon data export readable.

Amazon lets you download your own data ("Request my data"), but what arrives is a ZIP full of cryptically named CSV files that almost nobody can actually read. OrderLens takes that export — or the simpler "Order reports" CSV from your account — and turns it into clean exports and meaningful statistics about your own buying behaviour: what you spent, when, on what, and how much came back as refunds.

Everything runs offline and locally. No login, no scraping, no cloud. Your purchase history never leaves your machine — which is rather the point when the data is a list of everything you've ever bought.

See it

OrderLens can render a single, self-contained HTML report with interactive charts (spending over time, by category, biggest orders) plus tables of your top items and merchants. A generated example lives at examples/sample-report.html — download it and open it in any browser; it works with no internet connection.

Features

  • ✅ Clean exports as CSV, Excel (XLSX) and JSON
  • ✅ Spending stats: per year, per month, per category, top merchants, top items
  • Returns/refunds detected and netted against spending
  • ✅ A self-contained HTML report with charts
  • ✅ Reads both the GDPR export ZIP and the order-report CSV (auto-detected)
  • ✅ A small, well-documented CLI — no config, no database, no server

How do I get my Amazon data?

You have two options; OrderLens accepts either.

Option A — Order reports (quick):

  1. Go to Amazon → Account → "Download order reports" (amazon.de: Mein Konto → Bestellberichte herunterladen).
  2. Pick a date range and request an "Items" report.
  3. Download the CSV when it's ready.

Option B — Full GDPR export (everything):

  1. Go to Amazon → Account → Privacy → "Request my data" (amazon.de: Meine Daten anfordern) — or visit https://www.amazon.de/gp/privacycentral/dsar/preview.html.
  2. Choose "Your Orders" (or "Request all your data").
  3. Amazon emails you a download link, usually within a day or two. Save the ZIP.

A detailed, screenshot-friendly walk-through is in docs/getting-your-amazon-data.md.

Installation

pip install .

Or, to keep it isolated:

pipx install .

This installs the orderlens command. Python 3.10+ is required.

Usage

# Print a summary table to the terminal
orderlens stats my-orders.csv

# Export to CSV / JSON / Excel — the format is taken from the output extension
orderlens export my-orders.csv -o orders.csv
orderlens export my-orders.csv -o orders.json
orderlens export my-orders.csv -o orders.xlsx

# Render a self-contained HTML report
orderlens report amazon_gdpr_export.zip -o report.html

# Smaller report that loads plotly.js from a CDN instead of inlining it
orderlens report my-orders.csv -o report.html --online

The input can be the GDPR export ZIP or an order-report CSV — OrderLens detects which one it's looking at by content, not by file name.

Example output

OrderLens summary
=================
Orders        : 5
Items         : 9
Returns       : 1
Gross spending: EUR 187.32
Refunds       : EUR 24.90
Net spending  : EUR 162.42

By year
  2023: EUR 73.37
  2024: EUR 113.95

Top categories
  Electronics      EUR 101.97
  Home             EUR 34.95
  Grocery          EUR 25.50

Privacy

OrderLens never makes a network request. It reads the file you point it at, writes the output you ask for, and that's it. Nothing is uploaded, logged or phoned home. The HTML report inlines its own JavaScript so even the report opens without a connection (use --online if you'd rather keep the file small).

FAQ / Troubleshooting

The amounts look wrong / are 0. Your export probably uses column names OrderLens doesn't recognise yet. The normaliser handles German and English headers for both export types — please open an issue with your (anonymised) header row and it can be added.

My refunds aren't subtracted. Refunds are detected from negative amounts or "return/refund/Erstattung/Retoure" wording. If yours look different, open an issue.

The HTML report is several MB. That's plotly.js inlined so the file works offline. Pass --online to load it from a CDN and shrink the file to a few KB.

Does this work without internet? Yes — that's the whole idea.

Contributing

Bug reports and pull requests are welcome — see CONTRIBUTING.md.

License

MIT — see LICENSE.

About

Turn your Amazon data export into readable spending insights — fully local, no scraping.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors