Provide an API to interface with python scripts

Hello, is it possible to add some kind of API that can call and be called by python scripts? That would provide custom use cases with possibility of running extra hardware, custom test sequences based on external triggers, sending realtime dyno data to external hardware/server etc. Possibilities are endless.