Load technologies¶
-
wap.load.load_apps(json_dict) → Tuple[Dict[str, wap.structs.Technology], Dict[str, wap.structs.Category]]¶ Parses the object generated from the json definition in technologies.json and returns the technologies and the categories.
Parameters: json_dict – A object representing the json content of technologies.json, for example loaded with the json.load function. Returns: - A tuple with the
- technologies and the categories defined in the input object.
Return type: Tuple[Dict[str, Technology], Dict[str, Category]] Example
>>> import json >>> import wap >>> techs, cats = wap.load_apps(json.load(open("technologies.json")))
-
wap.load.load_categories(json_dict) → Dict[str, wap.structs.Category]¶ Parses the object generated from the json definition of the categories section of technologies.json and returns the categories.
Parameters: json_dict – A object representing the json content of the categories section of technologies.json, for example loaded with the json.load function. Returns: Categories defined in the input object. Return type: Dict[str, Category] Example
>>> import json >>> import wap >>> cats = wap.load_categories(json.load(open("technologies.json"))["categories"])
-
wap.load.load_file(filepath: str) → Tuple[Dict[str, wap.structs.Technology], Dict[str, wap.structs.Category]]¶ Loads the contents of an technologies.json file indicated by the path.
Parameters: filepath (str) – Path of the technologies.json file. Returns: - A tuple with the
- technologies and the categories defined in technologies.json.
Return type: Tuple[Dict[str, Technology], Dict[str, Category]] Example
>>> import wap >>> techs, cats = wap.load_file("technologies.json")
-
wap.load.load_stream(stream: TextIO) → Tuple[Dict[str, wap.structs.Technology], Dict[str, wap.structs.Category]]¶ Loads the contents of an technologies.json already opened.
Parameters: stream (TextIO) – A stream of the technologies.json content. Returns: - A tuple with the
- technologies and the categories defined in technologies.json.
Return type: Tuple[Dict[str, Technology], Dict[str, Category]] Example
>>> import wap >>> techs, cats = wap.load_stream(open("technologies.json"))