stevebrun / swiftofx Goto Github PK
View Code? Open in Web Editor NEWA Swift framework for reading OFX files.
License: MIT License
A Swift framework for reading OFX files.
License: MIT License
Some ofx files do not include FI information (e.g. Barclays Bank). Following code in Finance.swift makes FI parsing optional
/// Information about the entity which provided the OFX file.
public struct Institute: Information {
static let label: String = "FI"
/// The name of the institution.
public var name: String = ""
/// An identifier for this specific institution.
public var id: Identifier = ""
init?(parent element: Element) {
if let element = element[Institute.label] {
name = element["ORG"]?.content ?? ""
id = element["FID"]?.content ?? ""
}
}
}
See: https://developer.apple.com/library/archive/qa/qa1480/_index.html
My fix: (I'm UK based & parsing Barclays Bank ofx files which use the date format 20191217000000[-5:EST]
let formatter = DateFormatter()
formatter.locale = Locale(identifier: "en_US_POSIX")
formatter.timeZone = TimeZone(secondsFromGMT: 0) // not sure if this is required - need to test
let maybeDate = formats.reduce(nil as Date?) { result, format in
When attempting to parse files with a hunded or more transactions significant amounts of memory used & parsing is extremely slow.
I fixed the problem in Element by using a computed property to remove whitespace on set
var _content: String = ""
var content: String {
get {
return _content
}
set (newValue){
_content = newValue.trimmingCharacters(in: .whitespacesAndNewlines)
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.