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
Create an Importer via one of the new functions on the ImporterFactory, depending on what you want to import.
Set your delegate on the importer.
Call load() on the importer.
Call nextTransaction() to retrive transaction after transactions till it returns nil. It is recommended to allow the user the edit the transactions while doing this, as long as shouldAllowUserToEdit is true.
If the user edits the transaction, and you offer and they accept to save the new mapping, call saveMapped(description:payee:accountName:).
Get balancesToImport() and pricesToImport() from the importer.
Settings
There are settings for the date tolerance when detecting duplicate transactions, as well as for the mapping the user saved in step 5) of importing transactions. Your app can allow the user to view and edit these via the Settings object. Settings are by default stored in UserDefaults but you can bring your own SettingsStorage by setting Settings.storage.
Help
Each Importer provides a help text. You can access all importers via ImporterFactory.allImporters. They each expose an importerName and helpText on the class.
More
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:
SwiftBeanCountImporter
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
Importer
via one of thenew
functions on theImporterFactory
, depending on what you want to import.delegate
on the importer.load()
on the importer.nextTransaction()
to retrive transaction after transactions till it returnsnil
. It is recommended to allow the user the edit the transactions while doing this, as long asshouldAllowUserToEdit
is true.saveMapped(description:payee:accountName:)
.balancesToImport()
andpricesToImport()
from the importer.Settings
There are settings for the date tolerance when detecting duplicate transactions, as well as for the mapping the user saved in step 5) of importing transactions. Your app can allow the user to view and edit these via the
Settings
object. Settings are by default stored inUserDefaults
but you can bring your ownSettingsStorage
by settingSettings.storage
.Help
Each Importer provides a help text. You can access all importers via
ImporterFactory.allImporters
. They each expose animporterName
andhelpText
on the class.More
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
:Note: as per semantic versioning all versions changes < 1.0.0 can be breaking, so please use
.exact
for now