From 660c59df70166a84435ba6eaa913905e432da15b Mon Sep 17 00:00:00 2001 From: hsafaei Date: Mon, 26 May 2025 12:07:42 +0330 Subject: [PATCH] plan excel --- r4_import_plan_excel.py | 59 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 r4_import_plan_excel.py diff --git a/r4_import_plan_excel.py b/r4_import_plan_excel.py new file mode 100644 index 0000000..ba1f3f5 --- /dev/null +++ b/r4_import_plan_excel.py @@ -0,0 +1,59 @@ +import os +from dotenv import load_dotenv +from config_base import * +from general_functions import * +from text_normalizer import TextNormalizer +# from excel_helper import ExcelHelper +import pandas as pd +import requests +from config_base import * + +text_normalizer = TextNormalizer() +# + + +ADD_LIST_ROUTE = "project/add" +ADD_ITEM_ROUTE = "subject/add" +GET_H = lambda x: x["HIERARCHY"] + +def insertProejct(title): + # ایجاد فهرست جدید + + ADD_LIST_QUERY = { + "title": title, + "type": 3, + "item_state": 1, + "ispublic" : 1, + } + + requests.post(BASE_URL + 'list/' + ADD_LIST_ROUTE, data=ADD_LIST_QUERY, headers = HEADERS) + projectid = 6 + return projectid + + +def import_excel(elastic, file_excel): + pass + + + + + + + + +insertProejct('آموزش و پرورش') + +# load_dotenv(dotenv_path='config.env') + +# host=os.getenv('HOST_160') +# password=os.getenv('HOST_160_PASS') + +# # host=os.getenv('HOST_112') +# # password=os.getenv('HOST_112_PASS') + + +# path_base_map = "G:/Project2/gateway2_main/repo/_other/" +# elastic = ElasticHelper(host, password, "elastic", path_base_map) + + +# import_excel(elastic, "./data/plan.xlsx") \ No newline at end of file