Would you like to use a certain function? I implemented some S2TBX and Raster-Function in Python-Scripts. The implementation can be different. You can find some useful links in this post:
and within the snappy installation directory are some examples available.
Cheers,
Andreas