@gabrielerandelli/minus-tracker 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +134 -0
- package/dist/cli/index.js +863 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/index.cjs +420 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +88 -0
- package/dist/index.d.ts +88 -0
- package/dist/index.js +379 -0
- package/dist/index.js.map +1 -0
- package/package.json +41 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Gabriele Randelli
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# minus-tracker
|
|
2
|
+
|
|
3
|
+
[](./LICENSE)
|
|
4
|
+
|
|
5
|
+
> **Status:** v0.5.1 — published on npm as `@gabrielerandelli/minus-tracker`.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Italiano
|
|
10
|
+
|
|
11
|
+
Strumento open-source TypeScript (libreria + CLI) per il calcolo automatico di
|
|
12
|
+
**plusvalenze e minusvalenze** nel _Regime Dichiarativo_ — abbinamento lotti LIFO/FIFO,
|
|
13
|
+
normalizzazione multi-valuta con tassi BCE storici, parsing del CSV DEGIRO.
|
|
14
|
+
|
|
15
|
+
### Cosa fa
|
|
16
|
+
|
|
17
|
+
- Calcolo plusvalenze/minusvalenze con abbinamento lotti **LIFO e FIFO** (configurabile)
|
|
18
|
+
- **Parser CSV DEGIRO** (estensibile ad altri broker via PR della community)
|
|
19
|
+
- Gestione **multi-valuta** con tassi BCE storici (EUR, USD, GBP, CHF)
|
|
20
|
+
- Terminologia italiana: _plusvalenze_, _minusvalenze_, _Regime Dichiarativo_
|
|
21
|
+
- Suite di test basata su **FAQ Agenzia Entrate** (baseline di correttezza fiscale)
|
|
22
|
+
- Uscita in **italiano** (predefinita) o **inglese** (`--lang en`)
|
|
23
|
+
- Libreria npm + CLI
|
|
24
|
+
|
|
25
|
+
### Utilizzo rapido
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import { DEGIROParser, Calculator } from "@gabrielerandelli/minus-tracker";
|
|
29
|
+
|
|
30
|
+
const transactions = new DEGIROParser().parse(csv);
|
|
31
|
+
const report = new Calculator(transactions).calculateGains("LIFO"); // o "FIFO"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
minus-tracker è **solo calcolo fiscale** — nessuna UI, autenticazione, database o PDF.
|
|
35
|
+
|
|
36
|
+
### CLI
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Calcola plusvalenze/minusvalenze (uscita in italiano, predefinita)
|
|
40
|
+
minus-tracker calc trades.csv
|
|
41
|
+
|
|
42
|
+
# Uscita in inglese
|
|
43
|
+
minus-tracker calc --lang en trades.csv
|
|
44
|
+
|
|
45
|
+
# Imposta la lingua in modo permanente
|
|
46
|
+
minus-tracker config --lang en # oppure: --lang it
|
|
47
|
+
|
|
48
|
+
# Valida il CSV senza calcolare
|
|
49
|
+
minus-tracker validate trades.csv
|
|
50
|
+
|
|
51
|
+
# Controlla/aggiorna i tassi BCE
|
|
52
|
+
minus-tracker rates --check
|
|
53
|
+
minus-tracker rates --update
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Installazione
|
|
57
|
+
|
|
58
|
+
**Prerequisiti:** Node.js ≥ 24 ([nodejs.org](https://nodejs.org))
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npm install @gabrielerandelli/minus-tracker
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Avvertenza
|
|
65
|
+
|
|
66
|
+
minus-tracker è un **ausilio al calcolo, non consulenza fiscale**. I risultati sono
|
|
67
|
+
destinati alla revisione e alla consegna a un commercialista qualificato.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## English
|
|
72
|
+
|
|
73
|
+
Open-source TypeScript library + CLI that automates **Italian capital-gains/loss
|
|
74
|
+
calculation** (_Regime Dichiarativo_) — LIFO/FIFO lot matching, multi-currency
|
|
75
|
+
normalisation (historical ECB rates), and DEGIRO CSV parsing.
|
|
76
|
+
|
|
77
|
+
### What it does
|
|
78
|
+
|
|
79
|
+
- Capital-gains/loss calculation with configurable **LIFO and FIFO** lot matching
|
|
80
|
+
- **DEGIRO CSV parser**, extensible to other brokers via community PRs
|
|
81
|
+
- **Multi-currency** handling with historical ECB rates (EUR, USD, GBP, CHF)
|
|
82
|
+
- Test suite based on **Agenzia Entrate FAQ** as the correctness baseline
|
|
83
|
+
- Output in **Italian** (default) or **English** (`--lang en`)
|
|
84
|
+
- npm library + CLI
|
|
85
|
+
|
|
86
|
+
### Quick start
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
import { DEGIROParser, Calculator } from "@gabrielerandelli/minus-tracker";
|
|
90
|
+
|
|
91
|
+
const transactions = new DEGIROParser().parse(csv);
|
|
92
|
+
const report = new Calculator(transactions).calculateGains("LIFO"); // or "FIFO"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
minus-tracker is **pure tax math** — no UI, auth, database, or PDF.
|
|
96
|
+
|
|
97
|
+
### CLI
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
# Calculate gains/losses (Italian output, default)
|
|
101
|
+
minus-tracker calc trades.csv
|
|
102
|
+
|
|
103
|
+
# English output
|
|
104
|
+
minus-tracker calc --lang en trades.csv
|
|
105
|
+
|
|
106
|
+
# Set language permanently
|
|
107
|
+
minus-tracker config --lang en # or: --lang it
|
|
108
|
+
|
|
109
|
+
# Validate CSV without calculating
|
|
110
|
+
minus-tracker validate trades.csv
|
|
111
|
+
|
|
112
|
+
# Check/update ECB rates
|
|
113
|
+
minus-tracker rates --check
|
|
114
|
+
minus-tracker rates --update
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Installation
|
|
118
|
+
|
|
119
|
+
**Prerequisites:** Node.js ≥ 24 ([nodejs.org](https://nodejs.org))
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
npm install @gabrielerandelli/minus-tracker
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Disclaimer
|
|
126
|
+
|
|
127
|
+
A **calculation aid, not tax advice**. Outputs are intended for review and handoff to a
|
|
128
|
+
qualified commercialista (_Italian tax professional_).
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## License
|
|
133
|
+
|
|
134
|
+
[MIT](./LICENSE) © 2026 Gabriele Randelli
|