The data is stored in the SQL database.
You can automate this either with the REST API or with Python scripts, the exact way to do this depends on the details.
The REST API is documented in the README of OpenWISP Controller, or as soon as the unified documentation is published, it will be available there.
If you want to use a Python script, you need to be familiar with the Django ORM, you can find the model definitions in the source code of
OpenWISP Controller on Github.
I hope this helps.
Best regards
Federico Capoano