🇧🇷 🏦 📋 A tool for generating and updating data in the Bancos Brasileiros repository
The BancosBrasileiros-MergeTool is a utility designed to gather, process, and consolidate Brazilian banking institution data from multiple official sources. This tool ensures that the Bancos Brasileiros repository contains the most up-to-date and accurate information about financial institutions in Brazil.
The tool currently collects and merges data from the following sources:
Source | Description | Data Type |
---|---|---|
Bancos.json | Source of truth - base JSON with trusted data | JSON |
STR | Sistema de Transferência de Reservas | CSV |
SPI/PIX | Sistema de Pagamentos Instantâneos | CSV |
SLC | Serviço de Liquidação Cartões | |
SILOC | Sistema de Liquidação Diferida das Transferências Interbancárias de Ordens de Crédito | |
SITRAF | Sistema de Transferência de Fundos | |
CTC | Central de Transferência de Crédito | |
PCPS | Plataforma Centralizada de Portabilidade de Salário | |
PCR | Plataforma Centralizada de Recebíveis | |
Cheque Legal | Cheque Legal | |
Detecta Flow | Detecta Flow |
- Language: C# (.NET 9.0)
- Features: PDF data extraction, data merging, output in multiple formats
- .NET 9.0 SDK or later
- Your preferred IDE (Visual Studio, VS Code, Rider, etc.)
-
Clone the repository:
git clone https://github.com/guibranco/BancosBrasileiros-MergeTool.git
-
Navigate to the project directory:
cd BancosBrasileiros-MergeTool
-
Build and run the project:
dotnet build dotnet run
Output files will be generated in the result
directory.
We welcome contributions to improve the MergeTool! Here's how to add a new data source:
-
Fork and Clone the repository:
git clone https://github.com/YourUsername/BancosBrasileiros-MergeTool.git
-
Open the project in your preferred IDE.
-
Add Required Information:
- Add URLs to
Constants.cs
- Add a new enum item in
Source.cs
(use system acronyms when possible)
- Add URLs to
-
Implement Data Reader:
- Create a new method in
Reader.cs
namedLoad[NewSystemAcronym]
- For PDF sources, follow the existing patterns for extraction
- For other formats, implement appropriate extraction logic
- If using RegExp, add patterns to
Patterns.cs
- Create a new method in
-
Update Data Model:
- Add new fields to the
Bank.cs
file
- Add new fields to the
-
Implement Data Merging:
- Create a method in
Seeder.cs
namedMerge[NewSystemAcronym]
- Filter data by ISPB and Document to find existing entries
- Only add new banks if they have COMPE, ISPB, Document, and Name (minimum required fields)
- Create a method in
-
Update Program Flow:
- Call your new methods in the
AcquireData
method inProgram.cs
- Call your new methods in the
-
Update Output Writers:
- Edit the following methods in
Writer.cs
to include your new fields:SaveCsv
SaveMarkdown
SaveSql
- Edit the following methods in
-
Test Your Changes:
- Run the application locally to verify it works correctly
- Check the generated files in the
result
directory
-
Submit a Pull Request:
- Commit your changes
- Push to your fork
- Create a PR with a detailed description of your changes
- Testing: You can run the application locally as many times as needed without affecting the repository
- New Banks: If adding new bank entries, please mention this in your PR comment
- Mandatory Fields: Ensure all new bank entries have COMPE, ISPB, Document, and Name at minimum
This project is licensed under the MIT License - see the LICENSE file for details.
- Thanks to all contributors who have helped improve this tool
- Thanks to the Brazilian financial institutions for providing the data sources