ucsschool.import_lusd package#
Submodules#
ucsschool.import_lusd.cli module#
A UCS@school command line interface to fetch user and group data from LUSD and import the fetched data into the UCS@school domain.
- exception ucsschool.import_lusd.cli.ConfigurationError[source]#
Bases:
ValueError
- class ucsschool.import_lusd.cli.Configuration(lusd_api_url: str, lusd_api_oauth_iss: str, school_authority: str, skip_fetch: bool, skip_students: bool, skip_teachers: bool, dry_run: bool, student_import_config_path: pathlib.Path, teacher_import_config_path: pathlib.Path, log_level: str = 'ERROR', school_id_map: Dict[str, List[str]] = <factory>, authentication_key_file_path: pathlib.Path = PosixPath('/var/lib/ucs-school-import-lusd/auth_key'), lusd_data_save_path: pathlib.Path = PosixPath('/var/lib/ucs-school-import-lusd/data'), ucs_school_import_cli: pathlib.Path = PosixPath('/usr/share/ucs-school-import/scripts/ucs-school-user-import'))[source]#
Bases:
object
- ucsschool.import_lusd.cli.normalize_schools(school_id_map: Dict[str, str]) Dict[str, List[str]][source]#
ucsschool.import_lusd.reader module#
- class ucsschool.import_lusd.reader.LUSDReader(filename: str, header_lines: int = 0, **kwargs: Any)[source]#
Bases:
CsvReader- Parameters:
- read() Generator[Dict[str, str], None, None][source]#
Generate dicts from a JSON file. :return: iterator over list of dicts :rtype: Generator[Dict[str, str], None, None]
- lusd_preprocessing(user_obj: Dict[str, Any]) None[source]#
Convert LUSD API attributes which are arrays to string to be conform with the CsvReader
- handle_input(mapping_key: str, mapping_value: str, value: str, import_user: ImportUser) bool[source]#
This is a hook into
map().LUSD specific input handling
- Parameters:
mapping_key (str) – the key in config[“csv”][“mapping”]
mapping_value (str) – the value in config[“csv”][“mapping”]
value (str) – the associated value from the JSON object
import_user (ImportUser) – the object to modify
- Returns:
True if the field was handled here. It will be ignored in map(). False if map() should handle the field.
- Return type: