Skip to content

Instantly share code, notes, and snippets.

@Apoorvgarg-creator
Last active November 7, 2021 18:18
Show Gist options
  • Save Apoorvgarg-creator/305ef85cf4e32545fe6d08dfa3015c02 to your computer and use it in GitHub Desktop.
Save Apoorvgarg-creator/305ef85cf4e32545fe6d08dfa3015c02 to your computer and use it in GitHub Desktop.
frequency based recommender system
import os
import requests
import base64
import json
csv_file = "Tags_to_Tags.csv"
url_add = "https://blitz-db-service.herokuapp.com/add"
with open(csv_file,"r") as file1:
fl = file1.read()
for line in fl.split("\n"):
data = line.split(",")
if len(data) != 7:
continue
body_data = {
"type_1": str(data[1]),
"sub_type_1": str(data[2]),
"color_1": str(data[0]),
"type_2": str(data[4]),
"sub_type_2": str(data[5]),
"color_2": str(data[3])
}
json_1 = json.dumps(body_data, indent=4)
print(json_1)
r = requests.post(url=url_add,json=body_data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment