genvid.toolbox.Package

class genvid.toolbox.Package

Bases: genvid.toolbox.sdk.SDK, genvid.toolbox.docker.DockerTool

Deprecated since version 1.28.0: The class is being replaced by PackageFactory.

get_all_file_paths(directory_or_file: typing.Union[pathlib.Path, str])

Gets all the file paths in a directory.

Parameters:directory_or_file – Path of the Directory or Path.

Sets A list with all the file paths in a directory. If the path sent is of a file, the path of file is extracted and added to list.

get_name(directory_or_file: typing.Union[pathlib.Path, str])

Extract the name of the directory or file.

Parameters:directory_or_file – Path or String of the directory or file.

If directory_or_file is a directory, extract the name of the final directory , removing the final ‘/’ .

If the directory_or_file is file, extract the name of the file.

Returns:The name of the directory or file.
create_package(directory_or_file: typing.Union[pathlib.Path, str], *, name: typing.Union[str, NoneType] = None, version: str = 'dev', destination: typing.Union[pathlib.Path, str])

Create the zip for a directory or file.

Parameters:
  • directory_or_file – Path of the directory or file.
  • name – Name to be included in name of Zip.
  • version – Version to be included in name of Zip.
  • destination – Destination of the created zip.

If the name is passed to command, it is included in the name of Zip, othervise the name is extracted from name of directory or file.

If the version is passed in the command, it is included in the name of the zip,othervise default value is used.

Destination can be passed in command, if not default value is used i.e. self.ARTIFACTS_DIR .

class package.Package

Implementation of genvid.toolbox.Package