Skip to content

.NET parser for Belgian CODA banking files

License

Notifications You must be signed in to change notification settings

phmatray/coda-parser

 
 

Repository files navigation

CodaParser

NuGet License .NET

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.

Table of Contents

Features

  • .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.

Installation

CodaParser will be available as a NuGet package soon. In the meantime, you can download the source code and build it yourself.

NuGet Package

Install-Package CodaParser

Building from Source

If you prefer to build the library yourself, follow these steps:

  1. Clone the Repository

    git clone https://github.com/phmatray/coda-parser.git
    cd CodaParser
  2. Restore Dependencies

    Ensure you have the .NET SDK installed. Then run:

    dotnet restore
  3. Build the Project

    dotnet build
  4. Use the Library

    Reference the built DLLs in your project.

Usage

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));
}

API Reference

Parser Class

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.

Statement Class

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.

Contributing

Contributions are welcome! We follow the Conventional Commits guidelines to ensure a consistent commit history.

  1. Fork the Repository

  2. Create a Feature Branch

    git checkout -b feature/YourFeature
  3. Commit Your Changes

    Use conventional commit messages. For example:

    feat(parser): add support for new transaction types
    
  4. Push to the Branch

    git push origin feature/YourFeature
  5. Open a Pull Request

Please ensure your code follows the project's coding standards and includes appropriate tests.

License

This project is licensed under the GNU GENERAL PUBLIC LICENSE Version 2.

Acknowledgements


Happy Parsing!

About

.NET parser for Belgian CODA banking files

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 90.7%
  • C# 9.3%