Raspberry Pi4? Then yes, here’s a guide to update your bootloader:
https://www.raspberrystreet.com/learn/how-to-boot-raspberrypi-from-usb-ssd
For older models(Pi<4), no but kinda: Afaik oder models could only boot from SD-cards. But that only means the bootloader has to be on the SD-card. So you can copy everything but the bootpartition and change the entry in the /etc/fstab to the new root on the SSD.
I have to write python code next week wich generates objects. I’ve never done that in python, so thanks for giving me a good starting point. :)