Swiftpack.co - Nef10/SwiftBeanCountSheetSync as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Nef10.
Nef10/SwiftBeanCountSheetSync v1.0.4
Library to help Sync shared Expenses between a Google Sheet and a Beancount file
⭐️ 1
🕓 46 weeks ago
macOS
.package(url: "https://github.com/Nef10/SwiftBeanCountSheetSync.git", from: "v1.0.4")

SwiftBeanCountSheetSync

CI Status Documentation percentage License: MIT Latest version platforms supported: macOS SPM compatible

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

What

This library synchronizes transactions from Beancount files to a Google Sheets with shared transactions. This is helpful when you share expenses with another person who does not use beancount.

How to use

  1. Create an instance of Uploader or Downloader depending on which way you want to sync, providing the HTTP URL of the Sheet as well as the file URL of the beancount file.
  2. Authenticate the user to Google via GoogleAuthentication.
  3. Call start on the instance you created in step 1, passing in the authentication instance from step 2.
  4. Your completion handler will get a SyncResult if the sync was successful. This will include:
    • the transactions which need to be added (to the sheet for upload or the ledger for download)
    • parsing errors occured while reading the sheet
    • configuration which was used for syncing

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

Beancount meta data

The synchronization relies on meta data in your beancount file for configuration. Please add these to your beancount file.

General configuration

  • commoditySymbol: The synchronization only works with one commodity which needs to be specified here
  • account: Account which is used to keep track of the balance between the people
  • tag: Tag which is appended to all transactions which are or should be synchronized
  • name: Your name - this will be used to identify the colunms of the sheet
  • dateTolerance Tolerance in days which will be used when checking if a transactions already exists

These options are specified globally via customs like this (the date does not matter and will be ignored):

YYYY-MM-DD custom "sheet-sync-settings" "commoditySymbol" "CAD"

Account configuration

You can attatch sheet-sync-category metadata to accounts to map categories from the sheet to accounts and vice-versa in a 1-1 relationship. This is optional, in case no mapping could be found a fallback account / an empty category will be used.

Example:

2020-12-26 open Expenses:Communication:Internet
  sheet-sync-category: "Internet"

Usage

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

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

GitHub

link
Stars: 1
Last commit: 36 minutes ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

1.0.4 Swift 5.5
46 weeks ago

Changes

🚀 Features

  • Update for Swift 5.5 @Nef10 (#44)

🧰 Maintenance

  • Bump tibdex/github-app-token from 1.4.0 to 1.5.0 @Nef10 (#48)
  • Bump marocchino/sticky-pull-request-comment from 2.1.1 to 2.2.0 @dependabot (#47)
  • Remove automerge workflow @Nef10 @file-sync-app (#45)
  • Fix Package.resolved @Nef10 (#43)
  • Adjust release drafter template @Nef10 @file-sync-app (#42)
  • Save coverage info even if coverage threshold is not met @Nef10 @file-sync-app (#41)
  • Bump actions/github-script from 4.1.0 to 5.0.0 @Nef10 @file-sync-app (#40)
  • Update SwiftLint config for 0.44.0 @Nef10 @file-sync-app (#38)
  • Bump fwal/setup-swift from 1.7.0 to 1.8.0 @Nef10 @file-sync-app (#37)
  • Improve label sync @Nef10 @file-sync-app (#36)
  • Add release drafter labels to label sync @Nef10 @file-sync-app (#35)
  • Automatically sync labels @Nef10 @file-sync-app (#34)
  • Update SwiftLint config for 0.43.1 @Nef10 @file-sync-app (#33)
  • Add more labels to release drafter @Nef10 @file-sync-app (#32)
  • Pin actions version @Nef10 @file-sync-app (#31)
  • Update GitHub Action dependencies @Nef10 @file-sync-app (#30)
  • Add Automerge action @Nef10 @file-sync-app (#29)
  • Allow to exclude linux ci builds @Nef10 @file-sync-app (#26)
  • Create macos_only @Nef10 (#28)
  • Create minimum_coverage.txt @Nef10 (#27)
  • Remove explicit version number from Readme @Nef10 (#23)
  • Fix running documentation generation @Nef10 (#22)
  • Bump actions/github-script from 4.0.2 to 4.1.0 @dependabot (#20)
  • Bump tibdex/github-app-token from 1.3.0 to 1.4.0 @dependabot (#21)
  • Enable dependabot @Nef10 (#19)
  • Bump Kanna from 5.2.6 to 5.2.7 @swift-dependency-updater (#16)
  • Bump Kanna from 5.2.4 to 5.2.5 @swift-dependency-updater (#15)
  • Bump BrightFutures from 8.0.1 to 8.1.0 @swift-dependency-updater (#14)

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