<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: MinchinWeb</title>
    <description>The latest articles on DEV Community by MinchinWeb (@minchinweb).</description>
    <link>https://dev.to/minchinweb</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F495959%2F8adc0074-3bfa-4aaa-a84b-0ec57e08e308.jpeg</url>
      <title>DEV Community: MinchinWeb</title>
      <link>https://dev.to/minchinweb</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/minchinweb"/>
    <language>en</language>
    <item>
      <title>receipt2bean: turning my partner's receipt photos into Beancount with a local vision model</title>
      <dc:creator>MinchinWeb</dc:creator>
      <pubDate>Mon, 05 Oct 2026 06:09:48 +0000</pubDate>
      <link>https://dev.to/minchinweb/receipt2bean-turning-my-partners-receipt-photos-into-beancount-with-a-local-vision-model-47p4</link>
      <guid>https://dev.to/minchinweb/receipt2bean-turning-my-partners-receipt-photos-into-beancount-with-a-local-vision-model-47p4</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-weekend-2026-10-01"&gt;Hacktoberfest Weekend Challenge: Build for a Friend&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;My business partner keeps the receipt for everything she spends for the business. She photographs them on her phone, and at the end of the year I have to sit down and type them into my books by hand. I keep the books in &lt;a href="https://beancount.github.io/" rel="noopener noreferrer"&gt;Beancount&lt;/a&gt;, a plain-text accounting system. She has been clear that she will not learn plain-text accounting.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;receipt2bean&lt;/strong&gt;. She sends me the photos. A script reads each photo with a local vision model and writes a ready-to-review Beancount transaction, with the GST split out. I check the entries; she never has to see Beancount.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;Here is a screen recording of the project in action locally:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa7fh76q5x3pj7nd4pncm.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa7fh76q5x3pj7nd4pncm.gif" alt="receipt2bean demo" width="600" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sample output. GST doesn't match 5% of the total due to a tip.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2026-10-03 ! "CORNER CAFE" ""
  receipt: "03_corner_cafe_tip_photo.jpg"
  receipt-sha: "73f3864916bb"
  scanned-by: "qwen3-vl:8b"
  Expenses:Meals                                 20.50 CAD
  Assets:GST-Receivable                           0.93 CAD
  Liabilities:CreditCard                        -21.43 CAD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/minchinweb" rel="noopener noreferrer"&gt;
        minchinweb
      &lt;/a&gt; / &lt;a href="https://github.com/minchinweb/hacktoberfest-2026-0" rel="noopener noreferrer"&gt;
        hacktoberfest-2026-0
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Weekend Challenge: Build for a Friend
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;receipt2bean&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;Photograph a receipt, get a &lt;a href="https://beancount.github.io/" rel="nofollow noopener noreferrer"&gt;Beancount&lt;/a&gt;
transaction.&lt;/p&gt;
&lt;p&gt;Built for the Hacktoberfest 2026 Weekend Challenge ("Build for a Friend") for
my business partner, who photographs receipts but doesn't want to learn
plain-text accounting. A local open-weight vision model reads each photo. Plain
Python then checks the arithmetic and writes the entry. &lt;strong&gt;Nothing leaves your
machine.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;State&lt;/strong&gt;: Proof of concept; works with provided sample datea. Much more
customization is likely needed, and I'd like to eventually have a decent test
suite too.&lt;/p&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;receipt photo --&amp;gt; open-weight vision model (Ollama) --&amp;gt; JSON
              --&amp;gt; Python: validate totals + GST, map accounts
              --&amp;gt; staging.bean  (pending "!" entries, reviewed before they join the ledger)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Design choices&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The model reads, code checks.&lt;/strong&gt; The model returns JSON constrained to a
schema. Then Python verifies &lt;code&gt;subtotal + GST = total&lt;/code&gt;, that line items add
up, that GST is plausible (about 5%), and that the date is…&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/minchinweb/hacktoberfest-2026-0" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;The model is Qwen3-VL 8B, an open-weight vision-language model running locally through &lt;a href="https://ollama.com" rel="noopener noreferrer"&gt;Ollama&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The pipeline has four steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Read.&lt;/strong&gt; The photo goes to the model with a JSON schema (merchant, date, line items, subtotal, GST, total, payment method). Ollama's structured output keeps the reply in that shape.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check.&lt;/strong&gt; The model reads; plain Python checks. It verifies that subtotal + GST = total, that the line items add up, that the GST is plausible for a 5% tax, and that the date makes sense. If something is off, the entry gets a &lt;code&gt;; REVIEW:&lt;/code&gt; comment instead of a silent "fix".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Categorize.&lt;/strong&gt; A small &lt;code&gt;rules.toml&lt;/code&gt; maps merchant names to my accounts. I deliberately don't let the model invent accounts in my ledger.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stage.&lt;/strong&gt; Entries are written as pending (&lt;code&gt;!&lt;/code&gt;) to a staging file. Each photo's hash is stored, so running the script twice never duplicates anything. The expense posting is computed as total minus GST, so every entry balances.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I tested it on 1 real receipt and 3 synthetic receipts (hard to share real data without giving up the privacy that this whole project is about...). &lt;strong&gt;Results:&lt;/strong&gt; Two were fully correct; two failed due to OCR issues: the real one, from Staples with four individual "sub-invoices" and the "Maple Print" synthetic one that inherited the format (and I ran out of time to fix them).&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;p&gt;Receipts are a surprisingly complete record of someone's life: where we shop, what we buy, when we're away, what we pay. For something like that, I didn't want a cloud API in the middle if it can be helped.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Privacy.&lt;/strong&gt; Every photo is processed on my own computer. Nothing is uploaded, and the model sees receipts only while it's reading them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No per-receipt cost or account.&lt;/strong&gt; A year of receipts is hundreds of photos. Running a model locally means no meter running and no API keys for my business partner to worry about.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I can see and control the pipeline.&lt;/strong&gt; Because the model is swappable (&lt;code&gt;--model&lt;/code&gt;), I can try a different open-weight one without rewriting anything; hopefully newer, better ones will keep coming out! Because the checks around the model output are ordinary Python, I can test them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Failures are fixable.&lt;/strong&gt; Some of the current receipts failed. I can either fix the code once and every future receipt from that vendor should work, or still input them by hand, which is no worse than what I started with.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A synced phone folder so receipts are scanned as she takes them&lt;/li&gt;
&lt;li&gt;Matching staged entries to my bank-import transactions&lt;/li&gt;
&lt;li&gt;Plugging into my GST tracking so the GST return worksheet builds itself&lt;/li&gt;
&lt;li&gt;Splitting multi-category receipts by line item&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thanks for reading. Next step: see what my business partner thinks of this in the morning!&lt;/p&gt;

&lt;h2&gt;
  
  
  My Agent Session
&lt;/h2&gt;

&lt;p&gt;I'm not sure how to export the full transcript, but these are the three prompts I used to have it built for/with me.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Could we build a receipt scanner that would create beancount transactions?&lt;br&gt;
What open Source [sic] model could we use at the core?&lt;/p&gt;

&lt;p&gt;Let me [sic] friend be my [business partner], who otherwise I have to enter these myself at the end of the year; she doesn't want to deal with beancount.&lt;/p&gt;

&lt;p&gt;Can you create a first pass version of the code, a readme, instructions on how to put together the screen recording, and draft the post about it. Please ask any questions you need addressed to move forward&lt;/p&gt;

&lt;p&gt;Can you generate a sample receipt? You can base it on this if it helps [real sample Staples receipt attached]&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Author's Notes
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;N.B. Yes, this is very heavily written (code and documentation and the first draft of this post) using AI, but I wanted to test how well I could (nearly) one-shot this. It helps that the problem is small and well understood by me. The open question is what happens when it breaks (which it already has...): Can the AI fix it? Can I fix it "manually" if the AI fails? But as an experiment, I say it passes.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>weekendchallenge</category>
      <category>hf26challenge</category>
    </item>
  </channel>
</rss>
