parser-de-notas-de-corretagem 0.11.13 โ 0.12.0
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/README.md +55 -18
- package/notes-parser.d.ts +3 -0
- package/notes-parser.js +1 -1
- package/notes-parser.js.map +1 -1
- package/package.json +16 -4
package/README.md
CHANGED
|
@@ -1,12 +1,49 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ๐ฆ Brazilian brokerage notes PDFs parser
|
|
2
|
+
|
|
3
|
+
> Note: This is a JS/TS package. If you want the end-user solution, check the [Leitor de notas de corretagem](https://github.com/planetsLightningArrester/leitor-de-notas-de-corretagem)
|
|
2
4
|
|
|
3
5
|
 [](https://github.com/planetsLightningArrester/parser-de-notas-de-corretagem/actions/workflows/ci.yml) [](https://github.com/planetsLightningArrester/parser-de-notas-de-corretagem/actions/workflows/assets-auto-update.yml)
|
|
4
6
|
|
|
5
|
-
Easing the PITA of making IRPF.
|
|
7
|
+
Easing the PITA of making IRPF.
|
|
6
8
|
|
|
7
|
-
>
|
|
9
|
+
> [!WARNING]
|
|
10
|
+
> โ *Inter* is only supported from v0.8.0 onwards.
|
|
11
|
+
>
|
|
12
|
+
> โ *Nubank* in only supported from v0.12.0 onwards.
|
|
13
|
+
|
|
14
|
+
## ๐ฐ Contents
|
|
15
|
+
|
|
16
|
+
- [๐ฆ Brazilian brokerage notes PDFs parser](#-brazilian-brokerage-notes-pdfs-parser)
|
|
17
|
+
- [๐ฐ Contents](#-contents)
|
|
18
|
+
- [๐ง Support](#-support)
|
|
19
|
+
- [๐ก Example result](#-example-result)
|
|
20
|
+
- [๐ ๏ธ Install](#๏ธ-install)
|
|
21
|
+
- [๐ Usage](#-usage)
|
|
22
|
+
- [๐ Full NodeJS example](#-full-nodejs-example)
|
|
23
|
+
- [๐ Browser](#-browser)
|
|
24
|
+
- [๐จ Add a custom stock](#-add-a-custom-stock)
|
|
25
|
+
- [๐ญ Behavior](#-behavior)
|
|
26
|
+
- [โค๏ธ Contributors](#๏ธ-contributors)
|
|
27
|
+
- [๐๐ป Thanks? You're welcome](#-thanks-youre-welcome)
|
|
28
|
+
- [๐ฆ License](#-license)
|
|
29
|
+
|
|
30
|
+
## ๐ง Support
|
|
31
|
+
|
|
32
|
+
> [!TIP]
|
|
33
|
+
> ๐งช Under test
|
|
34
|
+
> โ
Good support
|
|
35
|
+
|
|
36
|
+
- [x] Rico โ
|
|
37
|
+
- [x] Clear โ
|
|
38
|
+
- [x] Inter โ
|
|
39
|
+
- [ ] Nubank ๐งช
|
|
40
|
+
- [x] Default ๐งช
|
|
41
|
+
- [ ] Sinacor โ
|
|
42
|
+
|
|
43
|
+
> [!TIP]
|
|
44
|
+
> As of 2025, [Nubank provides non-Sinacor versions of brokerage notes by default](https://blog.nubank.com.br/nota-de-corretagem-nubank-nuinvest/). This parser is focused on parsing those non-Sinacor ones (for now).
|
|
8
45
|
|
|
9
|
-
## Example result
|
|
46
|
+
## ๐ก Example result
|
|
10
47
|
|
|
11
48
|
> The `price` and `average` fields already include the fees paid
|
|
12
49
|
|
|
@@ -77,13 +114,13 @@ Easing the PITA of making IRPF. **Inter support only v0.8.0 onwards โ**
|
|
|
77
114
|
]
|
|
78
115
|
```
|
|
79
116
|
|
|
80
|
-
## Install
|
|
117
|
+
## ๐ ๏ธ Install
|
|
81
118
|
|
|
82
119
|
> npm i parser-de-notas-de-corretagem
|
|
83
120
|
|
|
84
|
-
## Usage
|
|
121
|
+
## ๐ Usage
|
|
85
122
|
|
|
86
|
-
### Full NodeJS example
|
|
123
|
+
### ๐ Full NodeJS example
|
|
87
124
|
|
|
88
125
|
```typescript
|
|
89
126
|
import fs from 'fs';
|
|
@@ -146,7 +183,7 @@ async function main() {
|
|
|
146
183
|
main();
|
|
147
184
|
```
|
|
148
185
|
|
|
149
|
-
### Browser
|
|
186
|
+
### ๐ Browser
|
|
150
187
|
|
|
151
188
|
Since only `Uint8Array` is accepted, use the following code to convert a string using the browser
|
|
152
189
|
|
|
@@ -155,7 +192,7 @@ if (typeof fileContent === 'string') fileContent = Uint8Array.from(fileContent,
|
|
|
155
192
|
await assetsParser.parseNote(filePath, fileContent, filePasswords);
|
|
156
193
|
```
|
|
157
194
|
|
|
158
|
-
### Add a custom stock
|
|
195
|
+
### ๐จ Add a custom stock
|
|
159
196
|
|
|
160
197
|
There are many assets out there and some of them (like funds) are kind of hard to keep track. If some asset is not recognized, `parseNote` will throw the error `UnknownAsset`
|
|
161
198
|
|
|
@@ -192,24 +229,24 @@ assets.defineStock('KDIF11', 'FDC KINEAINF FIDC', '26.324.298/0001-89');
|
|
|
192
229
|
assets.defineStock('KDIF11_2', 'FDC KINEAINF FIDC', '26.324.298/0001-89');
|
|
193
230
|
```
|
|
194
231
|
|
|
195
|
-
##
|
|
232
|
+
## ๐ญ Behavior
|
|
196
233
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
234
|
+
- Total values include fees
|
|
235
|
+
- The values can deviate from cents. It's always a good call to double-check if the result is as expected. Check the [๐ฆ License](#-license)
|
|
236
|
+
- Inter broker has only a few tests, so please open [Issues](https://github.com/planetsLightningArrester/parser-de-notas-de-corretagem/issues) if you find something wrong
|
|
237
|
+
- Local auto-update isn't persistent. New releases are done everyday with persistent updates
|
|
238
|
+
- Other brokers may work with the internal PDF architecture is the same as the supported brokers
|
|
202
239
|
|
|
203
|
-
## Contributors
|
|
240
|
+
## โค๏ธ Contributors
|
|
204
241
|
|
|
205
242
|
Thanks to whom sent the notes for the tests โค๏ธ. Personal data is not stored neither used on tests, only the notes' content.
|
|
206
243
|
|
|
207
|
-
## Thanks?
|
|
244
|
+
## ๐๐ป Thanks? You're welcome
|
|
208
245
|
|
|
209
246
|
Consider thanking me: send a "Thanks!" ๐ by [PIX](https://www.bcb.gov.br/en/financialstability/pix_en) ๐
|
|
210
247
|
> a09e5878-2355-45f7-9f36-6df4ccf383cf
|
|
211
248
|
|
|
212
|
-
## License
|
|
249
|
+
## ๐ฆ License
|
|
213
250
|
|
|
214
251
|
As license, this software is provided as is, free of charge, **without any warranty whatsoever**. Its author is not responsible for its usage. Use it by your own risk.
|
|
215
252
|
|
package/notes-parser.d.ts
CHANGED
|
@@ -70,6 +70,9 @@ export declare class WrongPassword extends BaseError {
|
|
|
70
70
|
/** Empty document error */
|
|
71
71
|
export declare class EmptyDocument extends BaseError {
|
|
72
72
|
}
|
|
73
|
+
/** Document that cannot be recognized */
|
|
74
|
+
export declare class UnknownDocumentFormat extends BaseError {
|
|
75
|
+
}
|
|
73
76
|
/** Document without note number error */
|
|
74
77
|
export declare class MissingNoteNumber extends BaseError {
|
|
75
78
|
}
|