Archive processing

class oceanai.modules.lab.unzip.UnzipMessages(lang: str = 'ru', color_simple: str = '#666', color_info: str = '#1776D2', color_err: str = '#FF0000', color_true: str = '#008001', bold_text: bool = True, text_runtime: str = '', num_to_df_display: int = 30)[source]

Bases: Core

Class for messages

Parameters:
class oceanai.modules.lab.unzip.Unzip(lang: str = 'ru', color_simple: str = '#666', color_info: str = '#1776D2', color_err: str = '#FF0000', color_true: str = '#008001', bold_text: bool = True, text_runtime: str = '', num_to_df_display: int = 30)[source]

Bases: UnzipMessages

Class for archive processing

Parameters:
__progressbar_unzip(path_to_zipfile: str, progress: float, clear_out: bool = True, last: bool = False, out: bool = True) None

Progressbar

Note

private method

Parameters:
  • path_to_zipfile (str) – Full path to the archive

  • progress (float) – Percentage of progress (from 0.0 to 100.0)

  • clear_out (bool) – Clearing the output

  • last (bool) – Replacing the last message

  • out (bool) – Display

Return type:

None

_unzip(path_to_zipfile: str, new_name: str | None = None, force_reload: bool = True, out: bool = True) bool[source]

Unzipping the archive (without clearing the message output history in the Jupyter cell)

Note

protected method

Parameters:
  • path_to_zipfile (str) – Full path to the archive

  • new_name (str) – Directory name for unzipping

  • force_reload (bool) – Forced unzipping

  • out (bool) – Display

Returns:

True if unzipping was successful, otherwise False

Return type:

bool

property path_to_unzip: str

Getting a directory for unzipping

Returns:

Unzip directory

Return type:

str

unzip(path_to_zipfile: str, new_name: str | None = None, force_reload: bool = True, out: bool = True) bool[source]

Unzipping an archive

Parameters:
  • path_to_zipfile (str) – Full path to the archive

  • new_name (str) – Directory name for unzipping

  • force_reload (bool) – Forced unzipping

  • out (bool) – Display

Returns:

True if unzipping was successful, otherwise False

Return type:

bool