
About
a Mist API-token audit report generator.
It uses a local mistrs helper module for credentials, headers, HTTP GET/pagination, and CSV output. Flow:
Loads Mist credentials (get_credentials); resolves the org ID from the credentials file or by interactive prompt with confirmation. Builds an APIConfig dataclass (base URL, auth headers, org ID, page limit 200, output dir ~/created_files). Fetches the org name (for the filename) and a site array (id/name/country code) — the site lookup helpers are present but not actually used in the report. Pulls all org API tokens from orgs/{org_id}/apitokens with pagination and a progress indicator. Flattens each token to name, created time, created_by, key, last_used, and the first privilege's scope/role (format_data). Writes <OrgName>API_Key_Report<YYYY-MM-DD>.csv to ~/created_files.
Handles Ctrl-C cleanly. Defines an unused APIError exception and unused get_config config field, so it looks like a trimmed-down copy of a larger script template.