File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22import os
33import shutil
44import uuid
5+ from tqdm import tqdm
56
67from ..utils import (
78 format_item_payload ,
@@ -97,6 +98,7 @@ def add_folder(
9798 created_at = None ,
9899 sync_parsing = 0 ,
99100 move_failure_to = None ,
101+ show_progress = False ,
100102 ** kwargs ,
101103 ):
102104 """
@@ -121,6 +123,8 @@ def add_folder(
121123 move_failure_to <string | None>
122124 directory path to move the failed files.
123125 If None, the failed files will not be moved.
126+ show_progress <bool>
127+ Show the progress bar
124128 **kwargs: <**kwargs>
125129 additional parameters to pass to the parsing API
126130 """
@@ -129,6 +133,8 @@ def add_folder(
129133 files_to_send = get_files_from_dir (dir_path , is_recurcive )
130134 succeed_upload = {}
131135 failed_upload = {}
136+ if show_progress :
137+ files_to_send = tqdm (files_to_send , "Parsing" )
132138 for file_path in files_to_send :
133139 try :
134140 with open (file_path , "rb" ) as f :
You can’t perform that action at this time.
0 commit comments