Add progress bar

This commit is contained in:
Markus Mandalka 2024-09-30 15:25:37 +02:00
parent 05f5fa5e28
commit 251f344c5b

View File

@ -4,6 +4,7 @@ import pandas as pd
import re
import os
import logging
from tqdm.auto import tqdm
class Validator():
@ -117,6 +118,13 @@ class Validator():
total = 0
logging.info(f"Found {total} resources")
if limit < total:
progressbar_total = limit
else:
progressbar_total = total
progress_bar = tqdm(total=progressbar_total, desc="Validating")
count_entries = 0
entries = bundle_dict.get('entry')
if entries:
@ -127,6 +135,8 @@ class Validator():
df_add = self.validate(resource_type, entry)
df = pd.concat([df, df_add], ignore_index=True)
count += 1
progress_bar.update(1)
if (limit > 0 and count >= limit):
is_limit_reached = True
logging.info(