File size: 666 Bytes
b74f043
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import src.process_json_data as pj 
import argparse

"""
Script to download the image from imageurl and convert json file to .parquet file
"""

if __name__ == '__main__':

    ap = argparse.ArgumentParser()	
    ap.add_argument("-n", "--noofrecords", required = True, type=int, help = "Number of records to read from json file")
    args = vars(ap.parse_args())

    read_records = args["noofrecords"]   
    
    numbers_records = pj.read_data(read_records)

    if numbers_records == 0:

        print('No records to process found')

    else:
        
        print(f'Sucessfully processed: {numbers_records} of raw data and saved at "{pj.processed_data}" file')