b2sdk._internal.scan.folder_parser

b2sdk._internal.scan.folder_parser.parse_folder(folder_name, api, local_folder_class=<class 'b2sdk._internal.scan.folder.LocalFolder'>, b2_folder_class=<class 'b2sdk._internal.scan.folder.B2Folder'>)[source]

Take either a local path, or a B2 path, and returns a Folder object for it.

B2 paths look like: b2://bucketName/path/name. The ‘//’ is optional.

Anything else is treated like a local folder.

Parameters:
  • folder_name (str) – a name of the folder, either local or remote

  • api (B2Api) – an API object

  • local_folder_class (~b2sdk.v2.AbstractFolder) – class to handle local folders

  • b2_folder_class (~b2sdk.v2.AbstractFolder) – class to handle B2 folders