model_endpoints / scrape_parse_combine.py
karcadan-unicorn's picture
Upload 7 files
c8440e8 verified
raw
history blame contribute delete
547 Bytes
from customgraph import get_data
import json
def scrape_parse_combine(openai_key):
# Load JSON data from a file
with open('pdf_data.json', 'r') as json_file:
data = json.load(json_file)
if "pdf_doc" in data.keys():
data["startup_info"] = get_data(data["pdf_doc"].encode("utf8").decode("utf8"),
"http://" + data["website_url"].encode("utf8").decode("utf8"),openai_key)
with open('pdf_data.json', 'w') as json_file:
json.dump(data, json_file)