Checkout PyCardano. It is able to serialize python objects to datum and redeemers. Maybe this test example can help: https://github.com/cffls/pycardano/blob/main/integration-test/test/test_all.py#L217 It implements all off-chain code of forty-two example in Plutus-pioneer-program.
Update:
I polished the test into a concrete example with more details here: https://github.com/cffls/pycardano/tree/main/examples/plutus/forty_two