get_code_sets
Decode StatCan WDS numeric codes (e.g. frequencyCode 6 = Monthly, scalarFactorCode 0 = units). Corresponds to: GET /getCodeSets
Without arguments, returns a summary: small code sets (scalar, frequency, symbol, status, ...) in full, and only entry counts for large ones (uom, survey, subject, classificationType). Request a large set with code_set, and narrow it with search: get_code_sets(code_set="uom", search="percent")
Returns: Dict[str, Any]: {code_set_name: [entries]} for the returned sets, plus "_large_code_sets" {name: entry count} in the summary. Raises: ValueError: If code_set is unknown or the API response is not SUCCESS.
IMPORTANT: In your final response to the user, you MUST cite the source of your data. For code sets, this means specifying which code set table or definition is being used.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| search | No | Case-insensitive text or code to filter entries of code_set (e.g. 'percent', '17'). | |
| code_set | No | One code set to return in full: scalar, frequency, symbol, status, uom, survey, subject, classificationType, securityLevel, terminated, wdsResponseStatus. Omit for a summary (small sets in full, counts for large ones). |