Skip to content

Library to Convert downloaded Compass Card transaction into BeanCount format

License

Notifications You must be signed in to change notification settings

Nef10/SwiftBeanCountCompassCardMapper

Repository files navigation

SwiftBeanCountCompassCardMapper

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

Beancount meta data

The library relies on meta data in your Beancount file to find your accounts. Please add importer-type: "compass-card" and card-number: "XXXXXXXXXXXXXXXXXXXX" to your Compass Card Asset account. To automatically add the expense account, add compass-card-expense: "XXXXXXXXXXXXXXXXXXXX" with the card number to an account - for auto load, use compass-card-load: "XXXXXXXXXXXXXXXXXXXX".

How

  1. Load your ledger, e.g. via SwiftBeanCountParser
  2. Create an instance of SwiftBeanCountCompassCardMapper using the ledger
  3. Dowload the balance and transactions you want to convert via the CompassCardDownloader
  4. Use createBalance and createTransactions on the mapper to convert the downloaded data

Please also check out the complete documentation here.

Usage

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

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

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

Copyright

While my code is licensed under the MIT License, the source repository may include names or other trademarks of CompassCard, TransLink or other entities; potential usage restrictions for these elements still apply and are not touched by the software license. Same applies for the API design. I am in no way affilliated with TransLink other than beeing customer.

About

Library to Convert downloaded Compass Card transaction into BeanCount format

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages