Install
openclaw skills install ride-insights-testBuild a local SQLite ride-history database from Gmail ride receipt emails using gog for fetch and OpenClaw Gateway /v1/responses for extraction. Use when you want a portable Gateway-based pipeline that fetches taxi receipts into emails.json, iterates through each email with the Gateway-backed LLM, writes rides.json, and inserts the results into SQLite.
openclaw skills install ride-insights-testBuild a ride-receipt pipeline that fetches Gmail receipts into one emails.json file, sends each email to the local OpenClaw Gateway /v1/responses endpoint for structured extraction, writes one rides.json array, and inserts the result into SQLite.
gog CLI authenticated for the target Gmail account.gog auth list before fetching, even if the user already named an account.Which account should I use: (A) name1@example.com or (B) name2@example.com? Do not summarize as "default" or make the user infer which accounts exist.default exists.OPENCLAW_GATEWAY_TOKEN or ~/.openclaw/openclaw.json.emails.json stores fetched receipt emails locally and may include full HTML receipt content.Primary artifacts:
data/gateway-llm/emails.json — fetched receipt emails in one JSON array; may include full HTML receipt contentdata/gateway-llm/rides.json — extracted ride records in one JSON arraydata/gateway-llm/rides.sqlite — queryable SQLite database containing normalized ride fields plus extracted_ride_json, but not raw source email JSONRun each step in order. Stop and report on failure.
PRAGMA table_info(rides) or read references/schema_rides.sql.provider, email_date_text, currency, amount, pickup_city, and dropoff_city.python3 skills/ride-receipts-gateway-llm/scripts/init_db.py \
--db ./data/gateway-llm/rides.sqlite \
--schema skills/ride-receipts-gateway-llm/references/schema_rides.sql
emails.jsonpython3 skills/ride-receipts-gateway-llm/scripts/fetch_emails_json.py \
--account <gmail-account> \
--after YYYY-MM-DD \
--before YYYY-MM-DD \
--max-per-provider 5000 \
--out ./data/gateway-llm/emails.json
Notes:
--after / --before when not needed.references/provider_queries.json./v1/responses into rides.jsonOPENCLAW_GATEWAY_URL=http://127.0.0.1:18789 \
OPENCLAW_GATEWAY_TOKEN=... \
python3 skills/ride-receipts-gateway-llm/scripts/extract_rides_gateway.py \
--emails-json ./data/gateway-llm/emails.json \
--out ./data/gateway-llm/rides.json
Notes:
/v1/responses endpoint.OPENCLAW_ALLOW_NONLOCAL_GATEWAY=1 when the user explicitly trusts that target.rides.json after each successful extraction, so progress is checkpointed.rides.json already exists, it skips emails whose gmail_message_id is already present there.--delay-ms <n>.rides.json into SQLitepython3 skills/ride-receipts-gateway-llm/scripts/insert_rides_json_sqlite.py \
--db ./data/gateway-llm/rides.sqlite \
--rides-json ./data/gateway-llm/rides.json
python3 skills/ride-receipts-gateway-llm/scripts/summary_rides_sqlite.py \
--db ./data/gateway-llm/rides.sqlite
Notes:
rides table schema first.Do this as an agent action, not a dedicated insights script.
Recommended workflow:
data/gateway-llm/rides.json when available because it preserves the extracted ride objects directly.data/gateway-llm/rides.sqlite for a few basic totals if helpful, but do not turn the output into a raw SQL dump.Notes:
Use the bundled Python exporter when the user asks for an anonymized/shareable ride report.
python3 skills/ride-receipts-gateway-llm/scripts/export_anonymized_rides_csv.py \
--db ./data/gateway-llm/rides.sqlite \
--out ./data/gateway-llm/anonymized_rides.csv
Export rules:
provider, email_month, start_time_15m, end_time_15m, currency, amount, distance_km, duration_min, pickup_city, pickup_country, dropoff_city, dropoff_country.email_date_text to month-only format like 2025-05.start_time_text and end_time_text upward to the next 15-minute bucket. Exact quarter-hours stay unchanged.distance_km and duration_min when available by reading them from extracted_ride_json; leave blank when unavailable..csv file in the workspace; do not paste inline CSV text into chat.data/gateway-llm/anonymized_rides.csv.MEDIA:./data/gateway-llm/anonymized_rides.csv.Done — I regenerated the anonymized CSV and attached the updated file. followed by the MEDIA: line.null when unknown.skills/ride-receipts-gateway-llm/references/schema_rides.sqlskills/ride-receipts-gateway-llm/references/provider_queries.json