How to use the fints.utils.split_for_data_groups function in fints

To help you get started, we’ve selected a few fints examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github raphaelm / python-fints / fints / message.py View on Github external
def get_touchdowns(self, msg: FinTSMessage):
        touchdown = {}
        for msgseg in msg.encrypted_segments:
            seg = self._find_segment_for_reference('HIRMS', msgseg)
            if seg:
                parts = split_for_data_groups(seg)[1:]
                for p in parts:
                    psplit = split_for_data_elements(p)
                    if psplit[0] == "3040":
                        td = psplit[3]
                        touchdown[msgseg.type] = fints_unescape(td)
        return touchdown
github raphaelm / python-fints / fints / message.py View on Github external
def get_summary_by_segment(self, name=None):
        if name and name not in ('HIRMS', 'HIRMG'):
            raise ValueError('Unsupported segment for message summary')
        if name:
            names = [name]
        else:
            names = ('HIRMS', 'HIRMG')

        res = {}
        for name in names:
            seg = self._find_segment(name)
            parts = split_for_data_groups(seg)[1:]
            for de in parts:
                de = split_for_data_elements(de)
                res[de[0]] = de[2]
        return res
github raphaelm / python-fints / fints / message.py View on Github external
def _get_segment_max_version(self, name):
        v = 3
        segs = self._find_segments(name)
        for s in segs:
            parts = split_for_data_groups(s)
            segheader = split_for_data_elements(parts[0])
            curver = int(segheader[2])
            if curver > v:
                v = curver
        return v
github raphaelm / python-fints / fints / message.py View on Github external
def _get_segment_index(self, idx, seg):
        seg = split_for_data_groups(seg)
        if len(seg) > idx - 1:
            return seg[idx - 1]
        return None
github raphaelm / python-fints / fints / message.py View on Github external
def get_supported_tan_mechanisms(self):
        segs = self._find_segments('HIRMS')
        tan_methods = []
        for seg in segs:
            deg = split_for_data_groups(seg)
            for de in deg:
                if de[0:4] == '3920':
                    d = split_for_data_elements(de)
                    for i in range(3, len(d)):
                        tan_methods.append(d[i])

        # Get parameters for tan methods
        seg = self._find_segments('HITANS')
        methods = []
        for s in seg:
            spl = split_for_data_elements(s)
            if spl[2] == '1':
                model = TANMethod1
            elif spl[2] == '2':
                model = TANMethod2
            elif spl[2] == '3':