CodaParser is a modern C# .NET library for parsing Belgian CODA banking files. It is a fork of supervos/coda-parser by Christophe Devos, bringing enhanced functionality and updated dependencies to the .NET ecosystem.
- .NET Standard 2.0: Compatible with both .NET Framework and .NET Core.
- Modern C# Features: Utilizes the latest C# language enhancements for improved performance and readability.
- Updated Dependencies: Leveraging the latest NuGet packages for better stability and security.
- Easy Integration: Simple API for parsing CODA files.
- Extensible: Easily extendable to support additional features or custom processing.
- Reliable: Based on the well-established supervos/coda-parser project, ensuring accuracy and reliability.
CodaParser will be available as a NuGet package soon. In the meantime, you can download the source code and build it yourself.
Install-Package CodaParser
If you prefer to build the library yourself, follow these steps:
-
Clone the Repository
git clone https://github.com/phmatray/coda-parser.git cd CodaParser
-
Restore Dependencies
Ensure you have the .NET SDK installed. Then run:
dotnet restore
-
Build the Project
dotnet build
-
Use the Library
Reference the built DLLs in your project.
Using CodaParser is straightforward. Below is a simple example demonstrating how to parse a CODA file and iterate through the statements and transactions.
using CodaParser;
using System.Collections.Generic;
// Instantiate the parser (assuming a concrete implementation is available)
IParser<Statement> parser = new Parser();
// Parse the CODA file
IEnumerable<Statement> statements = parser.ParseFile("path/to/coda-file.cod");
// Iterate through the statements and transactions
foreach (var statement in statements)
{
Console.WriteLine($"Date: {statement.Date:yyyy-MM-dd}");
foreach (var transaction in statement.Transactions)
{
Console.WriteLine($"{transaction.Account.Name}: {transaction.Amount}");
}
Console.WriteLine($"New Balance: {statement.NewBalance}");
Console.WriteLine(new string('-', 40));
}
Provides methods to parse CODA files into structured statements.
- Methods
IEnumerable<Statement> Parse(IEnumerable<string> codaLines)
: Parses a collection of CODA lines.IEnumerable<Statement> ParseFile(string codaFile)
: Parses a CODA file from the specified path.
Represents a single banking statement extracted from a CODA file.
- Properties
Date
: The execution date of the statement.Account
: The changed account.InitialBalance
: The initial balance of the account.NewBalance
: The new balance of the account.InformationalMessage
: An informational message.Transactions
: The executed transactions.
For a complete API reference, please refer to the documentation.
Contributions are welcome! We follow the Conventional Commits guidelines to ensure a consistent commit history.
-
Fork the Repository
-
Create a Feature Branch
git checkout -b feature/YourFeature
-
Commit Your Changes
Use conventional commit messages. For example:
feat(parser): add support for new transaction types
-
Push to the Branch
git push origin feature/YourFeature
-
Open a Pull Request
Please ensure your code follows the project's coding standards and includes appropriate tests.
This project is licensed under the GNU GENERAL PUBLIC LICENSE Version 2.
- Forked from supervos/coda-parser by Christophe Devos.
- Inspired by the wimverstuyf/php-coda-parser project.
- Thanks to the open-source community for their invaluable contributions and support.
Happy Parsing!