[FEATURE] Grab taxes and levies from BCB for all banks
#141 opened on Aug 30, 2023
Repository metrics
- Stars
- (14 stars)
- PR merge metrics
- (PR metrics pending)
Description
Is your feature request related to a problem? Please describe. Grab taxes and levies from the BCB page for all banks
Describe the solution you'd like BCB publishes the taxes/levies for each bank based on ISPB at this page:
- Personal: https://www.bcb.gov.br/fis/tarifas/htms/00000000.asp?seg=&frame=1
- Corporate: https://www.bcb.gov.br/fis/tarifas/htms/00000000a.asp?seg=&frame=1
The 00000000 is the ISPB
The a after the ISPB in the corporate URL is how it identifies a corporate instead of a personal.
Call this page for each bank with ISPB and extract the information to a JSON file separated of banks files.
Add data from SFA - Open Finance
Documenation of the file format.
Contributing
Here is a step-by-step on how to add a new source of data to the merge tool:
- Check out MergeTool.
- Open VS, VS Code, Rider, or your favorite IDE / Code Editor for .NET projects.
- Load the project (currently, it is in C# .NET 8.0).
- Add the required URLs to the
Constants.csfile. - Add a new enum item in the
Source.csfile. Please use the source system acronyms whenever possible. - Add a new method in the
Reader.cscalled Load[NewSystemAcronym]. This should do all the heavy job of grabbing the information from the remote source. - Follow the other methods patterns to extract the PDF information from the file if the new source provides a PDF file.
- Implements the data extraction the way you prefer if it is not a PDF file.
- Add the RegExp to the
Patterns.csfile if you need to use RegExp to extract data. - Add the new field(s) to the
Bank.csfile. - In the
Seeder.csfile, implement the method Merge[NewSystemAcronym] to merge the new data with the existing ones. I prefer to filter the data by ISPB and then Document to check for existing data. Rely on the existing list, DO NOT ADD new bank to the list if it is not present with COMPE, ISPB, Document, and Name at least. These are mandatory fields, if you have all this information, and you did not find the bank on the existing list, feel free to add it to the list. (Let me know this in the PR comment). - Call the new methods (Load[NewSystemAcronym]r and Merge[NewSystemAcronym]) in the
AcquireDatamethod inside theProgram.csfile. - On the
Writer.csfile, edit the following methods, mapping the new field(s):SaveCsvSaveMarkdownSaveSql
- Test it 🧪
- Commit and submit a PR 🎉
Testing
- You can run the application locally without submitting any changes to this repository.
- Run how many times you need, it will only generate some files in the output directory inside result directory.