Swiftpack.co - Package - Nef10/SwiftBeanCountImporter

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.


Library to transform transactions from financial institutions into Beancount files


CI Status Documentation percentage License: MIT Latest version platforms supported: linux | macOS | iOS | watchOS | tvOS SPM compatible

This project is part for SwiftBeanCount, please check out the main documentation here.


This is the importer of SwiftBeanCount. It reads files to create transactions. This library does not include any UI, so consumers need to provide a UI for selecting accounts, settings, as well as editing of transactions.

How to use

Import Transactions

  1. Create a FileImporter via FileImporterManager.new(ledger: Ledger?, url: URL?) or a TextImporter via TextImporterManager.new(ledger: Ledger?, transaction: String, balance: String), depending on what you want to import.
  2. Check possibleAccounts() on the importer. If there is more than one or none, promt to user to enter/select the account to use.
  3. Pass the result to the importer via useAccount(name:).
  4. If using a FileImporter call loadFile().
  5. If using a TextImporter, call parse() to get a string of the parsed transactions. If using a FileImporter, call parseLineIntoTransaction() to retrive transaction after transactions till it returns nil. It is recommended to allow the user the edit the transactions while doing this. (See #2)


The different importers which are included in this library can be configured:

  1. Call ImporterManager.importers to retreive all importers
  2. Call importer.settingsName to get the user friendly name of the importer
  3. Call importer.settings to get the ImporterSettings which an importer offers
  4. Use importer.get(setting: ImporterSetting) and importer.set(setting: ImporterSetting, to value: String) to modify these settings.

Please check out the complete documentation here, or have a look at the SwiftBeanCountImporterApp which uses this library.


The library supports the Swift Package Manger, so simply add a dependency in your Package.swift:

.package(url: "https://github.com/Nef10/SwiftBeanCountImporter.git", .exact("X.Y.Z")),

Note: as per semantic versioning all versions changes < 1.0.0 can be breaking, so please use .exact for now


Stars: 0
Last commit: 5 days ago


0.0.4 Rogers Bank - 2021-02-26T03:07:28

Update importer for new Rogers Bank csv format (again)