An open API service indexing awesome lists of open source software.

https://github.com/lastunicorn/revolut-toolkit

A set of helpers to interact with files generated by Revolut bank.
https://github.com/lastunicorn/revolut-toolkit

banking csharp revolut transactions

Last synced: 17 days ago
JSON representation

A set of helpers to interact with files generated by Revolut bank.

Awesome Lists containing this project

README

          

# Revolut Bank Toolkit

[![GitHub Repo](https://img.shields.io/badge/github-repo-blue?logo=github)](https://github.com/lastunicorn/revolut-toolkit) [![GitHub Build](https://img.shields.io/github/actions/workflow/status/lastunicorn/revolut-toolkit/build-master.yml?logo=github)](https://github.com/lastunicorn/revolut-toolkit/actions/workflows/build-master.yml) [![NuGet Version](https://img.shields.io/nuget/v/DustInTheWind.Revolut.Toolkit?logo=nuget)](https://www.nuget.org/packages/DustInTheWind.Revolut.Toolkit) [![NuGet Downloads](https://img.shields.io/nuget/dt/DustInTheWind.Revolut.Toolkit?logo=nuget)](https://www.nuget.org/packages/DustInTheWind.Revolut.Toolkit)

A set of helpers to interact with files generated by Revolut bank.

**Revolut Group Holdings Ltd**, known as **Revolut**, is a British global financial technology company headquartered in London and founded in July 2015 by Nik Storonskiy and Vlad Yatsenko:

- https://en.wikipedia.org/wiki/Revolut

## Installation

Package Manager:

```
Install-Package DustInTheWind.Revolut.Toolkit
```

.NET CLI:

```
dotnet add package DustInTheWind.Revolut.Toolkit
```

## Runtime Requirements

- Library target framework: `.NET 8.0` (`net8.0`)

## Quick Start

### Step 1 - Export Statement CSV File

- Go to the Revolut web application (https://app.revolut.com/home).

- Select an account and click the "Statement" button in the top right.
- Choose to export as "Excel". This option is misnamed, it is not really an Excel file. It is an CSV file.
- Choose the start and end month.
- Click "Generate".

The downloaded file should have the following header line:

`Type,Product,Started Date,Completed Date,Description,Amount,Fee,Currency,State,Balance`

### Step 2 - Parse the Exported Document

The `StatementDocument` class provides several methods to parse and load a CSV file, to accommodate different input sources. Here it is one of them:

**From a file path:**

```csharp
StatementDocument document = await StatementDocument.LoadFromFileAsync("statement.csv");

foreach (BankTransaction transaction in document)
{
...
}
```

## `BankTransaction` Properties

| CSV Column | Property | Type | Description |
| ---------------- | --------------- | -------------------- | ------------------------------------------ |
| `Type` | `Type` | `TransactionType` | The type/category of the transaction. |
| `Product` | `Product` | `TransactionProduct` | |
| `Started Date` | `StartedDate` | `DateTime` | |
| `Completed Date` | `CompletedDate` | `DateTime` | |
| `Description` | `Description` | `string` | |
| `Amount` | `Amount` | `decimal` | |
| `Fee` | `Fee` | `decimal` | |
| `Currency` | `Currency` | `Currency` | |
| `State` | `State` | `TransactionState` | |
| `Balance` | `Balance` | `decimal` | The account balance after the transaction. |

## Demo Project

The repository includes a sample CLI project in `sources/Revolut.Toolkit.Demo` that demonstrates:

- reading `statement.csv`
- printing parsed data.

You can use this project as a reference implementation for your own importer/exporter tools.