fill_tam_sheet
Fill TAM sheet SME and 250+ cells with Eurostat enterprise counts by NACE, supporting dry-run preview and automatic NACE code resolution.
Instructions
Read NACE codes out of the TAM workbook's "Company Counts by Segment" sheet, pull Eurostat counts for every segment, and write the SMEs (col F) and Corp Mid-cap 250+ (col G) cells.
Only yellow input cells on segment rows are written; blue subtotals, the grey public-sector row, and demand-side rows are left untouched. Class-level NACE codes (which Eurostat lacks) are resolved down to the nearest available group/division and flagged per row under "coarsened".
Args: input_path: path to the .xlsx (e.g. the TAM_Model_with_NAICS.xlsx). output_path: where to save. Defaults to "_FILLED.xlsx". Pass the same path as input ONLY if you intend to overwrite the original. dry_run: if True (default), nothing is written — returns the full plan (per-row resolved codes, levels, and the SME/250+ it WOULD write) so you can audit before committing. Set False to actually save. geo: Eurostat geos, default EU27 + Norway + Switzerland. year: single year, or omit for latest per code. exclude_micro: exclude micro firms (0-9) from the SME bucket.
Returns the plan (dry_run) or a write summary plus the plan.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| geo | No | ||
| year | No | ||
| dry_run | No | ||
| input_path | Yes | ||
| output_path | No | ||
| exclude_micro | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||