easygraph.datapipe package

Submodules

easygraph.datapipe.common module

easygraph.datapipe.loader module

easygraph.datapipe.loader.load_from_json(file_path: Path, **kwargs)[source]

Load data from a json file.

Parameters

file_path (Path) – The local path of the file.

easygraph.datapipe.loader.load_from_pickle(file_path: Path, keys: Optional[Union[str, List[str]]] = None, **kwargs)[source]

Load data from a pickle file.

Parameters
  • file_path (Path) – The local path of the file.

  • keys (Union[str, List[str]], optional) – The keys of the data. Defaults to None.

easygraph.datapipe.loader.load_from_txt(file_path: Path, dtype: Union[str, Callable], sep: str = ',| |\t', ignore_header: int = 0)[source]

Load data from a txt file.

Note

The separator is a regular expression of re module. Multiple separators can be separated by |. More details can refer to re.split.

Parameters
  • file_path (Path) – The local path of the file.

  • dtype (Union[str, Callable]) – The data type of the data can be either a string or a callable function.

  • sep (str, optional) – The separator of each line in the file. Defaults to ",| |\t".

  • ignore_header (int, optional) – The number of lines to ignore in the header of the file. Defaults to 0.

easygraph.datapipe.loader.ret_cast_fun(dtype: Union[str, Callable])[source]

Return the cast function of the data type. The supported data types are: int, float, str.

Parameters

dtype (Union[str, Callable]) – The data type of the data can be either a string or a callable function.

easygraph.datapipe.normalize module

Module contents