hifis_surveyval package

Submodules

hifis_surveyval.cli module

This is the entry point for the command-line interface (CLI) application.

It can be used as a handy facility for running the task from a command line.

Note

To learn more about Click visit the project website. There is also a very helpful tutorial video.

To learn more about running Luigi, visit the Luigi project’s Read-The-Docs page.

hifis_surveyval.data_container module

This module provides the definitions for a data container.

The container is meant to serve as the data source for the individual analysis functions.

class hifis_surveyval.data_container.DataContainer[source]

Bases: object

The data container holds the data read from the command line.

ID_COLUMN_NAME: str = 'id'

Name of the ID column in the Limesurvey CSV data

__init__()[source]

Set up an empty data container.

collection_for_id(full_id: str)hifis_surveyval.models.question_collection.QuestionCollection[source]

Query for a given question collection given by its full ID.

Args:
full_id:

The full ID of the question collection to be returned.

Returns:

The question collection for the given ID.

Raises:

KeyError - if the collection for the given ID could not be found.

load_metadata(yaml: Union[List[Union[str, Dict[str, Union[str, List[Union[str, YamlDict]], YamlDict]]]], Dict[str, Union[str, List[Union[str, Dict[str, Union[str, YamlList, YamlDict]]]], Dict[str, Union[str, List[Union[str, YamlDict]], YamlDict]]]]])None[source]

Load additional metadata from YAML data.

If the given yaml is valid, the received metadata will be added to the known survey questions. QuestionCollections that fail to parse will not be added to the survey questions and the exception will instead be logged as a warning. It is safe to repeatedly call this function, if multiple sources for metadata need to be processed.

Args:
yaml:

Either a list of YamlDictionaries or a single YamlDictionary. Each YamlDictionary is expected to hold a QuestionCollection, Otherwise parsing will fail.

load_survey_data(csv_data: List[List[str]])None[source]

Load survey data as given in a CSV file.

The data is expected to be given in such a way that the outer list represents the rows and the inner list the columns within each row

question_for_id(full_id: str)hifis_surveyval.models.question.Question[source]

Query for a given question given by its full ID.

This is a shorthand for querying questions directly.

Args:
full_id:

The full ID of the question to be returned.

Returns:

The question for the given ID.

Raises:

KeyError - if either the collection or the question for the given ID could not be found.

property survey_questions: List[hifis_surveyval.models.question_collection.QuestionCollection]

Obtain all survey questions stored in the data container.

Returns:

A list of QuestionCollections that contain all the survey questions.

hifis_surveyval.hifis_surveyval module

This project is used to develop analysis scripts for surveys.

class hifis_surveyval.hifis_surveyval.HIFISSurveyval(settings: hifis_surveyval.core.settings.Settings)[source]

Bases: object

Main class for all functionalities.

Also serves as data storage.

__init__(settings: hifis_surveyval.core.settings.Settings)[source]

Initialize HIFISSurveyval.

Args:
settings:

A Settings container to store the setup configuration in. It will be populated with the related settings during the initialization of the HIFISSurveyval object.

settings: hifis_surveyval.core.settings.Settings

The settings storage

Module contents

This project is used to develop analysis scripts for the surveys.