use json instead to parse it and load it with the needed data, heres the structure of one of the wallets:
{'wallet_id': 6614, 'name': 'Wallet-53687177498', 'owner': '', 'scheme': 'bip32', 'witness_type': 'legacy', 'main_network': 'bitcoin', 'main_balance': 0.0, 'main_balance_str': '0.00000000 BTC', 'balances': [], 'default_account_id': 0, 'multisig_n_required': 1, 'cosigner_wallet_ids': [], 'cosigner_public_masters': [], 'sort_keys': True, 'main_key_id': 46202, 'encoding': 'base58', 'keys': [{'address_index': 0, 'encoding': 'base58', 'latest_txid': None, 'public': b"\x0251\xad\xff\xf2?K\x9e-n+\xdbw\xcb\x85\xac\x8f9@\xbb?h\xfe\xd2_\x85\xfb+F\x0e'\xf8", 'purpose': 44, 'parent_id': 0, 'is_private': True, 'id': 46202, 'path': 'm', 'name': 'Wallet-53687177498', 'compressed': True, 'wallet_id': 6614, 'account_id': 0, 'key_type': 'bip32', 'balance': 0, 'depth': 0, 'address': '1JgPHs8z7ThbqFfkwn8B5gR3EvBGDu2amy', 'used': False, 'change': 0, 'cosigner_id': None, 'network_name': 'bitcoin'}, {'address_index': 2147483692, 'encoding': 'base58', 'latest_txid': None, 'public': b'\x03\xedS\xf7\xec\x7f?\xfd\xcb2_\x97\xba\xcaRi&\xabe]\xe1\xf9\xb3T\xc2F\xdfM\t\xbd\xf5\xac\xa1', 'purpose': 44, 'parent_id': 46202, 'is_private': True, 'id': 46203, 'path': "m/44'", 'name': 'purpose 44', 'compressed': True, 'wallet_id': 6614, 'account_id': 0, 'key_type': 'bip32', 'balance': 0, 'depth': 1, 'address': '1Fqnk54VDHYwtgnJZRsGaHrqdpPacwMWeK', 'used': False, 'change': 0, 'cosigner_id': None, 'network_name': 'bitcoin'}, {'address_index': 2147483648, 'encoding': 'base58', 'latest_txid': None, 'public': b'\x03\xeb\xd2\xc5\xa3\xc6B7\xe1\xb1$p\x86c\xdaCwk[3\x08\x94wl/\xbdWq\xc4\xd3\xae\xb3\xf5', 'purpose': 44, 'parent_id': 46203, 'is_private': True, 'id': 46204, 'path': "m/44'/0'", 'name': 'coin type 0', 'compressed': True, 'wallet_id': 6614, 'account_id': 0, 'key_type': 'bip32', 'balance': 0, 'depth': 2, 'address': '1JbpqTVgycRuqYTpZyGrAMH9g1fQyF9hbf', 'used': False, 'change': 0, 'cosigner_id': None, 'network_name': 'bitcoin'}, {'address_index': 2147483648, 'encoding': 'base58', 'latest_txid': None, 'public': b'\x02\xceh\x16\xc4\xa1\x84\xb5\xda\x18\xebF\xa0\x98\xd0\xbd\xf9\xbfX\xf3\x94\x8a\x14\xf5\xb6\xb6!\x102\xbdI\x12\xf0', 'purpose': 44, 'parent_id': 46204, 'is_private': True, 'id': 46205, 'path': "m/44'/0'/0'", 'name': 'account 0', 'compressed': True, 'wallet_id': 6614, 'account_id': 0, 'key_type': 'bip32', 'balance': 0, 'depth': 3, 'address': '15CjKB3tZhw6aL1MvEVapmBE7vZrb2wk2f', 'used': False, 'change': 0, 'cosigner_id': None, 'network_name': 'bitcoin'}, {'address_index': 0, 'encoding': 'base58', 'latest_txid': None, 'public': b'\x03\xcbi\x07\xb9rY\x0c\xeb\xadL\x88M\xe9pN\xeb\xee\xc4\xda\xe0Te\xee\x00\xc3\xce\xae;f\xf1\xdd\xce', 'purpose': 44, 'parent_id': 46205, 'is_private': True, 'id': 46206, 'path': "m/44'/0'/0'/0", 'name': 'change 0', 'compressed': True, 'wallet_id': 6614, 'account_id': 0, 'key_type': 'bip32', 'balance': 0, 'depth': 4, 'address': '12gsN2tQQyQNDjjMG5fWhZZAW4kKRoK45p', 'used': False, 'change': 0, 'cosigner_id': None, 'network_name': 'bitcoin'}, {'address_index': 0, 'encoding': 'base58', 'latest_txid': None, 'public': b'\x03\t&\xdf\xc1\xe7\xce\x03\xbd\xc61i\xd7\xfa\x034hr\x86\xb2\x13\x88L1\x9b\xea\x8b\x82\xb8\xff\xaf\x7f\xf3', 'purpose': 44, 'parent_id': 46206, 'is_private': True, 'id': 46207, 'path': "m/44'/0'/0'/0/0", 'name': 'address index 0', 'compressed': True, 'wallet_id': 6614, 'account_id': 0, 'key_type': 'bip32', 'balance': 0, 'depth': 5, 'address': '17LZeZwn16TsEP43EyWPstbUTjMaWMoaaq', 'used': False, 'change': 0, 'cosigner_id': None, 'network_name': 'bitcoin'}, {'address_index': 1, 'encoding': 'base58', 'latest_txid': None, 'public': b'\x02\x9a\xc2z\xf2,O\xe1\xed\xfeo@\xd6(L\xd3K\x92g\x82\x05\xc1\xf3\x9f\xb5\x1c\xff\xb54M\xef+\xde', 'purpose': 44, 'parent_id': 46206, 'is_private': True, 'id': 46208, 'path': "m/44'/0'/0'/0/1", 'name': 'address index 1', 'compressed': True, 'wallet_id': 6614, 'account_id': 0, 'key_type': 'bip32', 'balance': 0, 'depth': 5, 'address': '1ECGMavGLYrGmQUT1tueVkZ7ayfC8cKmHh', 'used': False, 'change': 0, 'cosigner_id': None, 'network_name': 'bitcoin'}], 'transactions': []}