No, i found out the correct module by checking pycoin documentation[1]. Since you mentioned get_balance function, i use that as keyword on search bar[2]. One of the search result lead to module called BlockcypherProvider[3]. Afterwards, i simply try initialize module BlockcypherProvider and then use get_balance function.
[1] https://pycoin.readthedocs.io/en/latest/
[2] https://pycoin.readthedocs.io/en/latest/search.html?q=get_balance&check_keywords=yes&area=default
[3] https://pycoin.readthedocs.io/en/latest/source/pycoin.services.html?highlight=get_balance#pycoin.services.blockcypher.BlockcypherProvider.get_balance
If documentation isn't exist, usually i'd look for example on their GitHub repository or read the source code directly.
import sys
from pycoin.services.blockcypher import BlockcypherProvider
args = sys.argv
filepath = args[1]
bp = BlockcypherProvider()
with open(filepath, 'r') as f:
addresslist = f.readlines()
addresslist = [a.strip('\n') for a in addresslist]
# do something with address list here
print(addresslist)
# retrieve and output balance and tx info of each address listed in provided address.lst
# with a line separator (horizontal line or similar)
#result = bp.get_balance(addresslist)
for details in addresslist:
result = bp.get_balance(details)
print(result)
print('―' * 40) # U+2015, Horizontal Bar, 40 times
At a glance, i didn't see any error. But personally i'd replcae for details in addresslist: with for address in addresslist: for better readability. I don't know much about performance (since i use Python for small/light stuff), but people usually advice to use Python Async feature.