Skip to content

Yurii201811/bokpilot

Bokpilot

Local-first pre-accounting assistant for Swedish small businesses.

Bokpilot helps freelancers, micro-business owners, bookkeepers, accountants, and immigrant entrepreneurs prepare cleaner bookkeeping material before it reaches an accounting system. It imports receipts, invoices, and bank CSV rows; suggests BAS accounts and VAT treatment; explains the reasoning; requires human review; and exports approved-only JSON, CSV, or SIE-style draft packets.

It is not an autonomous accountant. Bokpilot generates suggestions only and does not provide professional accounting, tax, or legal advice.

Why this exists

Small businesses often lose time before the actual bookkeeping starts: receipts are scattered, bank rows are unclear, VAT rates vary, BAS accounts are unfamiliar, and accountants receive incomplete material. Bokpilot focuses on the pre-accounting step: collect, classify, explain, review, and export.

The first version is deliberately local-first and dependency-light. It does not require Fortnox, Visma, Bokio, paid OCR, or an AI provider to run.

What works in the MVP

  • Import sample receipts, supplier invoices, customer invoices, and bank CSV transactions.
  • Add manual transactions from the UI.
  • Parse basic text documents with fields such as Supplier, Date, Total, VAT, and Description.
  • Parse CSV files with common Swedish or English headers for date, description, amount, and currency.
  • Suggest BAS account mappings and VAT treatment using deterministic rules.
  • Explain each suggestion in plain language.
  • Show confidence, risk flags, and draft double-entry journal lines.
  • Let a human approve, reject, keep open, or override BAS/VAT treatment.
  • Export approved human-reviewed items only as JSON, CSV, or a basic SIE-style draft.
  • Store data locally in data/workspace.json by default.
  • Run tests without external services.

Quick start

Requires Python 3.10 or newer.

python3 -m bokpilot --host 127.0.0.1 --port 8765

Open http://127.0.0.1:8765, then:

  1. Select Load samples.
  2. Open a review item.
  3. Inspect the BAS/VAT reasoning and journal lines.
  4. Approve one or more items.
  5. Generate JSON, CSV, or SIE-style export output.

Use a separate local workspace file:

BOKPILOT_DATA_PATH=/tmp/bokpilot-workspace.json python3 -m bokpilot --port 8765

Run tests:

python3 -m unittest

Optional editable install:

python3 -m pip install -e .
bokpilot --port 8765

Demo flow

The sample dataset includes:

  • Fortnox subscription May -> software expense, BAS 5420, 25% input VAT.
  • Pressbyran kontorsmaterial -> office supplies, BAS 6110, 25% input VAT.
  • Customer invoice 2026-104 paid -> Swedish sales, BAS 3011, output VAT 2611.
  • Bankavgift foretagskonto -> bank fees, BAS 6570, no VAT.
  • SJ train ticket client meeting -> travel, BAS 5800, 6% VAT, review flag.
  • Lunch with client Stockholm -> meals/representation, review flag.
  • IKEA desk lamp workspace -> small equipment, review flag.
  • Circle K fuel client visit -> vehicle fuel, review flag.

Example input files live in samples. Illustrative export snapshots live in examples/exports.

Screenshots

Desktop review and export flow:

Bokpilot desktop dashboard

Mobile responsive view:

Bokpilot mobile view

Project structure

bokpilot/             Python backend, parsers, rules, data store, exporters
static/               Code-native web UI
samples/              Swedish demo receipt, invoice, and bank CSV inputs
examples/exports/     Example export snapshots
tests/                Standard-library unit tests
docs/                 Product brief, architecture, data model, workflows

Documentation

Safety principles

  • Suggestions are drafts until a person approves them.
  • Exports include approved items only.
  • Risky areas such as representation, vehicle costs, cross-border VAT, reverse charge, assets, owner deposits, refunds, and tax filings need human review.
  • Bokpilot does not file VAT returns, post vouchers to live systems, move money, send client messages, or delete source documents.
  • The local-first default avoids unnecessary upload of sensitive receipts and invoices.

Roadmap

  • Better receipt and invoice extraction for common Swedish formats.
  • First-class BAS 2026 import from machine-readable account files.
  • Configurable company profile, fiscal years, voucher series, and accounting method.
  • Attach original PDFs/images to review packets.
  • Optional OCR and optional AI explanation provider with deterministic fallback.
  • Validated SIE 4 export and SIE 5 exploration.
  • Fortnox, Visma, Bokio, ERPNext, and Frappe Books compatibility adapters.
  • Accountant review mode with comments, change history, and monthly close packets.

Contributing

See CONTRIBUTING.md. Good first contributions include parser fixtures, Swedish bookkeeping examples, BAS account rule improvements, accessibility fixes, and export validation.

License

MIT. See LICENSE.

About

Local-first pre-accounting assistant for Swedish small businesses with human-reviewed BAS/VAT suggestions.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors