Commit 0558cf49 authored by Santan Thottempudi's avatar Santan Thottempudi

Initial commit

parents
File added
upc,name,category,brand,description,image,price,availableStock,blockedStock,fulfilledStock,featured
22350001,Aquafina Purified Drinking Water,Beverages,Aquafina,24 Pack of 16.9oz Fl. Oz. Water Bottles,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/22350001+-+Aquafina+Purified+Drinking+Water.webp,5.99,500,0,0,False
22350002,Pepsi Soda Cola - 2 Liter,Beverages,Pepsi,2 Liter Bottle of Pepsi Soda,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/22350003+-+Pepsi+Soda+Cola+-+2+Liter.jpeg,4.99,400,0,0,False
22350003,Spindrift Lemon Sparkling Water,Beverages,Spindrift,8 Pack of 12 Fl. Oz Cans,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/22350003+-+Spindrift+Lemon+Sparkling+Water.webp,6.49,300,0,0,False
22350004,Simply Lemonade Juice All Natural,Beverages,Simply,Simply Lemonade Juice All Natural - 52 Fl. Oz. Bottle,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/22350004+-+Simply+Lemonade+Juice+All+Natural.jpeg,4.01,250,0,0,False
22350005,Pure Leaf Tea Brewed Sweet,Beverages,Pure Leaf,Pure Leaf Tea Brewed Sweet - 64 Fl. Oz.bottle,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/22350005+-+Pure+Leaf+Tea+Brewed+Sweet.webp,3.63,200,0,0,False
22350006,5-hour ENERGY Berry Extra Strength Shot,Beverages,5 Hour Energy,5-hour ENERGY Berry Extra Strength Shot - 1.93 Fl. Oz. Bottle,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/22350006+-+5-hour+ENERGY+Berry+Extra+Strength+Shot.webp,3.19,100,0,0,False
22350007,Peet's Coffee French Roast Dark Roast Whole Bean Coffee,Beverages,Peet's Coffee,Peet's Coffee French Roast Dark Roast Whole Bean Coffee 12 Oz Bag,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/22350007+-+Peet's+Coffee+French+Roast+Dark+Roast+Whole+Bean+Coffee.webp,7.99,200,0,0,False
22350008,Simply Orange Juice Pulp Free,Beverages,Simply,Simply Orange Juice Pulp Free 52 Fl. Oz. bottle,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/22350008+-+Simply+Orange+Juice+Pulp+Free.webp,4.49,500,0,0,False
22350009,Simply Apple Juice Pure Pressed,Beverages,Simply,Simply Apple Juice Pure Pressed 52 Fl. Oz. Bottle,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/22350009+-+Simply+Apple+Juice+Pure+Pressed.webp,3.99,790,0,0,False
22350010,Welch's 100% Concord Grape Juice,Beverages,Welch's,Welch's 100% Concord Grape Juice 64 Fl. Oz. Bottle,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/22350010+-+Welch's+100%25+Concord+Grape+Juice.webp,4.49,0,500,500,False
33450001,Tates Bake Shop Cookies Chocolate Chip Walnut,Bakery,Tates,Tates Bake Shop Cookies Chocolate Chip Walnut 7 Oz Bag,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/33450001+-+Tates+Bake+Shop+Cookies+Chocolate+Chip+Walnut.webp,5.49,500,0,0,False
33450002,Pepperidge Farm Milano Cookies Double Chocolate,Bakery,Pepperidge Farm,Pepperidge Farm Milano Cookies Double Chocolate 7.5 Oz Bag,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/33450002+-+Pepperidge+Farm+Milano+Cookies+Double+Chocolate.webp,4.99,600,0,0,False
33450003,Fresh Baked Blueberry Muffins,Bakery,In-House Bakery,Fresh Baked Blueberry Muffins - 4 Count,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/33450003+-+Fresh+Baked+Blueberry+Muffins.webp,5.0,500,0,0,False
33450004,Wonder Bread Classic White Round Top,Bakery,Wonder Bread,Wonder Bread Classic White Round Top 20 Oz Bag,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/33450004+-+Wonder+Bread+Classic+White+Round+Top.jpeg,4.29,550,0,0,False
33450005,Thomas Bagels 100% Whole Wheat Pre Sliced 6 Count,Bakery,Thomas,Thomas Bagels 100% Whole Wheat Pre Sliced 6 Count bag,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/33450005+-+Thomas+Bagels+100%25+Whole+Wheat+Pre+Sliced+6+Count.webp,5.39,600,0,0,False
33450006,Thomas Bread Cinnamon Swirl,Bakery,Pepper Farms,Thomas Bread Cinnamon Swirl 16 Oz Bag,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/33450006+-+Thomas+Bread+Cinnamon+Swirl.webp,4.99,450,0,0,False
33450007,Bakery Cake Red Velvet 2 Layer,Bakery,Safeway Fresh,Bakery Cake Red Velvet 2 Layer Each,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/33450007+-+Bakery+Cake+Red+Velvet+2+Layer.webp,15.99,500,0,0,False
33450008,Fresh Baked Chocolate Fudge Iced Cake 8 Inch 1 Layer,Bakery,Safeway Fresh,Fresh Baked Chocolate Fudge Iced Cake 8 Inch 1 Layer Each,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/33450008+-+Fresh+Baked+Chocolate+Fudge+Iced+Cake+8+Inch+1+Layer.webp,9.99,200,0,0,False
33450009,Cake Vanilla Caramel Swirl Slice, Bakery,Safeway Fresh,Cake Vanilla Caramel Swirl Slice - Each,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/33450009+-+Cake+Vanilla+Caramel+Swirl+Slice.webp,4.99,300,0,0,False
33450010,Thomas Mini Plain Croissant,Bakery,Thomas,Thomas Mini Plain Croissant - 11 Oz,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/33450010+-+Thomas+Mini+Plain+Croissant.webp,5.39,250,0,0,False
44550001,Campbells Soup Condensed Chicken Noodle,Canned Goods,Campbell's,Campbells Soup Condensed Chicken Noodle 10.75 Oz Each,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/44550001+-+Campbells+Soup+Condensed+Chicken+Noodle.webp,1.79,300,0,0,False
44550002,Amys Soups Organic Lentil,Canned Goods,Campbell's,Amys Soups Organic Lentil 14.5 Oz can of soup,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/44550002+-+Amys+Soups+Organic+Lentil.webp,4.79,200,0,0,False
44550003,Campbells Soup Condensed Vegetarian Vegetable,Canned Goods,Campbell's,Campbells Soup Condensed Vegetarian Vegetable 10.5 Oz can of soup,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/44550003+-+Campbells+Soup+Condensed+Vegetarian+Vegetable.webp,1.99,100,0,0,False
44550004,Campbells Soup Condensed Tomato,Canned Goods,Campbell's,Campbells Soup Condensed Tomato - 10.75 Oz can of soup,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/44550004+-+Campbells+Soup+Condensed+Tomato.webp,1.79,350,0,0,False
44550005,Del Monte Fresh Cut Green Beans Cut Blue Lake,Canned Goods,Del Monte,Del Monte Fresh Cut Green Beans Cut Blue Lake 14.5 Oz Can,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/44550005+-+Del+Monte+Fresh+Cut+Green+Beans+Cut+Blue+Lake.webp,1.79,200,0,0,False
44550006,Hunts Tomatoes Diced Fire-Roasted,Canned Goods,Hunts,Hunts Tomatoes Diced Fire-Roasted 14.5 Oz Can,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/44550006+-+Hunts+Tomatoes+Diced+Fire-Roasted.webp,1.79,200,0,0,False
44550007,Goya Beans Pinto Premium Can,Canned Goods,Goya,Goya Beans Pinto Premium Can 15.5 Oz Can,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/44550007+-+Goya+Beans+Pinto+Premium+Can.webp,2.59,50,0,0,False
44550008,O Organics Beans Garbanzo,Canned Goods,O Organics,O Organics Beans Garbanzo 29 Oz Can,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/44550008+-+O+Organics+Beans+Garbanzo.webp,2.49,5,0,0,False
44550009,Hunts Tomato Sauce,Canned Goods,Hunts,Hunts Tomato Sauce 8 Oz Can,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/44550009+-+Hunts+Tomato+Sauce.webp,0.99,0,0,0,False
44550010,O Organics Organic Tomato Paste,Canned Goods,O Organics,O Organics Organic Tomato Paste 6 Oz Can,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/44550010+-+O+Organics+Organic+Tomato+Paste.webp,1.49,30,0,0,False
55650001,Lucerne Milk Lowfat 1%,Dairy,Lucerne,Lucerne Milk Lowfat 1% Half Gallon Carton,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55650001+-+Lucerne+Milk+Lowfat+1%25.webp,2.99,400,0,0,False
55650002,O Organics Organic Milk Reduced Fat 2%,Dairy,O Organics,O Organics Organic Milk Reduced Fat 2% Half Gallon Carton,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55650002+-+O+Organics+Organic+Milk+Reduced+Fat+2%25.webp,3.99,420,0,0,False
55650003,O Organics Organic Whole Milk,Dairy,Organic Farms,O Organics Organic Whole Milk Half Gallon Carton,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55650003+-+O+Organics+Organic+Whole+Milk.webp,3.99,450,0,0,False
55650004,Darigold Old Fashion Chocolate Milk,Dairy,Darigold,Darigold Old Fashion Chocolate Milk 59 Fl. Oz. Carton,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55650004+-+Darigold+Old+Fashion+Chocolate+Milk.webp,4.49,300,0,0,False
55650005,Chobani Yogurt Greek Non-Fat Plain - 32 Oz,Dairy,Chobani,Chobani Yogurt Greek Non-Fat Plain,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55650005+-+Chobani+Yogurt+Greek+Non-Fat+Plain.webp,4.99,100,0,0,False
55650012,Activia Low Fat Probiotic Peach Yogurt - 4-4 Oz,Dairy,Activia,Activia Low Fat Probiotic Peach Yogurt 4 Oz Pack of 4,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55650012+-+Activia+Low+Fat+Probiotic+Peach+Yogurt.webp,2.99,100,0,0,False
55650013,Chobani Yogurt Greek Non Fat On The Bottom Blueberry,Dairy,Chobani,Chobani Yogurt Greek Non Fat On The Bottom Blueberry Pack of 4-5.3 Oz,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55650013+-+Chobani+Yogurt+Greek+Non+Fat+On+The+Bottom+Blueberry.webp,2.99,100,0,0,False
55650014,Chobani Yogurt Greek Fruit On The Bottom Non-Fat Strawberry,Dairy,Chobani,Chobani Yogurt Greek Fruit On The Bottom Non-Fat Strawberry 5.3 Oz,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55650014+-+Chobani+Yogurt+Greek+Fruit+On+The+Bottom+Non-Fat+Strawberry.webp,1.0,100,0,0,False
55650015,Chobani Yogurt Greek Low Fat On The Bottom Mango,Dairy,Chobani,Chobani Yogurt Greek Low Fat On The Bottom Mango 5.3 Oz,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55650015+-+Chobani+Yogurt+Greek+Low+Fat+On+The+Bottom+Mango.webp,1.0,100,0,0,False
55650007,Knudsen Buttermilk,Dairy,Knudsen,Knudsen Buttermilk 32 Fl. Oz. Carton,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55650007+-+Knudsen+Buttermilk.webp,2.99,100,0,0,False
55650008,Land O Lakes Salted Butter Sticks 4 Count,Dairy,Land O Lakes,Land O Lakes Salted Butter Sticks 4 Count 1 Lb,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55650008+-+Land+O+Lakes+Salted+Butter+Sticks+4+Count.webp,4.99,100,0,0,False
55650009,Lucerne Whipped Topping Original,Dairy,Lucerne,Lucerne Whipped Topping Original 13 Oz can,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55650009+-+Lucerne+Whipped+Topping+Original.jpeg,3.99,100,0,0,False
55650010,Land O Lakes Spreadable Butter with Canola Oil,Dairy,Land O Lakes,Land O Lakes Spreadable Butter with Canola Oil 24 Oz,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55650010+-+Land+O+Lakes+Spreadable+Butter+with+Canola+Oil.webp,5.99,100,0,0,False
55750001,Gold Medal Bleached Enriched Presifted All Purpose Flour,Baking_Goods,Gold Medal,Gold Medal Bleached Enriched Presifted All Purpose Flour 5 Lb,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55750001+-+Gold+Medal+Bleached+Enriched+Presifted+All+Purpose+Flour.webp,3.99,250,0,0,False
55750002,O Organics Organic Light Brown Sugar,Baking_Goods,O Organics,O Organics Organic Light Brown Sugar - 24 Oz,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55750002+-+O+Organics+Organic+Light+Brown+Sugar.webp,3.79,30,0,0,False
55750003,C&H Sugar Granulated White Pure Cane,Baking_Goods,C&H,C&H Sugar Granulated White Pure Cane - 4 Lb Bag,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55750003+-+C%26H+Sugar+Granulated+White+Pure+Cane.webp,4.29,40,0,0,False
55750004,Gold Medal Flour Whole Wheat Flour ,Baking_Goods,Gold Medal,Gold Medal Flour Whole Wheat Flour 5Lb Bag,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55750004+-+Gold+Medal+Flour+Whole+Wheat+Flour.webp,3.99,120,0,0,False
55750005,Koda Mochiko Specialty Food Rice Flour,Baking_Goods,Koda Mochiko,Koda Mochiko Specialty Food Rice Flour 16 Oz Box,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55750005+-+Koda+Mochiko+Specialty+Food+Rice+Flour.webp,2.99,100,0,0,False
55750006,Arm & Hammer Baking Soda Pure,Baking_Goods,Baking Company,Arm & Hammer Baking Soda Pure - 1 Lb Box,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55750006+-+Arm+%26+Hammer+Baking+Soda+Pure.webp,3.5,120,0,0,False
55750007,Clabber Girl Baking Powder,Baking_Goods,Clabber Girl,Clabber Girl Baking Powder,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55750007+-+Clabber+Girl+Baking+Powder.webp,3.49,40,0,0,False
55750008,Argo Corn Starch 100% Pure Stay Fresh Container ,Baking_Goods,Argo,Argo Corn Starch 100% Pure Stay Fresh Container,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55750008+-+Argo+Corn+Starch+100%25+Pure+Stay+Fresh+Container.webp,1.99,100,0,0,False
55750009,Guittard Baking Chips Semisweet Chocolate 46% Cacao,Baking_Goods,Guittard,Guittard Baking Chips Semisweet Chocolate 46% Cacao 12 Oz Bag,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55750009+-+Guittard+Baking+Chips+Semisweet+Chocolate+46%25+Cacao.webp,4.49,200,0,0,False
55750010,McCormick All Natural Pure Vanilla Extract,Baking_Goods,McCormick,McCormick All Natural Pure Vanilla Extract - 4 Fl. Oz. Bag,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55750010+-+McCormick+All+Natural+Pure+Vanilla+Extract.webp,18.99,100,0,0,False
55850001,O Organics Organic Peas Green - 16 Oz,Frozen,O Organics,O Organics Organic Peas Green - 16 Oz,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55850001+-+O+Organics+Organic+Peas+Green+-+16+Oz.webp,2.99,100,0,0,False
55850002,Signature Carrots Crinkle Cut,Frozen,Signature,Signature Carrots Crinkle Cut - 16 Oz,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55850002+-+Signature+Carrots+Crinkle+Cut.webp,2.0,100,0,0,False
55850003,Ore-Ida Potatoes Hash Brown Diced Gluten Free,Frozen,Ore-Ida,Ore-Ida Potatoes Hash Brown Diced Gluten Free - 32 Oz,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55850003+-+Ore-Ida+Potatoes+Hash+Brown+Diced+Gluten+Free.webp,4.29,100,0,0,False
55850004,Birds Eye Steamfresh Vegetables Mixtures Broccoli Cauliflower & Carrots,Frozen,Birds Eye,Birds Eye Steamfresh Vegetables Mixtures Broccoli Cauliflower & Carrots,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55850004+-+Birds+Eye+Steamfresh+Vegetables+Mixtures+Broccoli+Cauliflower+%26+Carrots.webp,3.0,100,0,0,False
55850005,Red Baron Pizza Classic Crust Pepperoni,Frozen,Red Baron,Red Baron Pizza Classic Crust Pepperoni - 20.6 Oz,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55850005+-+Red+Baron+Pizza+Classic+Crust+Pepperoni.webp,1.99,75,0,0,False
55850006,Haagen-Dazs Ice Cream Irish Cream Brownie,Frozen,Haagen-Dazs,Haagen-Dazs Ice Cream Irish Cream Brownie - 14 Fl. Oz,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/960486916+-+Haagen-Dazs+Ice+Cream+Irish+Cream+Brownie+.webp,4.99,0,0,0,False
55850007,Popsicle Ice Pops Sugar Free Orange Cherry Grape,Frozen,Popsicle,Popsicle Ice Pops Sugar Free Orange Cherry Grape - 18 Count,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/960486916+-+Haagen-Dazs+Ice+Cream+Irish+Cream+Brownie+.webp,2.99,30,0,0,False
55850008,Amys Burrito Bean And Rice Non-Dairy Gluten Free,Frozen,Amys,Amys Burrito Bean And Rice Non-Dairy Gluten Free - 5.5 Oz,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55850008+-+Amys+Burrito+Bean+And+Rice+Non-Dairy+Gluten+Free.webp,3.79,200,0,0,False
55850009,Eggo Buttermilk Frozen Breakfast Waffles 10 Count - 12.3 Oz,Frozen,Eggos,Eggo Buttermilk Frozen Breakfast Waffles 10 Count,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55850009+-+Eggo+Buttermilk+Frozen+Breakfast+Waffles+10+Count.webp,2.79,50,0,0,False
55850010,Stouffer's Lasagna with Meat & Sauce Frozen Meal,Frozen,Stouffer's,Stouffer's Lasagna with Meat & Sauce Frozen Meal - 10.5 Oz,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55850010+-+Stouffer's+Lasagna+with+Meat+%26+Sauce+Frozen+Meal.webp,4.0,50,0,0,False
55950001,Signature Farms Boneless Skinless Chicken Breasts,Meat,Signature Farms,Signature Farms Boneless Skinless Chicken Breasts - 2.0 Lbs,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55950001+-+Signature+Farms+Boneless+Skinless+Chicken+Breasts.webp,11.98,50,0,0,False
55950002,Ground Beef 80% Lean 20% Fat Value Pack,Meat,Fresh Select,pack of 24 raw chicken thigh cutlets,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55950002+-+Ground+Beef+80%25+Lean+20%25+Fat+Value+Pack.webp,17.47,75,0,0,False
55950003,Open Nature Chicken Tenders Air Chill - 1 LB,Meat,Open Nature,Open Nature Chicken Tenders Air Chill - 1 LB,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55950003+-+Open+Nature+Chicken+Tenders+Air+Chill+-+1+LB.webp,7.99,50,0,0,False
55950004,Farmer John Smoked Sliced Bacon,Meat,Farmer John,Farmer John Smoked Sliced Bacon - 16 Oz,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55950004+-+Farmer+John+Smoked+Sliced+Bacon.webp,9.49,60,0,0,False
55950005,Oscar Mayer Turkey Bacon,Meat,Oscar Mayer ,Oscar Mayer Turkey Bacon,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55950005+-+Oscar+Mayer+Turkey+Bacon.webp,4.49,60,0,0,False
55950006,USDA Choice Beef Tenderloin Filet Mignon Steak,Meat,USDA Choice,USDA Choice Beef Tenderloin Filet Mignon Steak - 1 Lb,https://ascend-final-pictures.s3.us-east-2.amazonaws.com/55950006+-+USDA+Choice+Beef+Tenderloin+Filet+Mignon+Steak.webp,22.99,80,0,0,False
gitrepo @ e484aa53
Subproject commit e484aa5316fb4bb36fc2cfef5f7fb936a779c89a
import os
import json
import git
import csv
import pandas as pd
import numpy as np
#Ask for File Location Input
while True:
try:
mychoice = int(input("Please enter select a number choice. Where is the JSON file located: \n 1) Local. 2) GitRepo. : "))
except ValueError:
print('Your input is invalid. Please enter a number.')
if mychoice == 1:
localpath = input("Please enter the absolute file path of directory where JSON file is located. Do not include filename.: ")
filename = input("Please enter the filename including file extension: ")
filepath = (os.path.join(localpath, filename))
print("File path: "+filepath)
try:
print("Opening File.")
myfile = open(filepath, 'r')
print("File Opened!")
print("Reading File.")
try:
filedata = myfile.read()
print("File Read!")
print("Checking if data is valid JSON.")
try:
json.loads(filedata)
print("Data is valid JSON!")
print(filedata)
print("Converting JSON into CSV.")
with open(filepath) as json_file:
json_data = json.load(json_file)
csvfilename = input("Please enter a name for the CSV file:")
fullcsvfilename = csvfilename+".csv"
# now we will open a file for writing
data_file = open(fullcsvfilename, 'w')
# create the csv writer object
csv_writer = csv.writer(data_file)
# Counter variable used for writing
# headers to the CSV file
count = 0
for emp in json_data:
if count == 0:
# Writing headers of CSV file
header = emp.keys()
csv_writer.writerow(header)
count += 1
# Writing data of CSV file
csv_writer.writerow(emp.values())
data_file.close()
# read CSV file
# numcolumns = pd.read_csv(file, nrows=1).select_dtypes("number").columns
results = pd.read_csv(fullcsvfilename)
# numeric_data = results.select_dtypes(include=[np.number])
# string_data = results.select_dtypes(exclude=[np.number])
# count no. of lines
print("Number of lines present:",len(results))
# find the maximum of each numeric column
# maxValues = numeric_data.max()
# print(maxValues)
#find the maximum of each string colums
def output_analysis(file_dir):
df = pd.read_csv(file_dir)
header = list(df.columns.values)
for i in range(0, len(header) - 1):
string_length = df[header[i]].astype(str).map(len)
result = df.loc[string_length.argmax(), header[i]]
if not str(result).replace('.', '', 1).isdigit():
print("{} : {}".format(header[i], result))
else:
print("{} : {}".format(header[i], df[header[i]].max()))
print(output_analysis(fullcsvfilename))
except IOError:
print("The data in "+filename+" is not valid JSON.")
except IOError:
print("Error: "+filename+" cannot be read!")
except IOError:
print("Error: Please enter the correct file path and file name!")
break
elif mychoice == 2:
giturl = input("Please enter the url of the Git Repo: ")
filename = input("Please enter the name of the json file including file extension: ")
repopath = input("Please enter the absolute file path for directory where you want to clone the Git Repo: ")
gitfilepath = (os.path.join(repopath, filename))
print("Repository Path: "+repopath)
try:
print("Cloning Repo.")
repo = git.Repo.clone_from(giturl, repopath)
print("Repo Cloned!")
try:
print("Opening File.")
myfile = open(gitfilepath, 'r')
print("File Opened!")
print("Reading File.")
try:
filedata = myfile.read()
print("File Read!")
print("Checking if data is valid JSON.")
try:
json.loads(filedata)
print("Data is valid JSON!")
print(filedata)
print("Converting JSON into CSV.")
with open(gitfilepath) as json_file:
json_data = json.load(json_file)
csvfilename = input("Please enter a name for the CSV file including :")
fullcsvfilename = csvfilename+".csv"
# now we will open a file for writing
data_file = open(fullcsvfilename, 'w')
# create the csv writer object
csv_writer = csv.writer(data_file)
# Counter variable used for writing
# headers to the CSV file
count = 0
for emp in json_data:
if count == 0:
# Writing headers of CSV file
header = emp.keys()
csv_writer.writerow(header)
count += 1
# Writing data of CSV file
csv_writer.writerow(emp.values())
data_file.close()
# read CSV file
# numcolumns = pd.read_csv(file, nrows=1).select_dtypes("number").columns
results = pd.read_csv(fullcsvfilename)
# count no. of lines
print("Number of lines present:",len(results))
# find the maximum of each column
def output_analysis(file_dir):
df = pd.read_csv(file_dir)
header = list(df.columns.values)
for i in range(0, len(header) - 1):
string_length = df[header[i]].astype(str).map(len)
result = df.loc[string_length.argmax(), header[i]]
if not str(result).replace('.', '', 1).isdigit():
print("{} : {}".format(header[i], result))
else:
print("{} : {}".format(header[i], df[header[i]].max()))
print(output_analysis(fullcsvfilename))
except IOError:
print("Error: The data in "+filename+" is not valid JSON.")
except IOError:
print("Error: "+filename+" cannot be read!")
except IOError:
print("Error: Please enter the correct file path and file name!")
except:
print("Error: URL Incorrect, Repository Does Not Exist, or Repo Cannot Be Accessed!")
break
else:
print("Invalid Choice")
# elif choice != ('A', 'B')
# print("Incorrect Input. Please select 'A' or 'B'.")
# continue
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment