CSP Data
by arturslunevsco.huggingface.arturslunevs/csplv_mcp_test
- Remote endpoint
- 11 tools
- MIT
Tools
CSPLV_mcp_test_choose_langChoose language depending of in which language question is passed in for CSP data query to be passed in other functions such as get_tables_by_keyword, get_topics, get_topic_content, get_titles, get_query_values, get_csp_data. If question passed in English, use 'en', if in Latvian, use 'lv' for other languages use english 'en'. Run this function first to get the language code and detect language once per question do not call it multiple times. Returns: The chosen language., , >>> choose_lang('en'), 'en', >>> choose_lang('lv'), 'lv'CSPLV_mcp_test_construct_csp_linkCSPLV_mcp_test_filter_by_codeFilter available data (titles) from Official Statistics Portal of Latvia (CSP or Centrālā statistikas pārvalde) by content code or part of the content code for wider results. Returns: The dictionary of the titles available from Official Statistics Portal,, topic code, topic content code, topic sub-content code and report ID., , , ... print(get_query_values(['TIR', 'AT', 'ATD', 'ATD040'])), {'EXP': 'Eksports', 'IMP': 'Imports'}, 'CN4Z': {'TOTAL': 'Visas preces', '0100': 'Trūkstošo datu novērtējums 01. nodaļai',, 'Dzīvi zirgi, ēzeļi, mūļi un zirgēzeļi', '0102': 'Dzīvi liellopi', '0103': 'Dzīvas cūkas', '0104': 'Dzīvas aitas un kazas',..., 'Preces, kurām piemērots militārais noslēpums', '0000': 'Bez atšifrējuma'}, 'COUNTRY': {'TOTAL': 'Pavisam', 'AD': 'Andora', 'AE': 'Apvienotie Arābu Emirāti', ..., 'Bez sadalījuma pa valstīm (tirdzn. ES ietvaros)'}, 'ContentsCode': {'ATD040': 'Vērtība (Eiro)', 'ATD0401': 'Svars, Kg'}, 'TIME': {'2005':, '2025'}}, >>> # Then use this code to filter titles,CSPLV_mcp_test_filter_by_dateFetch published data by dates published from Official Statistics Portal of Latvia (CSP or Centrālā statistikas pārvalde). Returns: The dictionary of the titles available from Official Statistics Portal,, topic code, topic content code, topic sub-content code and report ID., , >>> # First get topic code, ... filter_by_date(date_from='22.10.2025.',, date_to='24.10.2025.',, lang='lv'), ['POP', 'IM', 'IMSV', 'IMV010w'],, ['EMP', 'NB', 'NBLD', 'NBL231'], ..., Then you can use table parameters to retrieve more info about updated tables.CSPLV_mcp_test_get_csp_dataGet statistics from Official Statistics Portal of Latvia (CSP or Centrālā statistikas pārvalde). **IMPORTANT**: Always include hyperlink from function return in your answer to provide source. Returns: List of dicts where first dict always contains 'Source URL' key with, link to the original CSP table., , >>> topics = ['POP', 'IR', 'IRE', 'IRE010'], >>> query_args = get_query_values(topics), >>> print(query_args), {'TOTAL': 'Pavisam', 'E_LAT': 'Latvieši', 'E_ABZ': 'Abāzi', 'E_ABK': 'Abhāzi',..., 'Zviedri', 'OTH': 'Cita tautība', 'UNK_NSP': 'Nezināma, neizvēlēta'}, 'ContentsCode': {'IRE010': 'Skaits'},, {'1935': '1935', ... '2025': '2025'}}, >>> # Then use these codes and values to get data for example Latvians for years 2024 and 2025, >>> data = get_csp_data(, ... lang='en',, ... topic_params=topics,, ... ETHNICITY=['E_LAT'],, ... TIME=['2024', '2025'], ... ), >>> print(result[0]), 'https://data.stat.gov.lv/pxweb/lv/OSP_PUB/START__POP__IR__IRE/IRE010'}, ][0]), ['E_LAT',CSPLV_mcp_test_get_query_valuesGet query code and values for particular report. Returns: A dictionary where each key is a query parameter code and the value is another dictionary mapping possible values to their descriptive texts., , >>> # First get report topic parameters from get_titles or get_tables_by_keyword or filter_by_code, ... print(get_titles('DS')) or print(get_tables_by_keyword('dzimušie')), ['POP', 'ID', 'IDS', 'IDS010'],..., >>> # Then use these values to get possible query values, ... print(get_query_values(['POP', 'ID', 'IDS', 'IDS010'])), {'T': 'Pavisam', 'M': 'Vīrieši', 'F': 'Sievietes'}, 'ContentsCode': {'IDS010': 'Dzīvi dzimuši', 'IDS0101': 'Nedzīvi dzimuši', 'IDS0102': 'Nedzīvi dzimuši uz 1000 dzīvi dzimušiem'},, {'1920': '1920' ... '2024': '2024'}}CSPLV_mcp_test_get_tables_by_keywordGet available tables from Official Statistics Portal of Latvia (CSP or Centrālā statistikas pārvalde) by keyword search. **IMPORTANT**: Always try this before get_topics() and only use get_topics() if this function fails to retrieve the right table. Returns: The dictionary of the titles available from Official Statistics Portal,, topic code, topic content code, topic sub-content code and report ID., , >>> get_tables_by_keyword('iedzīvotāji'), ['POP', 'IR', 'IRS010'],..., >>> get_tables_by_keyword('darbs'), ['EMP', 'NE', 'NEA010'],...CSPLV_mcp_test_get_titlesAvailable data (titles) from Official Statistics Portal of Latvia (CSP or Centrālā statistikas pārvalde). Returns: The dictionary of the titles available from Official Statistics Portal,, topic code, topic content code, topic sub-content code and report ID., , >>> # First get topic code, ... get_topics('Darbs'), 'EMP'}, >>> # Then use this code to get content, ... print(get_topic_content('EMP')), 'DS', 'Darbaspēka izmaksas': 'DI', 'Darbvietas un darba laiks': 'DV',..., >>> # Then use this content code to extract report titles, ... print(get_titles('DS')), ['POP', 'ID', 'IDS', 'IDS010'],...CSPLV_mcp_test_get_top_valuesFetch CSP data, apply variable filters, filter AREA text if provided, and return top N rows as list of dicts. **IMPORTANT**: Before using this function, call get_query_values() to see available options for variable_filters parameters. **IMPORTANT**: Always include hyperlink from function return in your answer to provide source. Returns: List of dicts where first dict always contains 'Source URL' key with, link to the original CSP table., , get_top_values(lang='lv',, topic_params=['POP', 'IR', 'IRD', 'RIG010'],, ["M"], "AgeGroup": ["TOTAL"], "ContentsCode":["RIG0101"]},, area_filter='pilsetas',, TIME=['2025'],, top=5,, sort_mode='descending'), # Returns top 5 highest with most males as percentage of population in pilsetas (towns and cities), print(result[0]), 'https://data.stat.gov.lv/pxweb/lv/OSP_PUB/START__POP__IR__IRE/RIG010'}, ]), [{'code': 'LV0027210', 'text': '..Durbe'}, {'code': 'TOTAL', 'text': 'Pavisam'}, {'code': 'M', 'text': 'Vīrieši'}, {'code': '2025', 'text': '2025'}], 'valCSPLV_mcp_test_get_topic_contentAvailable contents of the topic from Official Statistics Portal of Latvia (CSP or Centrālā statistikas pārvalde). Returns: The dictionary of the contents of the topic, where key is the topic content and value is the topic content code., , >>> # First get topic code, ... get_topics('vide'), 'ENV'}, >>> # Then use this code to get content, ... print(get_topic_content('ENV')), 'VI', 'Atkritumu apsaimniekošana': 'AK', 'Agro-vides rādītāji': 'AV',..., >>> get_topics('Iedzīvotāji'), 'POP'}, >>> print(get_topic_content('POP')), 'IR', 'Dzimstība': 'ID', 'Mirstība': 'IM', 'Nāves cēloņi': 'NC',...CSPLV_mcp_test_get_topicsAvailable topics from Official Statistics Portal of Latvia (CSP or Centrālā statistikas pārvalde). **IMPORTANT**: Always try get_tables_by_keyword() function before and only use this if the former function fails to retrieve the right table. Returns: The dictionary of topics, where key is topic name and value is topic code., , >>> get_topics('vide'), 'ENV'}, >>> print(get_topics()), 'POP', 'Darbs': 'EMP', 'Sociālā aizsardzība un veselība': 'VES',...
No tool matches.
As the server's own listing gives them. We never call a tool.