This is a custom processor for the hints kitten in the kitty terminal emulator which allows you to select text.
Place the hints_selection.py file in the same directory as kitty.conf.
Map a key to launch the hints kitten with this processor. E.g. for using
kitty_mod+d to select words add this to kitty.conf:
map kitty_mod+d kitten hints --type word --multiple --customize-processing hints_selection.py
This is used just like the standard hints kitten. After you have finished choosing the hints, a selection which covers those hints will be set.