ctx = EthLogSubscriber(wss_provider_url, address, event_abi, callback, fromDate=datetime.datetime, dateTolerance=60)
ctx.start()
ctx.stop()
Neither web3.js nor web3.py have a convenient way to get historical logs and
then stay subscribed to async capture new ones. At least web3.js has an
implementation of eth_subscribe; web3.py doesn't even have that.
EthLogSubscriber combines historial lookup and ongoing subscription into a
tidy package that hides thread, async, and ethereum encode/decode details.
The built-in main() offers a example of how to use it. Features: