Connection Tool - Programmatically Remove Unused Datasource Connections, and List All Connections
Published 03-25-2025
Drive Link - https://drive.google.com/file/d/1bX1XQy42Au0FT5Ks0Jg98NPfxmx3ocV7/view?usp=sharing
The full code of the tool is shared directly in the article even if this Google Drive is not shared with your Google account, the requirements.txt and the dependency requirements for this project are:
pyyaml
requests
pandas
An example of a config.yaml file is below, replace with the relevant server URL and correct bearer token:
# URL of your Sisense server, include port if needed
server_url: "http://10.185.1.11:30845"
# Generated Bearer token for authentication, do not include the word Bearer, only the token is needed
# Documentation on generation token - https://sisense.dev/guides/restApi/using-rest-api
bearer_token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoiNjdkOTFkNTU3NDM3NWEwMDFjNWY0NWZmIiwiYXBpU2VjcmV0IjoiMmY5MTEzZmEtODE2Ni02ZGVhLTQzOTktMTZmYWVhZGJiYzBiIiwiYWxsb3dlZFRlbmFudHMiOlsiNjdkOTFkNTU3NDM3NWEwMDFjNWY0NjBjIl0sInRlbmFudElkIjoiNjdkOTFkNTU3NDM3NWEwMDFjNWY0NjBjIiwiZXhwIjoxNzQyOTYzMTQzLCJpYXQiOjE3NDIzNTgzNDN9.CGkbTMYRGGSm4us7IC9IUzZH14O46x3YuSuloqMrW5E"
# If true, deletion will only be simulated and logged (no changes made)
dry_run: false
# Path to the CSV file used for input/output
csv_file_path: "connections.csv"
# Path to the log file (Does not need to be read or modified, just a optional record)
log_file_path: "connection_tool.log"