Esempio n. 1
0
    def request_profile(
        self,
        user=None,
        password=None,
        dryrun=False,
        prettyprint=False,
        close_elements=True,
    ):
        """
        Package and send OFX profile requests (PROFRQ).
        """

        dtprofup = datetime.datetime(1990, 1, 1, tzinfo=UTC)
        profrq = PROFRQ(clientrouting="NONE", dtprofup=dtprofup)
        trnuid = self.uuid
        proftrnrq = PROFTRNRQ(trnuid=trnuid, profrq=profrq)
        msgs = PROFMSGSRQV1(proftrnrq)

        user = user or "{:0<32}".format("anonymous")
        password = password or "{:0<32}".format("anonymous")
        signonmsgs = self.signon(user, password)

        ofx = OFX(signonmsgsrqv1=signonmsgs, profmsgsrqv1=msgs)
        return self.download(
            ofx, dryrun=dryrun, prettyprint=prettyprint, close_elements=close_elements
        )
Esempio n. 2
0
    def request_profile(self, user=None, password=None, dryrun=False):
        """
        Package and send OFX profile requests (PROFRQ).
        """
        dtprofup = datetime.date(1990, 1, 1)
        profrq = PROFRQ(clientrouting='NONE', dtprofup=dtprofup)
        trnuid = uuid.uuid4()
        proftrnrq = PROFTRNRQ(trnuid=trnuid, profrq=profrq)
        msgs = PROFMSGSRQV1(proftrnrq)

        user = user or '{:0<32}'.format('anonymous')
        password = password or '{:0<32}'.format('anonymous')
        signonmsgs = self.signon(user, password)

        ofx = OFX(signonmsgsrqv1=signonmsgs, profmsgsrqv1=msgs)
        return self.download(ofx, dryrun=dryrun)
Esempio n. 3
0
    def _request_profile(
        self,
        dtprofup: Optional[datetime.datetime] = None,
        version: Optional[int] = None,
        gen_newfileuid: bool = True,
        prettyprint: Optional[bool] = None,
        close_elements: Optional[bool] = None,
        dryrun: bool = False,
        timeout: Optional[float] = None,
        url: Optional[str] = None,
    ) -> BytesIO:
        """Package and send OFX profile requests (PROFRQ)."""
        logger.info("Creating profile request")

        if dtprofup is None:
            dtprofup = datetime.datetime(1990, 1, 1, tzinfo=UTC)
        profrq = PROFRQ(clientrouting="NONE", dtprofup=dtprofup)
        proftrnrq = PROFTRNRQ(trnuid=self.uuid, profrq=profrq)

        logger.debug(f"Wrapped profile request: {proftrnrq}")

        user = password = AUTH_PLACEHOLDER
        signon = self.signon(password, userid=user)

        ofx = OFX(signonmsgsrqv1=signon, profmsgsrqv1=PROFMSGSRQV1(proftrnrq))

        if gen_newfileuid:
            newfileuid = self.uuid
        else:
            newfileuid = None

        return self.download(
            ofx,
            version=version,
            newfileuid=newfileuid,
            prettyprint=prettyprint,
            close_elements=close_elements,
            dryrun=dryrun,
            timeout=timeout,
            url=url,
        )
Esempio n. 4
0
    def request_profile(
        self,
        version: Optional[int] = None,
        prettyprint: Optional[bool] = None,
        close_elements: Optional[bool] = None,
        dryrun: bool = False,
        verify_ssl: bool = True,
        timeout: Optional[float] = None,
    ) -> BinaryIO:
        """
        Package and send OFX profile requests (PROFRQ).

        ofxget.scan_profile() overrides version/prettyprint/close_elements.
        """
        logger.info("Creating profile request")

        dtprofup = datetime.datetime(1990, 1, 1, tzinfo=UTC)
        profrq = PROFRQ(clientrouting="NONE", dtprofup=dtprofup)
        proftrnrq = PROFTRNRQ(trnuid=self.uuid, profrq=profrq)

        logger.debug(f"Wrapped profile request: {proftrnrq}")

        user = password = AUTH_PLACEHOLDER
        signon = self.signon(password, userid=user)

        ofx = OFX(signonmsgsrqv1=signon, profmsgsrqv1=PROFMSGSRQV1(proftrnrq))

        return self.download(
            ofx,
            version=version,
            prettyprint=prettyprint,
            close_elements=close_elements,
            dryrun=dryrun,
            verify_ssl=verify_ssl,
            timeout=timeout,
        )
Esempio n. 5
0
 def aggregate(cls):
     return PROFMSGSRQV1(profile.ProftrnrqTestCase.aggregate,
                         profile.ProftrnrqTestCase.aggregate)