You need to catch the even emitted by blockchain API. Ethereum blockchain or Hyperledger stores state of Blockchain in a state DB. Events technically happen in Ethereum. If events are entries into ledger you can query the ledger any time
if events are those like Javascript programming language(python in your case) then you can query the DB that stores world state or state of the ledger.