How thoughtspot/cs_tools works
Project type and purpose
• From the file tree and README, “CS Tools” is an open‑source Python CLI toolkit maintained by ThoughtSpot’s Customer Success Team.
• Its purpose is to give ThoughtSpot administrators a suite of utilities—archiving stale content, extracting metadata and usage data (Syncers), programmatic access, and configuration—for multi‑platform (Dev/QA/Prod) environments.
File structure
• Top‑level package: cs_tools/
• cs_tools/__main__.py – CLI entry point.
• cs_tools/cli/ – Command‑line interface layer (command dispatchers, TUI screens).
• cs_tools/api/ – API client abstractions (transport, retry, workflows for metadata, search, TML, tsload).
• cs_tools/sync/ – “Syncers” subpackages for each data target (BigQuery, CSV, Excel, Falcon, Postgres, etc.). Each implements a common interface.
• cs_tools/updater/ – Self‑upgrade/bootstrap logic.
• cs_tools/programmatic.py – Programmatic (Python‑level) API surface.
• cs_tools/utils, validators, datastructures, settings, errors – shared libraries/helpers.
• Other directories:
• tests/ – pytest suites with fixtures and sample data.
• . github/workflows/ – CI pipelines for linting, testing, doc building, data extraction jobs.
README for additional insights
• Core features: Searchable Liveboards, Archiver, Syncers.
• Installation and development use the “uv” tool for dependency management.
• Emphasis on scheduler‑friendly execution (designed to be run by CI/CD or cron).
Elements
• Clear component labels (e.g., “CLI: cs_tools.cli”, “Syncer Framework”, “API Client”).
• User → CLI → Core → ThoughtSpot API → Syncers → Data Store.
• CLI → Updater → PyPI/GitHub.
• Library layers in another.
• External systems (ThoughtSpot, databases) in a third.