Swiftpack.co -  Nef10/SwiftBeanCountImporter as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
Nef10/SwiftBeanCountImporter
Library to transform transactions from financial institutions into Beancount files
.package(url: "https://github.com/Nef10/SwiftBeanCountImporter.git", from: "v0.0.4")

SwiftBeanCountImporter

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.

What

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)

Settings

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.

Usage

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

GitHub

link
Stars: 0
Last commit: 2 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Release Notes

0.0.4 Rogers Bank
16 weeks ago

Update importer for new Rogers Bank csv format (again)

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API