Skip to content

Commit 0518231

Browse files
feat: add progress in add_folder parsing
1 parent f307200 commit 0518231

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

hrflow/profile/parsing.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33
import shutil
44
import uuid
5+
from tqdm import tqdm
56

67
from ..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:

0 commit comments

Comments
 (0)