Skip to content

feat: beangulp-yapeal — beangulp importer for Yapeal CSV bank statements - #1

Merged
borgoat merged 1 commit into
sealambda:mainfrom
jensbin:yapeal
Jul 24, 2026
Merged

feat: beangulp-yapeal — beangulp importer for Yapeal CSV bank statements#1
borgoat merged 1 commit into
sealambda:mainfrom
jensbin:yapeal

Conversation

@jensbin

@jensbin jensbin commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

YAPEAL (https://yapeal.ch/) is a Swiss fintech providing payment accounts and debit cards for SMEs. Account statements are available as CSV exports from the Yapeal e-banking app.

This PR adds a standalone beangulp-yapeal package and wires it into quints as quints import yapeal.

packages/beangulp-yapeal/ - new standalone package

  • Importer built on beangulp's csvbase pattern: resolves columns by name, so all 32 columns of the real Yapeal CSV export are transparent.
  • Amount extraction: prefers Gutschrift (CHF) / Belastung (CHF), falls back to Betrag + the DEBIT/CREDIT indicator.
  • Every draft carries the bank's UUID transaction ID as metadata (bank_ref by default). extract() skips already-seen references, so re-imports are idempotent.
  • Optional IBAN filtering: when configured, identify() confirms the IBAN appears somewhere in the file — useful when downloading statements for multiple accounts.
  • payee_rules: an iterable of (regex, account, flag) tuples that complete the counter leg on match; unmatched lines emit with the review flag and a cash-only posting.

quints integration

  • config.YapealImport - config section [import.yapeal] with account, optional iban, currency, and payee rules.
  • importing.run_yapeal() - full pipeline: identify → extract → dedup → legacy matching → receivable matching → staging file.
  • quints import yapeal <statement.csv> - CLI command with --out, --json, and --file options.
  • Example CSV at examples/statements/yapeal.csv.

Quality gate: make check passes (all 183 tests, 2 pre-existing skipped; ruff, basedpyright, import-linter, deptry, vulture clean).

Maybe later looking into using the Yapeal APIs (https://yapeal.ch/en/yapeal-embedded/platform/developers-api/) for automated statement fetching.

@borgoat
borgoat merged commit 3315c74 into sealambda:main Jul 24, 2026
8 checks passed
borgoat added a commit that referenced this pull request Jul 24, 2026
- CI: publish.yaml's matrix never listed beangulp-yapeal, even though
  quints now hard-depends on it at runtime — the next release would ship
  quints with an unresolvable dependency.
- init.py: `quints init --importers yapeal` never opened the yapeal bank
  account in accounts.bean; reproduced end-to-end (`quints check` fails
  with "unknown account" as soon as a drafted statement is booked).
- importing.py: match_receivables() only rewrote the counter-leg account
  when a draft already had two postings. Yapeal's default (no
  rule-matched) draft has only the cash leg, so a receivable match flipped
  it to flag "*" without completing it — an unbalanced transaction that
  beancount rejects on load. Pre-existing latent bug, newly reachable via
  yapeal's caller; fixed to append the elided receivable posting.
- Mechanical drift: stale "supported: ubs, wise, stripe" strings in
  init.py, cli.py help text, and getting-started.md; missing yapeal
  reminder in the AGENTS.md sample-data checklist.

Yapeal-specific issues (the beangulp-yapeal package's own identify()/
extract() logic) are left for the PR author — see PR #1 review comments.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@jensbin
jensbin deleted the yapeal branch July 24, 2026 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants