Skip to content

bryceac/QIF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table of Contents

QIF

Version: 0.2

Author: Bryce Campbell

Copyright: 2022

License: See LICENSE

Description: Library that can read and write QIF files.

Notes

This project was created with the aim to be able to allow users to import QIF files into BCheckbook, so that data can be migrated easily.

Version History

0.2

Minor tweaks.

Remove number formatter, thereby allowing library to build and run on Linux.

As a result of this change, QIF files previously created might not be compatible.

To resolve this, make sure all monetary values are represented without localized formatting.

0.1.2

Minor tweaks.

get rid of spaces after final split of transactions, and get unit tests to run.

0.1.1

Minor update

Add support for splits that can be specified explicitly or as percentage values.

0.1
Initial release. March 2022

Limits

At this time, only nonivestment and noninvoice sections are supported.

Usage

To make use of this package, add it to the Package.swift file like this:

dependencies: [
    // Dependencies declare other packages that this package depends on.
    // .package(url: /* package url */, from: "1.0.0"),
    .package(url: "https://github.com/bryceac/QIF", branch: "main")
]

This adds the current state of the package to your project, though using a tagged version is a better idea.

After that, you just need to do something like this to read a QIF file;

import Foundation
import QIF

let DOCUMENTS_DIRECTORY = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!

let TEST_FILE = DOCUMENTS_DIRECTORY.appendingPathComponent("test").appendingPathExtension("qif")

if let qif = try? QIF.load(from: TEST_FILE) {
    for transaction in qif.transactions {
        print(transaction.amount)
    }
}

That will display all the transaction amounts found in the QIF file

Since I only needed single entry components for importing, the transactions property is a set, which is used to make sure there are no duplicates.

Contributing

If you would like to help make this project even better, feel free to create a fork and issue a pull request. All code submitted be licensed under the same as license as this project.

Support

If you have troubles with this library, contact me at the following address:

[email protected]

While I am not too familiar with QIF or even all variants of it, I will try my best to help out, but I have my limits, since information is quite limited.

Other

This library has been tested on macOS 12 with a QIF file generated from Gnu Cash using GnuCashToQIF version 1.7 into a Quicken 2003 compatible QIF file, though QIF files generated from this library might not be compatible with that version of Quicken.

It should work on other platforms without modifications, but I am not ertain of that.

About

library to read and write QIF files using Swift.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages