Scripting random weight when typing

I wish to make font that while typing - the letters are randomly showing in different weights, or alternatively randomly switch between the stylistic sets.
is there a readymade script for making this feature?
if not can you please guide me what can help me achieve it? I have basic knowledge in python.
thanks!

Have you seen this: Features, part 3: advanced contextual alternates | Glyphs ?

1 Like