Tennish's picture
13
1d058ba verified
raw
history blame
894 Bytes
import json
def upload_file(file_path, file_type):
# Here you can implement the logic for uploading the file
print(f"Uploading {file_type} file: {file_path}")
# Open the JSON file and load the data
with open("respons12.json", "r") as f:
data = json.load(f)
# Extract information from the data
receipt = data['receipts'][0]
items = receipt['items']
# Print relevant information
print(f"Your purchase at {receipt['merchant_name']}")
print("_" * 30)
print(f"Merchant address: {receipt['merchant_address']}")
print(f"Merchant phone: {receipt['merchant_phone']}")
print(f"Region: {receipt['region']}")
# Optionally, print the items and their prices
# for item in items:
# print(f"{item['description']} - ${item['amount']}")
# Upload PDF and images
pdf_path = "your_pdf_file.pdf"
image_path = "your_image_file.jpg"
upload_file(pdf_path, "PDF")
upload_file(image_path, "image")