Typings - unihan_etl.types#

Typings for unihan-etl.

unihan_etl.types.StrPath#

os.PathLike or str

StrPath is based on typeshed’s.

alias of Union[str, PathLike[str]]

class unihan_etl.types.Options(source, destination, zip_path, work_dir, fields, format, input_files, download, expand, prune_empty, cache, log_level)[source]#

Bases: object

unihan-etl options.

Parameters:
  • source (str) –

  • destination (Path) –

  • zip_path (Path) –

  • work_dir (Path) –

  • fields (Tuple[str, ...]) –

  • format (Literal['json', 'csv', 'yaml', 'python']) –

  • input_files (List[str]) –

  • download (bool) –

  • expand (bool) –

  • prune_empty (bool) –

  • cache (bool) –

  • log_level (Literal['NOTSET', 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']) –

source: str#
destination: Path#
zip_path: Path#
work_dir: Path#
fields: Tuple[str, ...]#
format: Literal['json', 'csv', 'yaml', 'python']#
input_files: List[str]#
download: bool#
expand: bool#
prune_empty: bool#
cache: bool#
log_level: Literal['NOTSET', 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']#
class unihan_etl.types.ReportHookFn(*args, **kwargs)[source]#

Bases: Protocol

Progress bar callback for download().

_abc_impl = <_abc._abc_data object>#
_is_protocol = True#
class unihan_etl.types.UrlRetrieveFn(*args, **kwargs)[source]#

Bases: Protocol

Type annotation for urllib.request.urlretrieve().

_abc_impl = <_abc._abc_data object>#
_is_protocol = True#