diff --git a/ofxtools/Types.py b/ofxtools/Types.py index a63bad0e..ea6f9d7f 100644 --- a/ofxtools/Types.py +++ b/ofxtools/Types.py @@ -10,7 +10,6 @@ (e.g. ``SubAggregate``) express parent/child relationships between ``Aggregates``. """ - __all__ = [ "OFXTypeWarning", "OFXTypeError", diff --git a/ofxtools/__version__.py b/ofxtools/__version__.py index 5691824c..c2da165e 100644 --- a/ofxtools/__version__.py +++ b/ofxtools/__version__.py @@ -5,6 +5,7 @@ examine the consequences of a failure. In this case a failure kills too many people and kills them too automatically. """ + __title__ = "ofxtools" __description__ = "Library for working with Open Financial Exchange (OFX) data" __url__ = "https://github.com/csingley/ofxtools" diff --git a/ofxtools/models/bank/stmt.py b/ofxtools/models/bank/stmt.py index b3d071dd..cfe88eec 100644 --- a/ofxtools/models/bank/stmt.py +++ b/ofxtools/models/bank/stmt.py @@ -96,7 +96,7 @@ class BANKACCTFROM(Aggregate): bankid = String(9, required=True) branchid = String(22) - acctid = String(22, required=True) + acctid = NagString(22, required=True) accttype = OneOf(*ACCTTYPES, required=True) acctkey = String(22) @@ -106,7 +106,7 @@ class BANKACCTTO(Aggregate): bankid = String(9, required=True) branchid = String(22) - acctid = String(22, required=True) + acctid = NagString(22, required=True) accttype = OneOf(*ACCTTYPES, required=True) acctkey = String(22) @@ -124,14 +124,14 @@ class BANKACCTINFO(Aggregate): class CCACCTFROM(Aggregate): """OFX section 11.3.2""" - acctid = String(22, required=True) + acctid = NagString(22, required=True) acctkey = String(22) class CCACCTTO(Aggregate): """OFX section 11.3.2""" - acctid = String(22, required=True) + acctid = NagString(22, required=True) acctkey = String(22) diff --git a/ofxtools/models/invest/acct.py b/ofxtools/models/invest/acct.py index dfb032ec..10771031 100644 --- a/ofxtools/models/invest/acct.py +++ b/ofxtools/models/invest/acct.py @@ -15,7 +15,7 @@ # Local imports -from ofxtools.Types import Bool, String, OneOf, SubAggregate +from ofxtools.Types import Bool, String, NagString, OneOf, SubAggregate from ofxtools.models.base import Aggregate from ofxtools.models.common import SVCSTATUSES @@ -43,14 +43,14 @@ class INVACCTFROM(Aggregate): """OFX section 13.6.1""" brokerid = String(22, required=True) - acctid = String(22, required=True) + acctid = NagString(22, required=True) class INVACCTTO(Aggregate): """OFX section 13.6.1""" brokerid = String(22, required=True) - acctid = String(22, required=True) + acctid = NagString(22, required=True) class INVACCTINFO(Aggregate): diff --git a/setup.py b/setup.py index 9693270e..98f94ec8 100644 --- a/setup.py +++ b/setup.py @@ -13,6 +13,7 @@ 11. `make clean` 12. Change download_url back to master; commit & push """ + # stdlib imports import os.path from setuptools import setup, find_packages diff --git a/tests/data/br_nubank_cc.ofx b/tests/data/br_nubank_cc.ofx new file mode 100644 index 00000000..0a325841 --- /dev/null +++ b/tests/data/br_nubank_cc.ofx @@ -0,0 +1,95 @@ +OFXHEADER:100 +DATA:OFXSGML +VERSION:102 +SECURITY:NONE +ENCODING:USASCII +CHARSET:1252 +COMPRESSION:NONE +OLDFILEUID:NONE +NEWFILEUID:NONE + + + + +0 +INFO + + +20240402000000[-3:GMT] +POR + + + + + +1001 + +0 +INFO + + + +BRL + +11111111-UUID-UUID-UUID-111111111111 + + + +20240224000000[-3:GMT] +20240326000000[-3:GMT] + +DEBIT +20240323000000[-3:GMT] +-13.00 +11111111-UUID-4747-8883-111111111111 +-memo-message- + + + +DEBIT +20240323000000[-3:GMT] +-162.90 +11111111-UUID-44dc-b153-111111111111 +-memo-message- + + + +DEBIT +20240323000000[-3:GMT] +-33.46 +11111111-UUID-4ec7-a011-111111111111 +-memo-message- + + + +DEBIT +20240322000000[-3:GMT] +-9.02 +11111111-UUID-4ca3-8d84-111111111111 +-memo-message- + + + +DEBIT +20240322000000[-3:GMT] +-103.53 +11111111-UUID-4b37-972f-111111111111 +-memo-message- + + + +DEBIT +20240322000000[-3:GMT] +-959.00 +11111111-UUID-427c-8fc0-111111111111 +-memo-message- + + + +-1280.91 +20240325000000[-3:GMT] + + + + + diff --git a/tests/test_models_profile.py b/tests/test_models_profile.py index e768faf2..8afcd963 100644 --- a/tests/test_models_profile.py +++ b/tests/test_models_profile.py @@ -172,9 +172,9 @@ def msgsetlist(cls): signonmsgsetv1 = SubElement(signonmsgset, "SIGNONMSGSETV1") msgsetcore = SubElement(signonmsgsetv1, "MSGSETCORE") SubElement(msgsetcore, "VER").text = "1" - SubElement( - msgsetcore, "URL" - ).text = "https://ofxs.ameritrade.com/cgi-bin/apps/OFX" + SubElement(msgsetcore, "URL").text = ( + "https://ofxs.ameritrade.com/cgi-bin/apps/OFX" + ) SubElement(msgsetcore, "OFXSEC").text = "NONE" SubElement(msgsetcore, "TRANSPSEC").text = "Y" SubElement(msgsetcore, "SIGNONREALM").text = "AMERITRADE" diff --git a/tests/test_models_signon.py b/tests/test_models_signon.py index 60548d11..602bd106 100644 --- a/tests/test_models_signon.py +++ b/tests/test_models_signon.py @@ -67,9 +67,9 @@ class MfachallengeTestCase(unittest.TestCase, base.TestAggregate): def etree(cls): root = Element("MFACHALLENGE") SubElement(root, "MFAPHRASEID").text = "MFA13" - SubElement( - root, "MFAPHRASELABEL" - ).text = "Please enter the last four digits of your social security number" + SubElement(root, "MFAPHRASELABEL").text = ( + "Please enter the last four digits of your social security number" + ) return root @classproperty diff --git a/tests/test_ofxget.py b/tests/test_ofxget.py index 3931ca89..37d00cd5 100644 --- a/tests/test_ofxget.py +++ b/tests/test_ofxget.py @@ -1388,8 +1388,7 @@ def test_extract_acctinfos(self): # our results are the same as the children of # test_models_signup.AcctinfoTestCase, which was used to construct # self.ofx - class Foo(unittest.TestCase, base.OfxTestCase): - ... + class Foo(unittest.TestCase, base.OfxTestCase): ... tc = Foo()