Bancos Brasileiros - Merge Tool
  
🇧🇷 🏦 📋 A tool for generating and updating data in the Bancos Brasileiros repository
📋 About
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.
🔄 Data Sources
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 | 
💻 Technology
- Language: C# (.NET 9.0)
 - Features: PDF data extraction, data merging, output in multiple formats
 
🚀 Getting Started
Prerequisites
- .NET 9.0 SDK or later
 - Your preferred IDE (Visual Studio, VS Code, Rider, etc.)
 
Running Locally
- 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.
🤝 Contributing
We welcome contributions to improve the MergeTool! Here’s how to add a new data source:
Step-by-Step Guide
- 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.csnamedLoad[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.csfile 
 - Add new fields to the 
 - Implement Data Merging:
    
- Create a method in 
Seeder.csnamedMerge[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 
AcquireDatamethod inProgram.cs 
 - Call your new methods in the 
 - Update Output Writers:
    
- Edit the following methods in 
Writer.csto include your new fields:SaveCsvSaveMarkdownSaveSql
 
 - Edit the following methods in 
 - Test Your Changes:
    
- Run the application locally to verify it works correctly
 - Check the generated files in the 
resultdirectory 
 - Submit a Pull Request:
    
- Commit your changes
 - Push to your fork
 - Create a PR with a detailed description of your changes
 
 
Important Notes
- 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
 
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgements
- Thanks to all contributors who have helped improve this tool
 - Thanks to the Brazilian financial institutions for providing the data sources