Elastic is just a REST Endpoint so pick your favorite scripting tool, certainly if you are a python dev that is a very popular lang.
You can use the HTTP REST API Directly
Or one of the Language Clients
With respect to Elastic Cloud ... no difference it is just an Endpoint
Get started come back and open a new thread with some questions when you are ready.
Heck you could probably do as simple with cron, bash script, curl and jq