Swiftpack.co -  Nef10/SwiftBeanCountWealthsimpleMapper as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
Swift library to convert download Wealthsimple data to the SwiftBeanCount model
.package(url: "https://github.com/Nef10/SwiftBeanCountWealthsimpleMapper.git", from: "v1.1.0")


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 a small library to convert downloaded data from Wealthsimple (via WealthsimpleDownloader) to the Beancount format (via SwiftBeanCountModel).

Beancount meta data

The library relies heavily on meta data in your Beancount file to find accounts and commodities. Please add these to your Beancount file:


Simply add the symbol used on Wealthsimple:

2011-10-18 commodity ACWV
  wealthsimple-symbol: "ACWV"


For account you need to add two meta data entries:

  • First is the account type (wealthsimple-account-type), you can look up the possible values here
  • Second is a key (wealthsimple-key):
    • For holdings and cash assset accounts this is the symbol of the stock, ETF or currency
    • For dividend income accounts this is the symbol as well
    • For the assset account you are going to contribute from, use contribution
    • For the assset account you are going to deposit from, use deposit
    • Use fee on an expense account to track the wealthsimple fees
    • Use non resident withholding tax on an expense account for the tax
    • In case some transaction does not balance, we will look for an expense account with rounding
    • In case you get a refund, add refund to an income account
    • If you want to track contribution room, use contribution-room on an asset and expense account (optional)

Both keys and types can be space separated in case you have multiple Wealthsimple accounts and for example want to combine the fees into one expense account, or you contribute from the same account.

Full Example
2020-07-31 open Assets:Checking:Wealthsimple CAD
  wealthsimple-account-type: "ca_cash"
  wealthsimple-key: "CAD"

2020-07-31 open Assets:Investment:Wealthsimple:TFSA:Parking CAD
  wealthsimple-account-type: "ca_tfsa"
  wealthsimple-key: "CAD"

2020-07-31 open Assets:Investment:Wealthsimple:TFSA:ACWV ACWV
  wealthsimple-account-type: "ca_tfsa"
  wealthsimple-key: "ACWV"

2020-07-31 open Income:Capital:Dividend:ACWV USD
  wealthsimple-account-type: "ca_tfsa"
  wealthsimple-key: "ACWV"

2020-07-31 open Assets:Checking:Bank CAD
  wealthsimple-account-type: "ca_tfsa"
  wealthsimple-key: "contribution"

2020-07-31 open Assets:Investment:OtherComany:TFSA
  wealthsimple-account-type: "ca_tfsa"
  wealthsimple-key: "deposit"

2020-07-31 open Expenses:FinancialInstitutions:Investment:Fees
  wealthsimple-account-type: "ca_tfsa"
  wealthsimple-key: "fee"

2020-07-31 open Expenses:Tax:NRWT
  wealthsimple-account-type: "ca_tfsa"
  wealthsimple-key: "non resident withholding tax"

2020-07-31 open Expenses:Rounding
  wealthsimple-account-type: "ca_tfsa"
  wealthsimple-key: "rounding"

2020-07-31 open Income:FinancialInstitutions
  wealthsimple-account-type: "ca_tfsa"
  wealthsimple-key: "refund"

2020-07-31 open Assets:TFSAContributionRoom TFSA.ROOM
  wealthsimple-account-type: "ca_tfsa"
  wealthsimple-key: "contribution-room"

2020-07-31 open Expenses:TFSAContributionRoom TFSA.ROOM
  wealthsimple-account-type: "ca_tfsa"
  wealthsimple-key: "contribution-room"


Please check out the complete documentation here. You can also have a look at the SwiftBeanCountDownloaderApp 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/SwiftBeanCountWealthsimpleMapper.git", .upToNextMajor(from: "1.0.0")),


Please note that I developed this library for my own needs and there may be bugs. It currently has some limitations:

  • Sell Gains are not calculated
  • If transactions do not balance, it will add a rounding posting. However, due to SwiftBeanCountModel not yet fully supporting Beancount rounding, the amount of this posting will likely be 0 and need to be adjusted manually.

Pull requests to extend the scope or remove limitations are very welcome.


Stars: 0
Last commit: 2 days 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

1.1.0 Reimbursement Type
24 weeks ago

Add support for Reimbursement Transaction Type

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