Database retrieval and population methods

Python3 script for retrieving data from MCSQ database Before running the script, install requirements: pandas, numpy, SQLAlchemy, psycopg2 Author: Danielly Sorato Author contact: danielly.sorato@gmail.com

retrieve_from_tables.get_ids_from_alignment_table(survey_itemid)[source]

Gets all IDs (either source or target) from the alignment table.

Parameters:survey_itemid (param1) – name of the column indicating if the desired IDs to be retrived are from source or from target.
Returns:A list of survey_itemids.
retrieve_from_tables.get_ids_from_alignment_table_per_language(language)[source]

Gets all target IDs from the alignment table based on the language.

Parameters:language (param1) – target language.
Returns:A list of all target_survey_itemids in the alignment table.
retrieve_from_tables.get_instruction_id(text)[source]

Gets an instruction segment ID based on its text.

Parameters:text (param1) – the instruction segment text.
Returns:instruction segment ID (int).
retrieve_from_tables.get_introduction_id(text)[source]

Gets an introduction segment ID based on its text.

Parameters:text (param1) – the introduction segment text.
Returns:introduction segment ID (int).
retrieve_from_tables.get_module_id(module_name)[source]

Gets an module ID based on its name.

Parameters:module_name (param1) – the name of the module.
Returns:response module ID (int).
retrieve_from_tables.get_request_id(text)[source]

Gets an request segment ID based on its text.

Parameters:text (param1) – the request segment text.
Returns:request segment ID (int).
retrieve_from_tables.get_response_id(text, item_value)[source]

Gets an response segment ID based on its text.

Parameters:text (param1) – the response segment text.
Returns:response segment ID (int).

Python3 script for ESS dataset inclusion in the MCSQ database Before running the script, install requirements: pandas, numpy, SQLAlchemy, psycopg2 Author: Danielly Sorato Author contact: danielly.sorato@gmail.com