{"id":48749370,"url":"https://github.com/skellla/klopit","last_synced_at":"2026-04-26T21:01:15.310Z","repository":{"id":350865792,"uuid":"1208528657","full_name":"SkeLLLa/klopit","owner":"SkeLLLa","description":"Polish PIT-38 tax calculator for foreign brokerage income. Auto-imports Interactive Brokers CSV, fetches NBP exchange rates, applies FIFO cost basis, and fills PIT-38 \u0026 PIT/ZG fields. Runs entirely in your browser - no server, no accounts, no data leaves your device.","archived":false,"fork":false,"pushed_at":"2026-04-18T21:10:01.000Z","size":830,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-18T23:02:54.977Z","etag":null,"topics":["brokers","capital-gains","dividends","kalkulator-podatkowy","pit-38","pit-zg","pit38","pitzg","podatek-gieldowy","polish-tax","shares","stocks","tax","tax-calc","tax-calculator"],"latest_commit_sha":null,"homepage":"https://klopit.co.pl/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SkeLLLa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":"docs/ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-12T12:10:19.000Z","updated_at":"2026-04-18T21:10:02.000Z","dependencies_parsed_at":"2026-04-18T23:01:57.299Z","dependency_job_id":null,"html_url":"https://github.com/SkeLLLa/klopit","commit_stats":null,"previous_names":["skellla/klopit"],"tags_count":31,"template":false,"template_full_name":null,"purl":"pkg:github/SkeLLLa/klopit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SkeLLLa%2Fklopit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SkeLLLa%2Fklopit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SkeLLLa%2Fklopit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SkeLLLa%2Fklopit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SkeLLLa","download_url":"https://codeload.github.com/SkeLLLa/klopit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SkeLLLa%2Fklopit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32312505,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T19:15:34.056Z","status":"ssl_error","status_checked_at":"2026-04-26T19:15:15.467Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["brokers","capital-gains","dividends","kalkulator-podatkowy","pit-38","pit-zg","pit38","pitzg","podatek-gieldowy","polish-tax","shares","stocks","tax","tax-calc","tax-calculator"],"created_at":"2026-04-12T16:22:34.847Z","updated_at":"2026-04-26T21:01:15.301Z","avatar_url":"https://github.com/SkeLLLa.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kloPIT\n\n[![CI](https://github.com/SkeLLLa/klopit/actions/workflows/verify.yml/badge.svg)](https://github.com/SkeLLLa/klopit/actions/workflows/verify.yml)\n[![CodeQL](https://github.com/SkeLLLa/klopit/actions/workflows/codeql.yml/badge.svg)](https://github.com/SkeLLLa/klopit/actions/workflows/codeql.yml)\n[![OSV](https://github.com/SkeLLLa/klopit/actions/workflows/osv.yml/badge.svg)](https://github.com/SkeLLLa/klopit/actions/workflows/osv.yml)\n[![Release](https://github.com/SkeLLLa/klopit/actions/workflows/release.yml/badge.svg)](https://github.com/SkeLLLa/klopit/actions/workflows/release.yml)\n[![Latest release](https://img.shields.io/github/v/release/SkeLLLa/klopit)](https://github.com/SkeLLLa/klopit/releases/latest)\n[![License: AGPL-3.0](https://img.shields.io/github/license/SkeLLLa/klopit)](LICENSE)\n[![SvelteKit](https://img.shields.io/badge/svelte-5-orange)](https://svelte.dev)\n[![inlang status](https://badge.inlang.com/?url=github.com/SkeLLLa/klopit\u0026project=%2Fproject.inlang)](https://fink.inlang.com/github.com/SkeLLLa/klopit?project=%2Fproject.inlang)\n\n**Polish PIT-38 tax calculator for brokerage income** — runs entirely in your browser, no server, no accounts, no data leaves your machine.\n\n\u003e **The only external call the app makes is to the [NBP public API](https://api.nbp.pl/) to fetch PLN exchange rates.** All other processing — CSV parsing, FIFO calculations, tax math, storage — happens locally in your browser.\n\n**Live app: [klopit.co.pl](https://klopit.co.pl)** | Found a mistake in translations? [Fix it on Fink](https://fink.inlang.com/github.com/SkeLLLa/klopit?project=%2Fproject.inlang) (if Fink will fix all their issues :)\n\n\u003e **kloPIT** — from Ukrainian \"клопіт\" and Polish \"kłopot\" (worry, hassle, trouble). Filing taxes is a hassle — this tool handles it for you.\n\n## What It Does\n\nkloPIT automates the most tedious parts of filing **PIT-38** (capital gains \u0026 dividends):\n\n1. **Import** — parse your broker's statement (Interactive Brokers CSV and IBI Capital PDF ship today; more brokers on the roadmap)\n2. **Convert** — fetch NBP exchange rates and convert foreign-currency amounts to PLN automatically; rates are cached locally\n3. **Calculate** — apply the legally-required FIFO method to determine cost basis and compute capital gains\n4. **Report** — fill your PIT-38 fields (Sections C, D, G) and PIT/ZG attachment values automatically; handle prior-year loss carry-forwards and optional 1.5% OPP charity donations\n\n## Key Features\n\n- **Privacy by design** — all processing and storage happen in IndexedDB in your browser; nothing is uploaded anywhere\n- **FIFO cost basis** — mandated by Polish tax law ([art. 24 ust. 10 ustawy o PIT](https://lexlege.pl/ustawa-o-podatku-dochodowym-od-osob-fizycznych/art-24/))\n- **NBP rate lookup** — automatic mid-rate fetch (Table A) for the last business day before each transaction, with local caching\n- **Dividend withholding credit** — correctly offsets foreign withholding tax (e.g. US 15%) against the 19% Polish rate\n- **PIT/ZG attachment** — shows per-country values required alongside PIT-38 for foreign-source income\n- **Multi-session** — manage multiple tax years independently; edit or delete individual rows after import\n- **Offline-capable** — works without an internet connection once rates are cached\n- **Localised UI** — English, Polish, Ukrainian (Paraglide JS compile-time i18n)\n- **Full transparency** — Every PIT-38 number on the tax-form page maps to concrete transactions shown on the [Dashboard](https://klopit.co.pl/dashboard): per-trade proceeds / cost / gain / 19% tax, per-dividend effective withholding / treaty-capped deduction / PL tax-to-pay, and per-year loss-carry-forward breakdown under `poz. 30`.\n- **W-8BEN \u0026 US dividend awareness** — Warns per-dividend when foreign withholding exceeds the Poland–US treaty rate (15%). See the [W-8BEN doc](https://klopit.co.pl/docs/ibkr/w8ben) for how to file or renew the form in IBKR.\n- **Plugin parser architecture, more brokers coming** — Interactive Brokers (CSV), IBI Capital (PDF), and manual entry ship today. The parser API lives in `src/core/parsers/types.ts` (`ParserDefinition`) — more brokers are on the roadmap, and community PRs are welcome.\n\n## Tech Stack\n\n| Layer           | Technology                            |\n| --------------- | ------------------------------------- |\n| Framework       | SvelteKit + Svelte 5 (runes)          |\n| Language        | TypeScript (strict)                   |\n| Build           | Vite 8, adapter-static (SSG)          |\n| Storage         | IndexedDB via Dexie                   |\n| i18n            | Paraglide JS                          |\n| Tests           | Node.js `node:test` + `assert/strict` |\n| Package manager | pnpm                                  |\n\nThe `src/core/` directory is framework-agnostic pure TypeScript — tax logic, parsers, and NBP fetcher have no Svelte dependency and can be used independently.\n\n## Getting Started\n\nThe project uses [mise](https://mise.jdx.dev/) to pin the exact Node.js and pnpm versions declared in [.mise.toml](.mise.toml). Install mise first if you don't have it, then let it set up the runtime:\n\n```bash\nmise install # installs Node 24 + pnpm declared in .mise.toml\n```\n\nThen install dependencies and start developing:\n\n```bash\npnpm install\npnpm dev   # dev server at http://localhost:5173\npnpm test  # run all tests\npnpm build # production build → build/\n```\n\n## Documentation\n\n| Document                                               | Description                                                                                                                            |\n| ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |\n| [docs/HOW-IT-WORKS.md](docs/HOW-IT-WORKS.md)           | End-to-end walkthrough of the import → convert → calculate → report flow, including exact algorithms (FIFO, NBP rates, rounding rules) |\n| [docs/PROJECT-STRUCTURE.md](docs/PROJECT-STRUCTURE.md) | Directory map and feature-to-file reference                                                                                            |\n| [docs/DESIGN-DECISIONS.md](docs/DESIGN-DECISIONS.md)   | Rationale behind key architectural choices (browser-only storage, FIFO, explicit broker selection, rate caching)                       |\n\n## Adding a Broker Parser\n\nThe parser system is plugin-based. Each broker is a separate module implementing the `BrokerParser` interface from `src/core/parsers/types.ts` and registered in `src/core/parsers/registry.ts`. Adding a new broker does not require changing existing code.\n\nSee [docs/PROJECT-STRUCTURE.md](docs/PROJECT-STRUCTURE.md) for the full directory map and [docs/HOW-IT-WORKS.md](docs/HOW-IT-WORKS.md) for algorithm details.\n\n## Contributing\n\nBug reports and pull requests are welcome at [github.com/SkeLLLa/klopit](https://github.com/SkeLLLa/klopit).\n\n- **Found a calculation error?** Open an issue — attach your anonymised CSV or a minimal reproduction and describe the expected vs. actual result\n- **Using a broker not yet supported?** Open an issue with a sample (anonymised) activity statement, or implement the parser and send a PR\n- **Found a mistake in translations?** Fix it directly on [Fink](https://fink.inlang.com/github.com/SkeLLLa/klopit?project=%2Fproject.inlang) — no coding required\n- **Have a feature idea?** Check existing issues first, then open a new one describing the use case\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for full guidelines, legal references for tax logic changes, and notes on AI-assisted contributions.\n\n## License\n\n[AGPL-3.0-only](LICENSE). Additional notices are in\n[THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskellla%2Fklopit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskellla%2Fklopit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskellla%2Fklopit/lists"}