Some of the Tulip apps that the team at Genie have been creating can get quite complex, with a lot of reuse of connector functions across apps as well as just a large amount of connector functions.
We wanted to find a way to find what connector functions were being used in what apps. We noticed that this data is contained in the app.json of an exported Tulip app, so Moni Priyanka created a quick script to pull this data and association out of the .json and put it into a postgres table for some easy analysis.
Setup
You will need a postgres database and then create two tables. Run this script
Create a DB user that can write to those tables
Create a tulip bot that has access to read app data (Requires the apps:read
API key scope) read more here
Modify the .ini to match your environment from config.ini
[main]header_table_name = tulipappstructure.tulip_info_headerdetail_table_name = tulipappstructure.tulip_info_detailsurl_env = https://instance.tulip.co/api/v3/appGroupshost = rds.amazonaws.comdatabase = adatabasedb_user = adatabaseuserdb_password = adatabasepasswordapi_username = apikeyapi_password = xxxx
Download the python script from here
Find an app on your tulip instance and export it in the same folder as the tulip_app_info.py
Run the python script. (you might have to install some dependencies)
Assuming everything is setup OK you should have an entry in the header table
And the detail table should have lines for each function
It also includes a ‘direct link’ to where in the app the function is being used
Hope you find this script useful!