# Python API: Insights > The Python function generate_insights, which writes the pages of Tabalyst Insights for CSV, JSON, JSONL or Excel files, with its parameters, its confirmation of the second pass and an example. Source: https://docs.tabalyst.com/reference/python-api/insights/ (Tabalyst 0.8.3) `tabalyst.generate_insights()` writes the pages of [Tabalyst Insights](https://docs.tabalyst.com/insights.md) for any number of CSV, JSON, JSONL or Excel files. The command is [`tabalyst insights`](https://docs.tabalyst.com/reference/cli/insights.md). ```python import tabalyst batch = tabalyst.generate_insights(["customers.csv"]) batch = tabalyst.generate_insights(["data/*.csv"], output_dir="insights") ``` ## tabalyst.generate_insights() Plans and writes, for each source, the main page `.insights.html`, its profile `.insights.json` and a page for each column in `.insights/`, with an `executions.json` history in the same folder. ```python tabalyst.generate_insights( input_specs, *, output=None, output_dir=None, separator=None, encoding=None, collections=None, config_path=None, force=False, on_progress=None, from_scan=False, workers=None, all_collections=False, confirmed=False, confirm=None, dedup_report=None, ) ``` The parameters mean what they mean for [`generate_reports()`](https://docs.tabalyst.com/reference/python-api/report.md#tabalystgenerate_reports). Returns the same [batch result](https://docs.tabalyst.com/reference/python-api.md#batch-functions): each success holds the profile as a dictionary in `result`, the profile that `generate_reports(deep=True)` writes. The second pass always runs. When it is costly, nothing is started before it is confirmed, once for the whole batch: `confirmed=True` says it is, `confirm` is called with the estimate otherwise and returns whether to go on, and without either the function raises `ConfirmationRequired` after the sources are scanned. The function never prompts. A configuration that sets `deep.mode` to `off` raises `ConfigurationError`. ```python import tabalyst batch = tabalyst.generate_insights(["big.csv"], confirmed=True) for success in batch.successes: print(success.job.output) ```