refactor codes and names

This commit is contained in:
hsafaei
2026-02-12 11:19:58 +03:30
parent 56084b0c8e
commit 9c99d816db
25 changed files with 395 additions and 2360 deletions
+22
View File
@@ -2,6 +2,7 @@ from app.common.normalizer import Normalizer
from app.common.tokenizer import *
from app.common.jalali import Gregorian,Persian
import re
import os
import sys
from re import sub
import textwrap
@@ -1325,6 +1326,27 @@ def extract_excel_fields(file_path: str, fields: list = [], sheet_name: str = No
print(f"❌ خطا در خواندن فایل اکسل: {e}")
return []
def get_files(directory, pattern_file=r"output_(\d+)\.json$"):
pattern = None
if pattern_file :
pattern = re.compile(pattern_file)
max_num = 0
list_file = []
for filename in os.listdir(directory):
if pattern :
match = pattern.match(filename)
if match:
list_file.append(directory+"/"+filename)
else:
list_file.append(directory+"/"+filename)
return list_file
# prefix, title = normalHeadingTitle("فصل اول - سیاستها و اصول")
# print('prefix :', prefix)
# print('title :', title)
+5 -24
View File
@@ -9,30 +9,11 @@ import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")))
from app.common.elastic_helper import ElasticHelper
from app.common.general_functions import getTitleType
from app.common.general_functions import getTitleType, get_files
from app.common.text_normalizer import TextNormalizer
text_normal = TextNormalizer()
def get_files(directory, pattern_file=r"output_(\d+)\.json$"):
pattern = None
if pattern_file :
pattern = re.compile(pattern_file)
max_num = 0
list_file = []
for filename in os.listdir(directory):
if pattern :
match = pattern.match(filename)
if match:
list_file.append(directory+"/"+filename)
else:
list_file.append(directory+"/"+filename)
return list_file
def parse_and_update_code(file_path, elastic, index_name_o = "mj_qa_section", update_to_elastic=False, by_ai_code = False):
try:
@@ -375,7 +356,7 @@ def genrate_list_negative(paths=[],list_minues=[]):
for path in paths :
print('*', 100)
print('******** ', path)
for file in get_files(path):
for file in get_files(path, r"output_(\d+)\.json$"):
print(file)
list_prccessed_negative_file = parse_and_update_code(file, elastic, "mj_qa_section", False)
list_prccessed_negative.extend(list_prccessed_negative_file)
@@ -402,7 +383,7 @@ def import_codes_to_elastic(elastic, all_codes, by_ai_code, paths=[], list_minue
for path in paths :
print('*', 100)
print('******** ', path)
for file in get_files(path):
for file in get_files(path, r"output_(\d+)\.json$"):
print(file)
if 'data_h100_full' in path : # data_h100_full_1 , ..., data_h100_full_4
list_prccessed_negative_file = parse_and_update_multi_code(file, elastic, all_codes, "mj_qa_section", True, by_ai_code)
@@ -427,7 +408,7 @@ def parse_notvalid_multi_codes(paths, all_codes=[], file_not_valid="processed_id
for path in paths :
print('*', 100)
print('******** ', path)
for file in get_files(path):
for file in get_files(path, r"output_(\d+)\.json$"):
print(file)
data = []
with open(file, 'r', encoding="utf8") as f:
@@ -471,7 +452,7 @@ def extract_sectionid_in_files(paths, sections=[], file_result="section_id_files
for path in paths :
print('*', 100)
print('******** ', path)
for file in get_files(path):
for file in get_files(path, r"output_(\d+)\.json$"):
print(file)
data = []
with open(file, 'r', encoding="utf8") as f:
@@ -115,3 +115,22 @@ col_index = {
### --- درج در الاستیک نمی کند update_elastic = False
# run_codes_to_elastic_directory( elastic, "./data/tcodes/corrected_majles/not_edit3", "./data/tcodes/corrected_majles/not_edit3/result", all_codes, False, True, col_index, False)
# run_codes_extract_directory("./data/tcodes/corrected_majles/not_edit3/result","./data/tcodes/corrected_majles/not_edit3/result_json",all_codes,col_index,True)
col_index = {
"section_title" : 0,
"ts_date" : 1,
"qanon_title" : 2,
"code_state" : 3,
"code_title" : 4,
"row_number" : 5,
"qanon_id" : 6,
"section_id" : 7,
"state_match" : 8,
}
### --- درج در الاستیک نمی کند update_elastic = False
# run_codes_to_elastic_directory( elastic, "./data/tcodes/corrected_majles/not_edit4", "./data/tcodes/corrected_majles/not_edit4/result", all_codes, False, True, col_index, False)
run_codes_extract_directory("./data/tcodes/corrected_majles/not_edit4/result","./data/tcodes/corrected_majles/not_edit4/result_json",all_codes,col_index,True)
-55
View File
@@ -1,55 +0,0 @@
import numbers
import os
from dotenv import load_dotenv
from elasticsearch import Elasticsearch, helpers
import json
import re
import zipfile
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")))
from app.common.elastic_helper import ElasticHelper
from app.common.general_functions import *
from app.common.text_normalizer import TextNormalizer
from app.for_ai.codes_import_from_excel import (
run_codes_extract_directory,
run_codes_to_elastic_directory,
)
from app.parvande_qanon.import_qavanin_excels_to_elastic import (
import_excel_before_to_elastic,
import_excel_after_to_elastic,
import_excel_tasmimat_to_elastic,
)
from app.parvande_qanon.repair_qa_qanon_for_map_new import *
text_normal = TextNormalizer()
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")
# host = os.getenv("HOST_H102")
# password = os.getenv("HOST_H102_PASS")
# print( "---------------->>>>>>>>>>>>>>>", host )
# host=os.getenv('HOST_113')
# password=os.getenv('HOST_113_PASS')
print(".... majles_codes_update_steps ......", host)
path_base_map = "G:/Project2/gateway_php/repo/_other/"
elastic = ElasticHelper(host, password, "elastic", path_base_map)
-8
View File
@@ -1,8 +0,0 @@
file_path = r'C:\Users\TAVASI-3\Desktop\init_mahdi\project\dataParsers\data\FLC\cleaned\temp.json'
with open(file_path, "r", encoding="utf-8") as f:
text = f.read()
import re
matches = re.findall(r'persian', text)
print("تعداد دقیق:", len(matches))
-168
View File
@@ -1,168 +0,0 @@
import mariadb
from dotenv import load_dotenv
import os
import datetime
import json
import uuid
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from app.common.elastic_helper import ElasticHelper
from app.common.general_functions import *
from app.common.text_normalizer import TextNormalizer
def import_to_gn_tree_elastic(cursor, elastic, project_id, project_title, index_name_o) :
query = f"""
SELECT id, title, parent, child_order, meta, tags from tlist.tl_subjects
where project_id={project_id}
ORDER BY parent, child_order
"""
# print('-'*10)
# print(query)
# print('-'*10)
cursor.execute(query)
parent_nodes = {}
bulk_data=[]
total_count = 0
t1 = datetime.datetime.now()
print(t1)
i = 0
while 1:
# print(i)
i = i + 1
row = cursor.fetchone()
if not row:
break
id = row[0]
# eid = uuid.uuid4().hex[:8]
eid = 'gnt'+str(id).zfill(5)
title = row[1].strip()
parent = row[2]
parent_id = 0
if parent != 0 :
parent_id = 'gnt'+str(parent).zfill(5)
child_order = row[3]
meta = row[4]
tags = row[5]
meta_info = {}
if meta :
meta_info["id1"] = str(meta)
tags_list = []
if tags :
for tt in tags.strip().split(',') :
if tt and not tt in tags_list :
tags_list.append(tt)
main_type_key = "tree"+str(project_id)
data={
"id" : eid,
"version_key" : "base_1",
"main_type_key" : main_type_key,
"main_type" : project_title,
# "group_key" : "",
"title" : title,
"parent_id" : parent_id,
"child_order" : child_order,
"tags" : tags_list,
"meta_info" : meta_info
}
if len(bulk_data) >= 100:
total_count += len(bulk_data)
print('=' * 10, 'to_elastic , total='+str(total_count) , str(i)+ ', id=' + eid )
elastic.importBulkList(bulk_data, index_name_o)
bulk_data = []
bulk_data.append(
{
'_id' : eid,
'_source' : data
}
)
if len(bulk_data) > 0:
total_count += len(bulk_data)
print('=' * 10, ' to_elastic , total='+str(total_count) )
elastic.importBulkList(bulk_data, index_name_o)
bulk_data = []
print("end success import_to_elastic")
t2 = datetime.datetime.now()
print(t2 - t1)
load_dotenv(dotenv_path="config.env")
host = os.getenv("HOST_160_LOCAL")
password = os.getenv("HOST_160_PASS")
# print(host)
# print(password)
path_base_map = "/home/sabr/back_new/elastic_backend/app/schemas/mappings/"
elastic = ElasticHelper(host, password, "elastic", path_base_map)
config_env = load_dotenv(dotenv_path="./config.env")
MYSQL_username = os.getenv("MYSQL_username")
MYSQL_root_password = os.getenv("MYSQL_root_password")
MYSQL_port = os.getenv("MYSQL_port")
MYSQL_host = os.getenv("MYSQL_import_host")
cnx = mariadb.connect(user="root", password=MYSQL_root_password, host=MYSQL_host)
cursor = cnx.cursor()
query = "select id, title from tlist.tl_projects"
cursor.execute(query)
list_projects=[]
while 1 :
row = cursor.fetchone()
if not row:
break
pid = row[0] # "id"
title = row[1] # "title"
# print(title)
# پلانهای استفاده نشده در مجلس
if pid >= 100 and pid <= 200 :
continue
# موضوعات درختی قدیم که دیگه جایگزین با 6 شد
if pid == 1 :
continue
list_projects.append({
"id" : pid,
"title" : title
})
for item in list_projects :
print('*'*100)
print(item)
import_to_gn_tree_elastic( cursor, elastic, item["id"], item["title"],"gn_tree")
cursor.close()
@@ -11,7 +11,7 @@ import time
from tqdm import tqdm
from pydantic import BaseModel
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")))
from app.common.elastic_helper import ElasticHelper
@@ -20,7 +20,7 @@ from app.common.text_normalizer import TextNormalizer
from app.common.data_helper import DataHelper
from app.majles_options import *
# from app.majles.majles_options import *
class OutputLabels(BaseModel):
@@ -41,7 +41,7 @@ class OutputLabels(BaseModel):
exception: Clause | None
load_dotenv(dotenv_path=r"D:\init_mahdi\dataParsers\config.env")
load_dotenv(dotenv_path="config.env")
host = os.getenv("HOST_160")
password = os.getenv("HOST_160_PASS")
@@ -49,8 +49,9 @@ password = os.getenv("HOST_160_PASS")
# host = os.getenv("HOST_112")
# password = os.getenv("HOST_112_PASS")
# print(host)
# print(password)
# host = os.getenv("HOST_H101")
# password = os.getenv("HOST_H101_PASS")
# path_base_map = (
@@ -542,22 +543,22 @@ if __name__ == "__main__":
# log_file.close()
# ### ----------------------------------------------
data_key = "rules_labels"
# label_object
index_name = "mj_qa_rule"
json_path = r"D:\init_mahdi\dataParsers\merge_labels.json"
extract_json_context_id_rules_labels(
elastic=elastic, index_name=index_name, json_path=json_path
)
# data_key = "rules_labels"
# # label_object
# index_name = "mj_qa_rule"
# json_path = r"D:\init_mahdi\dataParsers\merge_labels.json"
# extract_json_context_id_rules_labels(
# elastic=elastic, index_name=index_name, json_path=json_path
# )
# ### ----------------------------------------------
# elastic.backupIndexToZipfile("G:/Project2/102_gpu", "mj_qa_context", "mj_qa_context")
# elastic.backupIndexToZipfile("G:/Project2/102_gpu", "mj_qa_rule", "mj_qa_rule")
# mapping_file_path = "G:/\Project2/_back/_to_majles/14041022/src/repo/_other/majles/mj_qa_context.json"
# mapping_file_path = "G:/\Project2/tavasi_160/src/repo/_other/majles/mj_qa_context.json"
# elastic.restorFileToElastic2('G:/Project2/102_gpu/mj_qa_context.zip', 'mj_qa_context', 'majles', False, 'mj_qa_context', mapping_file_path)
# mapping_file_path = "G:/\Project2/_back/_to_majles/14041022/src/repo/_other/majles/mj_qa_rule.json"
# mapping_file_path = "G:/\Project2/tavasi_160/src/repo/_other/majles/mj_qa_rule.json"
# elastic.restorFileToElastic2('G:/Project2/102_gpu/mj_qa_rule.zip', 'mj_qa_rule', 'majles', False, 'mj_qa_rule', mapping_file_path)
# ### ----------------------------------------------
@@ -8,7 +8,7 @@ import pandas as pd
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")))
from app.common.elastic_helper import ElasticHelper
@@ -16,7 +16,7 @@ from app.common.general_functions import *
from app.common.text_normalizer import TextNormalizer
from app.majles_options import *
from app.majles.majles_options import *
load_dotenv(dotenv_path="config.env")
@@ -249,6 +249,9 @@ def import_content_opinion_to_qaqanon(elastic, path_file, index_name_o):
qanon_id = entry.get("qanon_id", "")
eid = qanon_id
# if not qanon_id == "qq296834" :
# continue
ref_id = entry.get("ref_id", "")
ref_key = entry.get("ref_key", "")
@@ -325,6 +328,7 @@ def import_content_opinion_to_qaqanon(elastic, path_file, index_name_o):
if html: # ساختن دوباره و بهتر
content = html_to_text_preserve_lines(html)
content = text_normal.normalize_qanon(content)
content_len = len(content)
data["content"] = content
@@ -371,3 +375,145 @@ def import_content_opinion_to_qaqanon(elastic, path_file, index_name_o):
except Exception as e:
print("Exception: " + str(e))
def extract_content_opinion_to_qaqanon(elastic, path_file, index_name_o, path_out = "./data/"):
bulk_list = []
bulk_list_import = []
pack_size = 100
count = 0
id = ""
try:
try:
list_ = elastic.iterateJsonFile(path_file, True)
except Exception as e:
print("Exception es_iterate_all_documents : " + str(e))
list_items = list(list_)
total = elastic.total
print("*" * 20, " count=", elastic.total)
total_count = 0
percent_prev = 0
for mentry in list_items:
count += 1
entry = mentry["source"]
id = entry.get("id", "")
qanon_id = entry.get("qanon_id", "")
eid = qanon_id
percent = int((count / len(list_items)) * 100)
if percent != percent_prev:
print("progress -> %.2f %%" % percent)
percent_prev = percent
# if not qanon_id == "qq296834" :
# continue
ref_id = entry.get("ref_id", "")
ref_key = entry.get("ref_key", "")
title_popular = entry.get("title_popular", "")
title = entry.get("title", "")
title_type = entry.get("title_type", "")
ts_year = entry.get("ts_year", "")
ts_ref = entry.get("ts_ref", "")
sub_type = entry.get("sub_type", "")
qanon_etebar = entry.get("qanon_etebar", "")
sort_date_timestamp = entry.get("sort_date_timestamp", "")
ts_date = entry.get("ts_date", "")
ts_date, err_msg = convert_persian_date(ts_date)
expire_date = entry.get("expire_date", "")
expire_date, err_msg = convert_persian_date(expire_date)
aproveDate = entry.get("aproveDate", "")
aproveDate, err_msg = convert_persian_date(aproveDate)
content = entry.get("content", "")
content = text_normal.normalize_qanon(content)
html = entry.get("html", "")
html = text_normal.yeke_normal(html)
content_len = entry.get("content_len", "")
eblagh_number = validate_value(entry.get("eblagh_number", ""))
eblagh_date = entry.get("eblagh_date", "")
eblagh_date, err_msg = convert_persian_date(eblagh_date)
eblagh = {}
if eblagh_number or eblagh_date:
eblagh["number"] = eblagh_number
if eblagh_date:
eblagh["date"] = eblagh_date
item = {}
is_update = True
try:
item = elastic.get_document(index_name_o, eid)
except:
is_update = False
data = {}
if not is_update:
main_type = "آراء"
data = {
"id": eid,
"ref_id": ref_id,
"ref_key": ref_key,
"main_type": main_type,
"sub_type": sub_type,
"title": title,
"ts_year": ts_year,
"ts_ref": ts_ref,
"qanon_etebar": qanon_etebar,
"sort_date_timestamp": sort_date_timestamp, # created from repairQanon.getSortTimestamp
}
if title_type:
data["title_type"] = title_type
if title_popular:
data["title_popular"] = title_popular
if ts_date:
data["ts_date"] = ts_date
if expire_date:
data["expire_date"] = expire_date
if aproveDate:
data["exec_date"] = aproveDate
if html: # ساختن دوباره و بهتر
content = html_to_text_preserve_lines(html)
content = text_normal.normalize_qanon(content)
content_len = len(content)
data["content"] = content
if html and isNeedHtml(html):
data["html"] = html
data["content_len"] = content_len
if eblagh:
data["eblagh"] = eblagh
if is_update:
bulk_list.append({"id": eid, "_source": data})
else:
bulk_list_import.append({"id": eid, "_source": data})
file1 = path_out + "1_opinion_update.json"
with open(file1, 'w', encoding='utf8') as f :
json.dump(bulk_list, f, ensure_ascii=False, indent=4)
file1 = path_out + "1_opinion_import.json"
with open(file1, 'w', encoding='utf8') as f :
json.dump(bulk_list_import, f, ensure_ascii=False, indent=4)
except Exception as e:
print("Exception: " + str(e))
@@ -3,7 +3,7 @@ from dotenv import load_dotenv
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")))
from app.common.text_normalizer import TextNormalizer
@@ -8,18 +8,18 @@ import zipfile
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")))
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from app.common.elastic_helper import ElasticHelper
from app.common.general_functions import *
from app.common.text_normalizer import TextNormalizer
from app.parvande_qanon.import_qavanin_excels_to_elastic import (
from app.parvande_qanon.s2_import_qavanin_excels_to_elastic import (
import_excel_before_to_elastic,
import_excel_after_to_elastic,
import_excel_tasmimat_to_elastic,
)
from app.parvande_qanon.repair_qa_qanon_for_map_new import *
from app.majles.repair_qa_qanon_for_map_new import *
text_normal = TextNormalizer()
@@ -29,12 +29,12 @@ 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")
host = os.getenv("HOST_112")
password = os.getenv("HOST_112_PASS")
host = os.getenv("HOST_H102")
password = os.getenv("HOST_H102_PASS")
# host = os.getenv("HOST_H102")
# password = os.getenv("HOST_H102_PASS")
# print( "---------------->>>>>>>>>>>>>>>", host )
# host=os.getenv('HOST_113')
@@ -230,6 +230,10 @@ file_path = "G:/Project2/160_dotic/mj_mashruh.zip"
file_path = 'G:/Project2/160_dotic/dotic_14040824/mj_qa_opinion_doctic_14040824.zip'
# import_content_opinion_to_qaqanon(elastic, file_path, "mj_qa_qanon" )
### ---موقت : یکبار
### بخاطر خطای داده در سرور مجلس
# extract_content_opinion_to_qaqanon(elastic, file_path, "mj_qa_qanon", 'G:/Project2/160_dotic/dotic_14040824/extract/' )
# # -------------------------------------
# # ----- انتقال داده های مشروح مذاکرات به فهرست همه قوانین
@@ -367,8 +371,6 @@ file_tasmim = "G:/Project2/160_dotic/duplicate_tasmim.json"
# elastic.backupIndexToZipfile("G:/Project2/102_gpu", "mj_qa_section_rule", "mj_qa_section_rule")
# elastic.backupIndexToZipfile("G:/Project2/160_dotic", "mj_mashruh", "mj_mashruh")
# elastic.backupIndexToZipfile("G:/Project2/160_dotic", "mj_qa_section", "mj_qa_section")
-349
View File
@@ -1,349 +0,0 @@
type_count = [
{
"key": "جلسه علمی",
"doc_count": 7332
},
{
"key": "منبر",
"doc_count": 3970
},
{
"key": "درس خارج",
"doc_count": 2450
},
{
"key": "تدریس",
"doc_count": 1401
},
{
"key": "سخنرانی",
"doc_count": 1221
},
{
"key": "-",
"doc_count": 992
},
{
"key": "مشاوره",
"doc_count": 858
},
{
"key": "مدیریت",
"doc_count": 652
},
{
"key": "مصاحبه",
"doc_count": 628
},
{
"key": "مباحثه و گفتگو",
"doc_count": 587
},
{
"key": "جزوه",
"doc_count": 583
},
{
"key": "مناظره و گفتگو",
"doc_count": 496
},
{
"key": "گزارش",
"doc_count": 395
},
{
"key": "--",
"doc_count": 250
},
{
"key": "جدول",
"doc_count": 208
},
{
"key": "کتاب",
"doc_count": 173
},
{
"key": "صورت جلسه",
"doc_count": 126
},
{
"key": "فهرست",
"doc_count": 124
},
{
"key": "ارائه",
"doc_count": 90
},
{
"key": "بازدید (دیدار)",
"doc_count": 83
},
{
"key": "مقاله",
"doc_count": 81
},
{
"key": "طرح",
"doc_count": 74
},
{
"key": "کلیپ",
"doc_count": 68
},
{
"key": "گزارش رصد",
"doc_count": 64
},
{
"key": "نامه",
"doc_count": 48
},
{
"key": "نمودار",
"doc_count": 45
},
{
"key": "آیین نامه",
"doc_count": 36
},
{
"key": "تقریر",
"doc_count": 35
},
{
"key": "خلاصه",
"doc_count": 25
},
{
"key": "پیش نویس",
"doc_count": 25
},
{
"key": "نقد",
"doc_count": 23
},
{
"key": "چکیده",
"doc_count": 16
},
{
"key": "یادبود",
"doc_count": 13
},
{
"key": "فرم",
"doc_count": 12
},
{
"key": "فرم فیش",
"doc_count": 11
},
{
"key": "مناجات",
"doc_count": 10
},
{
"key": "دعا و مناجات",
"doc_count": 8
},
{
"key": "فیش",
"doc_count": 6
},
{
"key": "پرسش و پاسخ",
"doc_count": 6
},
{
"key": "بیانیه",
"doc_count": 5
},
{
"key": "اجلاسیه",
"doc_count": 4
},
{
"key": "پایان نامه",
"doc_count": 4
},
{
"key": "",
"doc_count": 3
},
{
"key": "آئین نامه",
"doc_count": 3
},
{
"key": "رزومه",
"doc_count": 3
},
{
"key": "قرارداد",
"doc_count": 3
},
{
"key": "مصوبه",
"doc_count": 3
},
{
"key": "نمونه سوال",
"doc_count": 3
},
{
"key": "همایش",
"doc_count": 3
},
{
"key": "پژوهش",
"doc_count": 3
},
{
"key": "چارت",
"doc_count": 3
},
{
"key": "کنفرانس",
"doc_count": 3
},
{
"key": "تلخیص",
"doc_count": 2
},
{
"key": "قرائت زیارت",
"doc_count": 2
},
{
"key": "لیست",
"doc_count": 2
},{
"key": "متن جلسه",
"doc_count": 2
},
{
"key": "مستند تلوزیونی",
"doc_count": 2
},
{
"key": "نشست علمی",
"doc_count": 2
},
{
"key": "کتاب داخلی",
"doc_count": 2
},
{
"key": "گزارش جلسه",
"doc_count": 2
},
{
"key": "برنامه",
"doc_count": 1
},
{
"key": "بروشور",
"doc_count": 1
},
{
"key": "بزرگداشت",
"doc_count": 1
},
{
"key": "جزو",
"doc_count": 1
},
{
"key": "خطبه عقد(دائم)",
"doc_count": 1
},
{
"key": "روضه",
"doc_count": 1
},
{
"key": "زندگی نامه",
"doc_count": 1
},
{
"key": "زیارتنامه",
"doc_count": 1
},
{
"key": "سائر",
"doc_count": 1
},
{
"key": "سالگرد",
"doc_count": 1
},
{
"key": "سایر",
"doc_count": 1
},
{
"key": "طرج",
"doc_count": 1
},
{
"key": "عقد",
"doc_count": 1
},
{
"key": "ماتریس",
"doc_count": 1
},
{
"key": "مدل",
"doc_count": 1
},
{
"key": "مراحل دستیابی و به کارگیری الگوی پیشرفت اسلامی ـ ",
"doc_count": 1
},
{
"key": "مقالات",
"doc_count": 1
},
{
"key": "مقاله و ارائه",
"doc_count": 1
},
{
"key": "نماه",
"doc_count": 1
},
{
"key": "نمایه",
"doc_count": 1
},
{
"key": "هرم",
"doc_count": 1
},
{
"key": "پرسشنامه",
"doc_count": 1
},
{
"key": "پروژه",
"doc_count": 1
},
{
"key": "پیش نشست",
"doc_count": 1
},
{
"key": "کاربرگ",
"doc_count": 1
},
{
"key": "کتاب سایت",
"doc_count": 1
},
{
"key": "کمیسیون خبرگان",
"doc_count": 1
}
]
-160
View File
@@ -1,160 +0,0 @@
import traceback, os, orjson
import pandas as pd
from pathlib import Path
from dataParsers.app.common.elastic_helper import ElasticHelper
from dotenv import load_dotenv
def load_orjson(path: str | Path):
path = Path(path)
with path.open("rb") as f: # باید باینری باز بشه برای orjson
return orjson.loads(f.read())
def save_orjson(path, data):
with open(path, "wb") as f:
f.write(
orjson.dumps(data, option=orjson.OPT_INDENT_2 | orjson.OPT_NON_STR_KEYS)
)
def extract_excel_fields(file_path: str, fields: list = [], sheet_name: str = None):
"""
فایل اکسل را باز کرده و فقط فیلدهای خواسته‌شده را به‌صورت لیست از دیکشنری‌ها برمی‌گرداند.
:param file_path: مسیر فایل اکسل (.xlsx یا .xls)
:param fields: لیست نام ستون‌هایی که باید خوانده شوند
:return: لیستی از دیکشنری‌ها شامل داده‌های ستون‌های انتخاب‌شده
"""
try:
# خواندن فایل
df = pd.read_excel(file_path, sheet_name=sheet_name)
df.columns = df.columns.map(str)
if len(fields) > 0:
missing = [f for f in fields if f not in df.columns]
if missing:
print(f"⚠️ This columns mot found in file {missing}")
# for i in df.columns:
# print(f'-field ->{i}<-')
df = df[[f for f in fields if f in df.columns]]
# تبدیل به لیست از دیکشنری‌ها
data = df.to_dict(orient="records")
return data
except Exception as e:
print(f"❌ خطا در خواندن فایل اکسل: {e}")
return []
def save_excel(file_path: str, data: list):
"""ذخیره‌ی داده‌ها در فایل اکسل جدید"""
try:
df = pd.DataFrame(data)
df.to_excel(file_path, index=False)
print(f"✅ فایل با موفقیت ذخیره شد: {file_path}")
except Exception as e:
print(f"❌ خطا در ذخیره فایل اکسل: {e}")
def convert_data(item):
_id = "gnp" + str(item["id"])
tree_label = item["person_title"]
title = item["title"]
papa_id = item["papa_id"]
if papa_id == 0:
parent_id = str(0)
else:
parent_id = "gnp" + str(papa_id)
child_order = item["order"]
return {
"id": _id, # "gnt01741"
"version_key": "base_1",
"tree_key": "tree1",
"tree_label": tree_label, # "فهرست موضوعات مسائل و پاسخها",
"main_type": "tree",
"title": title, # "پیامدهای روبنایی",
"parent_id": parent_id,
"child_order": child_order,
"tags": [],
"meta_info": {},
}
load_dotenv()
es_pass = os.getenv("ES_PASSWORD")
es_url = os.getenv("ES_URL")
es_user = os.getenv("ES_USER_NAME")
es_index_name = os.getenv("GNP_TREE_INDEX_NAME")
es_helper = ElasticHelper(es_pass=es_pass, es_url=es_url, es_user=es_user)
if __name__ == "__main__":
file_path = r"D:\init_mahdi\dataParsers\041106_لیست تمام موضوعات.xlsx"
data_excel = extract_excel_fields(file_path, sheet_name="Sheet1")
print(f'data_excel {len(data_excel)}')
try:
f_data = []
for i in data_excel:
f_data.append(convert_data(i))
except Exception as e:
print(
f"*************",
)
traceback.print_exc()
print(f'f_data {len(f_data)}')
output_path = r"D:\init_mahdi\dataParsers\041106_لیست تمام موضوعات.json"
save_orjson(path=output_path, data=f_data)
bulk_data=[]
index_name_o = es_index_name
elastic = es_helper
total_count = 0
data_list = f_data
i = 0
for data in data_list :
eid = data["id"]
i = i + 1
if len(bulk_data) >= 100:
total_count += len(bulk_data)
print('=' * 10, 'to_elastic , total='+str(total_count) , str(i)+ ', id=' + eid )
elastic.importBulkList(bulk_data, index_name_o)
bulk_data = []
bulk_data.append(
{
'_id' : eid,
'_source' : data
}
)
if len(bulk_data) > 0:
total_count += len(bulk_data)
print('=' * 10, ' to_elastic , total='+str(total_count) )
elastic.importBulkList(bulk_data, index_name_o)
bulk_data = []
print("end success import_to_elastic")
# for i in f_data:
# es_res = es_helper.update_index_doc(
# is_update_state=False,
# index_name_o=es_index_name,
# eid=i["id"],
# data=i,
# )
# python -m dataParsers.app.monir.gnp_tree
@@ -8,7 +8,7 @@ import pandas as pd
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")))
from app.common.elastic_helper import ElasticHelper
@@ -16,7 +16,7 @@ from app.common.general_functions import *
from app.common.text_normalizer import TextNormalizer
from app.monir_options import (
from app.monir.monir_options import (
get_public_options,
get_monir_options
)
@@ -24,10 +24,6 @@ from app.monir_options import (
load_dotenv(dotenv_path="config.env")
# host = os.getenv("HOST_160")
# host = os.getenv("HOST_160_LOCAL")
# password = os.getenv("HOST_160_PASS")
host = os.getenv("HOST_60")
password = os.getenv("HOST_60_PASS")
@@ -527,15 +523,22 @@ if __name__ == "__main__":
###### -------------- gn_option -----------------------------
# import_option_base_list(elastic, "gn_option")
# import_option_base_list(elastic, "gn_option")
# import_option_ostan_shahr(elastic, "gn_option")
###### -------------- -----------------------------
# elastic.backupIndexToZipfile("G:/Project2/111", "mn_sanad_temp", "mn_sanad")
# elastic.backupIndexToZipfile("G:/Project2/111", "mn_steps_temp", "mn_steps")
# elastic.backupIndexToZipfile("G:/Project2/111", "gn_calendar", "gn_calendar")
# elastic.backupIndexToZipfile("G:/Project2/133_monir", "mn_sanad_temp", "mn_sanad")
# elastic.backupIndexToZipfile("G:/Project2/133_monir", "mn_steps_temp", "mn_steps")
# elastic.backupIndexToZipfile("G:/Project2/133_monir", "gn_calendar", "gn_calendar")
###### -------------- -----------------------------
# elastic.backupIndexToZipfile("G:/Project2/133_monir", "gn_tree", "gn_tree")
# elastic.backupIndexToZipfile("G:/Project2/133_monir", "gn_option", "gn_option")
# elastic.backupIndexToZipfile("G:/Project2/133_monir", "mn_voice", "mn_voice")
+153
View File
@@ -0,0 +1,153 @@
import numbers
import os
from dotenv import load_dotenv
from elasticsearch import Elasticsearch, helpers
from elasticsearch.helpers import scan
import json
import re
import time, traceback, uuid, orjson, jdatetime, re
from datetime import datetime, timezone
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")))
from app.common.text_normalizer import TextNormalizer
from app.common.general_functions import *
from app.common.elastic_helper import ElasticHelper
text_normal = TextNormalizer()
load_dotenv(dotenv_path='config.env')
host=os.getenv('HOST_60')
password=os.getenv('HOST_60_PASS')
# print( "---------------->>>>>>>>>>>>>>>", host )
# host=os.getenv('HOST_113')
# password=os.getenv('HOST_113_PASS')
print('.... majles_codes_update_steps ......', host)
path_base_map = "G:/Project2/gateway_php/repo/_other/"
elastic = ElasticHelper(host, password, "elastic", path_base_map)
index_name_o = "mn_voice"
path_files = "app/../data/monir/spr_v1/farhangestan-output"
bulk_data = []
total_count = 0
files = get_files(path_files, r"(\d+)\.json$")
# files = get_files(path_files)
for file in files :
print(file)
data = {}
try :
with open(file, "r", encoding="utf8") as f:
data = json.load(f)
eid = data["_id"]
try:
res = elastic.get_document(index_name_o, eid)
source = res["_source"]
continue
except:
pass
sound_files = data["sound_files"]
sound_link = sound_files[0]["link"]
sound_title = sound_files[0]["title"]
author = data["author"]
branch = data["branch"]
title = data["title"]
begin_date = data["begin_date"]
begin_year = data["begin_year"]
meet_code = data["meet_code"]
meet_no = data["meet_no"]
person_code = data["person_code"]
city = data["city"]
place = data["place"]
_format = data["format"]
words = []
transcript = data["transcript"]
content = ""
if transcript :
content = transcript[0]["full_text"]
words = transcript[0]["words"]
else :
if "content" in data :
content = data["content"]
if "words_align" in data :
words = data["words_align"]
content = text_normal.normalize_qanon(content)
content = content.strip().strip('\r\t\n')
word_times = []
for w in words :
word_times.append(w["start"])
data_item = {
"id": eid,
"title": title,
"author": author,
"branch": branch,
"begin_date": begin_date,
"meet_code": meet_code,
"meet_no": meet_no,
"person_code": person_code,
"city": city,
"place": place,
"format": _format,
"content": content,
"sound_link": sound_link,
"sound_title": sound_title,
"word_times" : word_times
}
bulk_data.append(
{"_id": eid, "_source": data_item}
)
if len(bulk_data) >= 100:
total_count += len(bulk_data)
print(
"=" * 10, "to_elastic , total=" + str(total_count)
)
elastic.importBulkList(bulk_data, index_name_o)
bulk_data = []
except Exception as e:
print("error in file " + file + str(e))
if len(bulk_data) >= 0:
total_count += len(bulk_data)
print(
"=" * 10, "to_elastic , total=" + str(total_count)
)
elastic.importBulkList(bulk_data, index_name_o)
bulk_data = []
@@ -459,5 +459,9 @@ def main_proccess():
### --------------------------------------
### استخراج فایلهای مرتبط با هر قانون در اکسل خروجی
### qavanin_output4.xlsx
### --------------------------------------
if __name__ == "__main__":
main_proccess()
@@ -45,7 +45,7 @@ def validate_id(value) :
value = value.split('?')[0]
return value
#### ارسال اطلاعات از اکسل قبل انقلاب به ایندکس الاستیک mj_qa_qanon
def import_excel_before_to_elastic(elastic, path_file, index_name_o, duplicate_list):
bulk_data_import=[]
bulk_data_update=[]
@@ -315,7 +315,7 @@ def import_excel_before_to_elastic(elastic, path_file, index_name_o, duplicate_l
traceback.print_exc()
#### ارسال اطلاعات از اکسل بعد انقلاب به ایندکس الاستیک mj_qa_qanon
def import_excel_after_to_elastic(elastic, path_file, index_name_o, duplicate_list):
bulk_data_import=[]
bulk_data_update=[]
@@ -551,7 +551,7 @@ def import_excel_after_to_elastic(elastic, path_file, index_name_o, duplicate_li
traceback.print_exc()
#### ارسال تصمیمات قانونی از اکسل قبل انقلاب به ایندکس الاستیک mj_qa_qanon
def import_excel_tasmimat_to_elastic(elastic, path_file, index_name_o, duplicate_list ):
error_list = []
bulk_data_import=[]
-23
View File
@@ -1,23 +0,0 @@
from app.common.config_base import *
from app.common.general_functions import *
import requests
url = " https://tavasi.ir/api/nlp/keywords?content="
headers = HEADERS
text = '''
دیپلماسی اقتصادی: مجموعه اقدامات و فعالیت های اقتصادی خارجی (توسط دولت یا بخش خصوصی با هماهنگی وزارت امورخارجه) که با هدف توسعه روابط اقتصادی و تجاری با کشورهای خارجی، در جهت دستیابی به اهداف نظیر افزایش دسترسی به بازارهای بین المللی کالاها و خدمات، سرمایه گذاری خارجی، تبادل فناوری و برقراری روابط پایدار با سایر کشورها انجام می شود.
'''
url = url + text
payload = {}
response = requests.request("GET", url, headers=headers, data=payload)
entities = ''
i = len(response.text.strip())-3
keywords = response.text[13:i].split(',')
# for entity in keywords:
# entities = entities + str(entity).strip('\"') +' ' + '\n'
print(keywords)
-533
View File
@@ -1,533 +0,0 @@
{
"1": {
"id": 8057,
"title": "بخش اول: تشکیلات، اهداف و وظایف آموزش و پرورش",
"projectid": 103,
"meta": "",
"childorder": 1,
"listtype": 0,
"parent": 0
},
"2": {
"id": 8058,
"title": "فصل اول : تشکیل وزارت آموزش و پرورش",
"projectid": 103,
"meta": "",
"childorder": 1,
"listtype": 0,
"parent": 8057
},
"3": {
"id": 8059,
"title": "مبحث اول: اهداف و وظایف وزارت آموزش و پرورش",
"projectid": 103,
"meta": "",
"childorder": 1,
"listtype": 0,
"parent": 8058
},
"4": {
"id": 8060,
"title": "مبحث دوم: وظایف آموزش و پرورش در قبال سایر دستگاهها و نهادها",
"projectid": 103,
"meta": "",
"childorder": 2,
"listtype": 0,
"parent": 8058
},
"5": {
"id": 8061,
"title": "مبحث سوم: وظایف سایر دستگاهها و نهادها در حوزه آموزش و پرورش",
"projectid": 103,
"meta": "",
"childorder": 3,
"listtype": 0,
"parent": 8058
},
"6": {
"id": 8062,
"title": "فصل دوم: شوراها",
"projectid": 103,
"meta": "",
"childorder": 2,
"listtype": 0,
"parent": 8057
},
"7": {
"id": 8063,
"title": "مبحث اول: شورای عالی آموزش و پرورش",
"projectid": 103,
"meta": "",
"childorder": 4,
"listtype": 0,
"parent": 8058
},
"8": {
"id": 8064,
"title": "مبحث دوم: شوراهای آموزش و پرورش در استانها، شهرستانها و مناطق کشور",
"projectid": 103,
"meta": "",
"childorder": 5,
"listtype": 0,
"parent": 8058
},
"9": {
"id": 8065,
"title": "فصل سوم: سازمانهای وابسته",
"projectid": 103,
"meta": "",
"childorder": 3,
"listtype": 0,
"parent": 8057
},
"10": {
"id": 8066,
"title": "مبحث اول: سازمان پژوهش و برنامه ریزی آموزشی",
"projectid": 103,
"meta": "",
"childorder": 6,
"listtype": 0,
"parent": 8058
},
"11": {
"id": 8067,
"title": "مبحث دوم: سازمان نوسازی و توسعه و تجهیز مدارس کشور",
"projectid": 103,
"meta": "",
"childorder": 7,
"listtype": 0,
"parent": 8058
},
"12": {
"id": 8068,
"title": "مبحث سوم: سازمان آموزش و پرورش استثنایی",
"projectid": 103,
"meta": "",
"childorder": 8,
"listtype": 0,
"parent": 8058
},
"13": {
"id": 8069,
"title": "مبحث چهارم: سازمان مدارس و مراکز غیر دولتی و توسعه مشارکت های مردمی",
"projectid": 103,
"meta": "",
"childorder": 9,
"listtype": 0,
"parent": 8058
},
"14": {
"id": 8070,
"title": "مبحث پنجم: سازمان نهضت سواد آموزی",
"projectid": 103,
"meta": "",
"childorder": 10,
"listtype": 0,
"parent": 8058
},
"15": {
"id": 8071,
"title": "مبحث ششم: سازمانهای ایجاد شده به موجب مصوبات شورای عالی انقلاب فرهنگی",
"projectid": 103,
"meta": "",
"childorder": 11,
"listtype": 0,
"parent": 8058
},
"16": {
"id": 8072,
"title": "1- سازمان ملی پرورش استعدادهای درخشان (سمپاد)",
"projectid": 103,
"meta": "",
"childorder": 1,
"listtype": 0,
"parent": 8059
},
"17": {
"id": 8073,
"title": "2- سازمان ملی تعلیم و تربیت کودک",
"projectid": 103,
"meta": "",
"childorder": 2,
"listtype": 0,
"parent": 8059
},
"18": {
"id": 8074,
"title": "3- سازمان دانش آموزی",
"projectid": 103,
"meta": "",
"childorder": 3,
"listtype": 0,
"parent": 8059
},
"19": {
"id": 8075,
"title": "4- دانشگاه فرهنگیان",
"projectid": 103,
"meta": "",
"childorder": 4,
"listtype": 0,
"parent": 8059
},
"20": {
"id": 8076,
"title": "5- دانشگاه شهید رجایی",
"projectid": 103,
"meta": "",
"childorder": 5,
"listtype": 0,
"parent": 8059
},
"21": {
"id": 8077,
"title": "6- کانون پرورش فکری کودکان و نوجوانان",
"projectid": 103,
"meta": "",
"childorder": 6,
"listtype": 0,
"parent": 8059
},
"22": {
"id": 8078,
"title": "بخش دوم : امور اداری و استخدامی آموزش و پرورش",
"projectid": 103,
"meta": "",
"childorder": 2,
"listtype": 0,
"parent": 0
},
"23": {
"id": 8079,
"title": "فصل اول: امور اداری",
"projectid": 103,
"meta": "",
"childorder": 4,
"listtype": 0,
"parent": 8057
},
"24": {
"id": 8080,
"title": "مبحث اول: امور اداری وزارت",
"projectid": 103,
"meta": "",
"childorder": 12,
"listtype": 0,
"parent": 8058
},
"25": {
"id": 8081,
"title": "مبحث دوم: رتبه‌بندی معلمان",
"projectid": 103,
"meta": "",
"childorder": 13,
"listtype": 0,
"parent": 8058
},
"26": {
"id": 8082,
"title": "مبحث سوم: خرید خدمات",
"projectid": 103,
"meta": "",
"childorder": 14,
"listtype": 0,
"parent": 8058
},
"27": {
"id": 8083,
"title": "فصل دوم: امور استخدامی",
"projectid": 103,
"meta": "",
"childorder": 5,
"listtype": 0,
"parent": 8057
},
"28": {
"id": 8084,
"title": "مبحث اول: متعهدین خدمت",
"projectid": 103,
"meta": "",
"childorder": 15,
"listtype": 0,
"parent": 8058
},
"29": {
"id": 8085,
"title": "مبحث دوم: حق التدریس",
"projectid": 103,
"meta": "",
"childorder": 16,
"listtype": 0,
"parent": 8058
},
"30": {
"id": 8086,
"title": "مبحث سوم: امور رفاهی معلمان",
"projectid": 103,
"meta": "",
"childorder": 17,
"listtype": 0,
"parent": 8058
},
"31": {
"id": 8087,
"title": "فصل سوم: عضویت در مجامع و شوراها",
"projectid": 103,
"meta": "",
"childorder": 6,
"listtype": 0,
"parent": 8057
},
"32": {
"id": 8088,
"title": "بخش سوم : اموال و امور مالی",
"projectid": 103,
"meta": "",
"childorder": 3,
"listtype": 0,
"parent": 0
},
"33": {
"id": 8089,
"title": "فصل اول: املاک و فضاهای آموزشی و پرورشی",
"projectid": 103,
"meta": "",
"childorder": 7,
"listtype": 0,
"parent": 8057
},
"34": {
"id": 8090,
"title": "مبحث اول: تامین فضاهای آموزشی و پرورشی",
"projectid": 103,
"meta": "",
"childorder": 18,
"listtype": 0,
"parent": 8058
},
"35": {
"id": 8091,
"title": "مبحث دوم: فروش و واگذاری",
"projectid": 103,
"meta": "",
"childorder": 19,
"listtype": 0,
"parent": 8058
},
"36": {
"id": 8092,
"title": "فصل دوم: بودجه و امور مالی",
"projectid": 103,
"meta": "",
"childorder": 8,
"listtype": 0,
"parent": 8057
},
"37": {
"id": 8093,
"title": "مبحث اول: بودجه",
"projectid": 103,
"meta": "",
"childorder": 20,
"listtype": 0,
"parent": 8058
},
"38": {
"id": 8094,
"title": "مبحث دوم: درآمد و مخارج",
"projectid": 103,
"meta": "",
"childorder": 21,
"listtype": 0,
"parent": 8058
},
"39": {
"id": 8095,
"title": "مبحث سوم: معافیت های مالی، مالیاتی و گمرکی",
"projectid": 103,
"meta": "",
"childorder": 22,
"listtype": 0,
"parent": 8058
},
"40": {
"id": 8096,
"title": "بخش چهارم: امور دانش آموزان",
"projectid": 103,
"meta": "",
"childorder": 4,
"listtype": 0,
"parent": 0
},
"41": {
"id": 8097,
"title": "فصل اول: ثبت نام و تحصیل",
"projectid": 103,
"meta": "",
"childorder": 9,
"listtype": 0,
"parent": 8057
},
"42": {
"id": 8098,
"title": "مبحث اول: ثبت نام",
"projectid": 103,
"meta": "",
"childorder": 23,
"listtype": 0,
"parent": 8058
},
"43": {
"id": 8099,
"title": "مبحث دوم: تحصیل",
"projectid": 103,
"meta": "",
"childorder": 24,
"listtype": 0,
"parent": 8058
},
"44": {
"id": 8100,
"title": "مبحث سوم: نظام وظیفه",
"projectid": 103,
"meta": "",
"childorder": 25,
"listtype": 0,
"parent": 8058
},
"45": {
"id": 8101,
"title": "فصل دوم: تشکل‌های دانش آموزی",
"projectid": 103,
"meta": "",
"childorder": 10,
"listtype": 0,
"parent": 8057
},
"46": {
"id": 8102,
"title": "مبحث اول: سازمان بسیج دانش‌آموزی",
"projectid": 103,
"meta": "",
"childorder": 26,
"listtype": 0,
"parent": 8058
},
"47": {
"id": 8103,
"title": "مبحث دوم: تعاون آموزشگاهی",
"projectid": 103,
"meta": "",
"childorder": 27,
"listtype": 0,
"parent": 8058
},
"48": {
"id": 8104,
"title": "مبحث سوم: اتحادیه انجمن اسلامی دانش آموزان",
"projectid": 103,
"meta": "",
"childorder": 28,
"listtype": 0,
"parent": 8058
},
"49": {
"id": 8105,
"title": "بخش پنجم: امور مدارس",
"projectid": 103,
"meta": "",
"childorder": 5,
"listtype": 0,
"parent": 0
},
"50": {
"id": 8106,
"title": "فصل اول: تاسیس و اداره مدارس شبانه روزی و مدارس نمونه دولتی",
"projectid": 103,
"meta": "",
"childorder": 11,
"listtype": 0,
"parent": 8057
},
"51": {
"id": 8107,
"title": "مبحث اول: مدارس شبانه روزی",
"projectid": 103,
"meta": "",
"childorder": 29,
"listtype": 0,
"parent": 8058
},
"52": {
"id": 8108,
"title": "مبحث دوم: مدارس نمونه دولتی",
"projectid": 103,
"meta": "",
"childorder": 30,
"listtype": 0,
"parent": 8058
},
"53": {
"id": 8109,
"title": "فصل دوم: تاسیس و اداره مدارس غیر‌دولتی",
"projectid": 103,
"meta": "",
"childorder": 12,
"listtype": 0,
"parent": 8057
},
"54": {
"id": 8110,
"title": "مبحث اول: داخل کشور",
"projectid": 103,
"meta": "",
"childorder": 31,
"listtype": 0,
"parent": 8058
},
"55": {
"id": 8111,
"title": "مبحث دوم: خارج کشور",
"projectid": 103,
"meta": "",
"childorder": 32,
"listtype": 0,
"parent": 8058
},
"56": {
"id": 8112,
"title": "فصل سوم: تاسیس و اداره مدارس اقلیت های دینی",
"projectid": 103,
"meta": "",
"childorder": 13,
"listtype": 0,
"parent": 8057
},
"57": {
"id": 8113,
"title": "بخش ششم: جرایم و تخلفات",
"projectid": 103,
"meta": "",
"childorder": 6,
"listtype": 0,
"parent": 0
},
"58": {
"id": 8114,
"title": "فصل اول: جرایم",
"projectid": 103,
"meta": "",
"childorder": 14,
"listtype": 0,
"parent": 8057
},
"59": {
"id": 8115,
"title": "فصل دوم: تخلفات",
"projectid": 103,
"meta": "",
"childorder": 15,
"listtype": 0,
"parent": 8057
}
}
-371
View File
@@ -1,371 +0,0 @@
{
"1": {
"id": 8116,
"title": "فصل اول - ساختار و تشکیلات",
"projectid": 133,
"meta": "",
"childorder": 1,
"listtype": 0,
"parent": 0
},
"2": {
"id": 8117,
"title": "مبحث اول- وزارت فرهنگ و ارشاد اسلامی",
"projectid": 133,
"meta": "",
"childorder": 1,
"listtype": 0,
"parent": 8116
},
"3": {
"id": 8118,
"title": "گفتار یک - اهداف",
"projectid": 133,
"meta": "",
"childorder": 1,
"listtype": 0,
"parent": 8117
},
"4": {
"id": 8119,
"title": "کفتار دو - وظایف",
"projectid": 133,
"meta": "",
"childorder": 2,
"listtype": 0,
"parent": 8117
},
"5": {
"id": 8120,
"title": "گفتار سه- ساختار اداری",
"projectid": 133,
"meta": "",
"childorder": 3,
"listtype": 0,
"parent": 8117
},
"6": {
"id": 8121,
"title": "مبحث دوم - شورای عالی انقلاب فرهنگی",
"projectid": 133,
"meta": "",
"childorder": 2,
"listtype": 0,
"parent": 8116
},
"7": {
"id": 8122,
"title": "مبحث سوم - سازمان های وابسته به وزارت فرهنگ و ارشاد اسلامی",
"projectid": 133,
"meta": "",
"childorder": 3,
"listtype": 0,
"parent": 8116
},
"8": {
"id": 8123,
"title": "گفتار یک - مرکز مدارک فرهنگی انقلاب اسلامی",
"projectid": 133,
"meta": "",
"childorder": 4,
"listtype": 0,
"parent": 8117
},
"9": {
"id": 8124,
"title": "فصل دوم- کتابخانه ها",
"projectid": 133,
"meta": "",
"childorder": 2,
"listtype": 0,
"parent": 0
},
"10": {
"id": 8125,
"title": "مبحث اول- کتابخانه های عمومی",
"projectid": 133,
"meta": "",
"childorder": 4,
"listtype": 0,
"parent": 8116
},
"11": {
"id": 8126,
"title": "گفتار یک- هیئت امناء",
"projectid": 133,
"meta": "",
"childorder": 5,
"listtype": 0,
"parent": 8117
},
"12": {
"id": 8127,
"title": "گفتار دو- انجمن کتابخانه ها",
"projectid": 133,
"meta": "",
"childorder": 6,
"listtype": 0,
"parent": 8117
},
"13": {
"id": 8128,
"title": "گفتار سه- منابع مالی و اموال",
"projectid": 133,
"meta": "",
"childorder": 7,
"listtype": 0,
"parent": 8117
},
"14": {
"id": 8129,
"title": "گفتار چهار - وظایف دستگاه ها و سازوکار اجرایی",
"projectid": 133,
"meta": "",
"childorder": 8,
"listtype": 0,
"parent": 8117
},
"15": {
"id": 8130,
"title": "مبحث دوم - کتابخانه ملی",
"projectid": 133,
"meta": "",
"childorder": 5,
"listtype": 0,
"parent": 8116
},
"16": {
"id": 8131,
"title": "گفتار یک- اهداف",
"projectid": 133,
"meta": "",
"childorder": 9,
"listtype": 0,
"parent": 8117
},
"17": {
"id": 8132,
"title": "گفتار دو - هیئت امناء",
"projectid": 133,
"meta": "",
"childorder": 10,
"listtype": 0,
"parent": 8117
},
"18": {
"id": 8133,
"title": "گفتار سه - رئیس",
"projectid": 133,
"meta": "",
"childorder": 11,
"listtype": 0,
"parent": 8117
},
"19": {
"id": 8134,
"title": "گفتار چهار - منابع مالی و اموال",
"projectid": 133,
"meta": "",
"childorder": 12,
"listtype": 0,
"parent": 8117
},
"20": {
"id": 8135,
"title": "مبحث سوم- کتابخانه مجلس شورای اسلامی",
"projectid": 133,
"meta": "",
"childorder": 6,
"listtype": 0,
"parent": 8116
},
"21": {
"id": 8136,
"title": "گفتار یک- اهداف",
"projectid": 133,
"meta": "",
"childorder": 13,
"listtype": 0,
"parent": 8117
},
"22": {
"id": 8137,
"title": "گفتار دو - هیئت امناء",
"projectid": 133,
"meta": "",
"childorder": 14,
"listtype": 0,
"parent": 8117
},
"23": {
"id": 8138,
"title": "گفتار سه - رئیس",
"projectid": 133,
"meta": "",
"childorder": 15,
"listtype": 0,
"parent": 8117
},
"24": {
"id": 8139,
"title": "گفتار چهار - منابع مالی و اموال",
"projectid": 133,
"meta": "",
"childorder": 16,
"listtype": 0,
"parent": 8117
},
"25": {
"id": 8140,
"title": "فصل سوم - زبان و ادب فارسی",
"projectid": 133,
"meta": "",
"childorder": 3,
"listtype": 0,
"parent": 0
},
"26": {
"id": 8141,
"title": "مبحث اول- وظایف سازمان ها",
"projectid": 133,
"meta": "",
"childorder": 7,
"listtype": 0,
"parent": 8116
},
"27": {
"id": 8142,
"title": "گفتار یک- فرهنگستان ها",
"projectid": 133,
"meta": "",
"childorder": 17,
"listtype": 0,
"parent": 8117
},
"28": {
"id": 8143,
"title": "گفتار دو - صداوسیما",
"projectid": 133,
"meta": "",
"childorder": 18,
"listtype": 0,
"parent": 8117
},
"29": {
"id": 8144,
"title": "گفتار سه - سایر دستگاه ها",
"projectid": 133,
"meta": "",
"childorder": 19,
"listtype": 0,
"parent": 8117
},
"30": {
"id": 8145,
"title": "مبحث دوم- سازوکار اجرایی پاسداری از زبان",
"projectid": 133,
"meta": "",
"childorder": 8,
"listtype": 0,
"parent": 8116
},
"31": {
"id": 8146,
"title": "مبحث سوم - تخلفات",
"projectid": 133,
"meta": "",
"childorder": 9,
"listtype": 0,
"parent": 8116
},
"32": {
"id": 8147,
"title": "فصل چهارم- لباس و حجاب",
"projectid": 133,
"meta": "",
"childorder": 4,
"listtype": 0,
"parent": 0
},
"33": {
"id": 8148,
"title": "مبحث اول- وظایف دستگاه های اجرایی",
"projectid": 133,
"meta": "",
"childorder": 10,
"listtype": 0,
"parent": 8116
},
"34": {
"id": 8149,
"title": "گفتار یک - کمیته ی ویژه",
"projectid": 133,
"meta": "",
"childorder": 20,
"listtype": 0,
"parent": 8117
},
"35": {
"id": 8150,
"title": "گفتار دو - سایر دستگاه ها",
"projectid": 133,
"meta": "",
"childorder": 21,
"listtype": 0,
"parent": 8117
},
"36": {
"id": 8151,
"title": "مبحث دوم- سازوکار اجرایی حمایتی",
"projectid": 133,
"meta": "",
"childorder": 11,
"listtype": 0,
"parent": 8116
},
"37": {
"id": 8152,
"title": "فصل ینجم - فرهنگ دینی",
"projectid": 133,
"meta": "",
"childorder": 5,
"listtype": 0,
"parent": 0
},
"38": {
"id": 8153,
"title": "مبحث اول- حمایت از فرهنگ اسلامی",
"projectid": 133,
"meta": "",
"childorder": 12,
"listtype": 0,
"parent": 8116
},
"39": {
"id": 8154,
"title": "مبحث دوم- ترویج کتابت قرآن",
"projectid": 133,
"meta": "",
"childorder": 13,
"listtype": 0,
"parent": 8116
},
"40": {
"id": 8155,
"title": "مبحث سوم - فرهنگ انقلاب و شهادت",
"projectid": 133,
"meta": "",
"childorder": 14,
"listtype": 0,
"parent": 8116
},
"41": {
"id": 8156,
"title": "مبحث چهارم - حمایت از مردم فلسطین",
"projectid": 133,
"meta": "",
"childorder": 15,
"listtype": 0,
"parent": 8116
}
}
@@ -1,227 +0,0 @@
{
"1": {
"id": 8157,
"title": "فصل اول: مقررات عمومی",
"projectid": 145,
"meta": "",
"childorder": 1,
"listtype": 0,
"parent": 0
},
"2": {
"id": 8158,
"title": "مبحث اول: مفاهیم و اصطلاحات",
"projectid": 145,
"meta": "",
"childorder": 1,
"listtype": 0,
"parent": 8157
},
"3": {
"id": 8159,
"title": "مبحث دوم: اهداف",
"projectid": 145,
"meta": "",
"childorder": 2,
"listtype": 0,
"parent": 8157
},
"4": {
"id": 8160,
"title": "گفتار اول: اهداف ناظر بر مناطق آزاد تجاری ـ صنعتی",
"projectid": 145,
"meta": "",
"childorder": 1,
"listtype": 0,
"parent": 8158
},
"5": {
"id": 8161,
"title": "گفتار دوم: اهداف ناظر بر مناطق ویژه اقتصادی",
"projectid": 145,
"meta": "",
"childorder": 2,
"listtype": 0,
"parent": 8158
},
"6": {
"id": 8162,
"title": "مبحث سوم: قلمروی مناطق آزاد و ویژه",
"projectid": 145,
"meta": "",
"childorder": 3,
"listtype": 0,
"parent": 8157
},
"7": {
"id": 8163,
"title": "گفتار اول: قلمرو مناطق آزاد تجاری صنعتی",
"projectid": 145,
"meta": "",
"childorder": 3,
"listtype": 0,
"parent": 8158
},
"8": {
"id": 8164,
"title": "گفتار دوم: قلمرو مناطق ویژه اقتصادی",
"projectid": 145,
"meta": "",
"childorder": 4,
"listtype": 0,
"parent": 8158
},
"9": {
"id": 8165,
"title": "مبحث چهارم: وظایف و اختیارات افراد نهادهای مختلف در مناطق آزاد و ویژه",
"projectid": 145,
"meta": "",
"childorder": 4,
"listtype": 0,
"parent": 8157
},
"10": {
"id": 8166,
"title": "گفتار اول: وظایف افراد و نهادهای مختلف",
"projectid": 145,
"meta": "",
"childorder": 5,
"listtype": 0,
"parent": 8158
},
"11": {
"id": 8167,
"title": "گفتار دوم: اختیارات افراد و نهادهای مختلف",
"projectid": 145,
"meta": "",
"childorder": 6,
"listtype": 0,
"parent": 8158
},
"12": {
"id": 8168,
"title": "فصل دوم: نحوه اداره مناطق آزاد و ویژه",
"projectid": 145,
"meta": "",
"childorder": 2,
"listtype": 0,
"parent": 0
},
"13": {
"id": 8169,
"title": "مبحث اول: نحوه اداره مناطق آزاد تجاری - صنعتی",
"projectid": 145,
"meta": "",
"childorder": 5,
"listtype": 0,
"parent": 8157
},
"14": {
"id": 8170,
"title": "مبحث دوم: نحوه اداره مناطق ویژه اقتصادی",
"projectid": 145,
"meta": "",
"childorder": 6,
"listtype": 0,
"parent": 8157
},
"15": {
"id": 8171,
"title": "مقررات ورود و صدور کالا در مناطق ویژه",
"projectid": 145,
"meta": "",
"childorder": 7,
"listtype": 0,
"parent": 8158
},
"16": {
"id": 8172,
"title": "مبحث سوم: مدیریت منابع انسانی",
"projectid": 145,
"meta": "",
"childorder": 7,
"listtype": 0,
"parent": 8157
},
"17": {
"id": 8173,
"title": "مبحث چهارم: مدیریت درآمدها و هزینه‌ها",
"projectid": 145,
"meta": "",
"childorder": 8,
"listtype": 0,
"parent": 8157
},
"18": {
"id": 8174,
"title": "فصل سوم: مشوّق‌ها و معافیت‌های قانونی مناطق",
"projectid": 145,
"meta": "",
"childorder": 3,
"listtype": 0,
"parent": 0
},
"19": {
"id": 8175,
"title": "مبحث اول: معافیت‌های مالیاتی",
"projectid": 145,
"meta": "",
"childorder": 9,
"listtype": 0,
"parent": 8157
},
"20": {
"id": 8176,
"title": "مبحث دوم: معافیت‌های گمرکی",
"projectid": 145,
"meta": "",
"childorder": 10,
"listtype": 0,
"parent": 8157
},
"21": {
"id": 8177,
"title": "مبحث سوم: سایر مشوق‌ها",
"projectid": 145,
"meta": "",
"childorder": 11,
"listtype": 0,
"parent": 8157
},
"22": {
"id": 8178,
"title": "فصل چهارم: مقررات تکمیلی",
"projectid": 145,
"meta": "",
"childorder": 4,
"listtype": 0,
"parent": 0
},
"23": {
"id": 8179,
"title": "مبحث اول: تأسیس بانک‌ها، شرکت‌ها، موسسات اعتباری، موسسات بیمه، بورس‌ها، موسسات دانش‌بنیان و مراکز علمی",
"projectid": 145,
"meta": "",
"childorder": 12,
"listtype": 0,
"parent": 8157
},
"24": {
"id": 8180,
"title": "مبحث دوم: وضعیت حقوقی اراضی و نحوه انتقال زمین در مناطق آزاد و ویژه",
"projectid": 145,
"meta": "",
"childorder": 13,
"listtype": 0,
"parent": 8157
},
"25": {
"id": 8181,
"title": "مبحث سوم: احکام قانونی مرتبط با آیین‌نامه‌های اجرایی این قانون",
"projectid": 145,
"meta": "",
"childorder": 14,
"listtype": 0,
"parent": 8157
}
}
-402
View File
@@ -1,402 +0,0 @@
[
{
"title": "آب",
"projectid": 8,
"meta": "",
"otherid": 1,
"listtype": 0,
"id": 8007
},
{
"title": "آمار، برنامه و بودجه",
"projectid": 8,
"meta": "",
"otherid": 2,
"listtype": 0,
"id": 8008
},
{
"title": "آموزش و پرورش",
"projectid": 8,
"meta": "",
"otherid": 3,
"listtype": 0,
"id": 8009
},
{
"title": "آموزش عالی، پژوهش و فناوری",
"projectid": 8,
"meta": "",
"otherid": 4,
"listtype": 0,
"id": 8010
},
{
"title": "آیین دادرسی مدنی",
"projectid": 8,
"meta": "",
"otherid": 5,
"listtype": 0,
"id": 8011
},
{
"title": "آیین دادرسی اداری",
"projectid": 8,
"meta": "",
"otherid": 6,
"listtype": 0,
"id": 8012
},
{
"title": "آیین دادرسی کیفری",
"projectid": 8,
"meta": "",
"otherid": 7,
"listtype": 0,
"id": 8013
},
{
"title": "اداری و استخدامی",
"projectid": 8,
"meta": "",
"otherid": 8,
"listtype": 0,
"id": 8014
},
{
"title": "اموال و معاملات دولتی",
"projectid": 8,
"meta": "(با زیرفصل اجرای سیاستهای کلی اصل44)",
"otherid": 9,
"listtype": 0,
"id": 8015
},
{
"title": "اطلاعات، امنیت و نظامی، انتظامی",
"projectid": 8,
"meta": "",
"otherid": 10,
"listtype": 0,
"id": 8016
},
{
"title": "امور زیربنایی",
"projectid": 8,
"meta": "",
"otherid": 11,
"listtype": 0,
"id": 8017
},
{
"title": "انتخابات",
"projectid": 8,
"meta": "",
"otherid": 12,
"listtype": 0,
"id": 8018
},
{
"title": "اوقاف، اماکن دینی و امور مذهبی",
"projectid": 8,
"meta": "",
"otherid": 13,
"listtype": 0,
"id": 8019
},
{
"title": "ایثارگران",
"projectid": 8,
"meta": "",
"otherid": 14,
"listtype": 0,
"id": 8020
},
{
"title": "بانکداری",
"projectid": 8,
"meta": "",
"otherid": 15,
"listtype": 0,
"id": 8021
},
{
"title": "برق و انرژی‌های نوین",
"projectid": 8,
"meta": "",
"otherid": 16,
"listtype": 0,
"id": 8022
},
{
"title": "بیمه",
"projectid": 8,
"meta": "",
"otherid": 17,
"listtype": 0,
"id": 8023
},
{
"title": "پولی و مالی",
"projectid": 8,
"meta": " (با زیرفصل‌های سرمایه گذاری داخلی وخارجی ـ بازار سرمایه)",
"otherid": 18,
"listtype": 0,
"id": 8024
},
{
"title": "تأمین اجتماعی",
"projectid": 8,
"meta": "",
"otherid": 19,
"listtype": 0,
"id": 8025
},
{
"title": "تجارت",
"projectid": 8,
"meta": "(اعم از تجارت داخلی و خارجی)",
"otherid": 20,
"listtype": 0,
"id": 8026
},
{
"title": "تشکل‌های مدنی و احزاب",
"projectid": 8,
"meta": "",
"otherid": 21,
"listtype": 0,
"id": 8027
},
{
"title": "تشکیلات و امور اداری قوه قضائیه",
"projectid": 8,
"meta": "",
"otherid": 22,
"listtype": 0,
"id": 8028
},
{
"title": "تعاون",
"projectid": 8,
"meta": "",
"otherid": 23,
"listtype": 0,
"id": 8029
},
{
"title": "تعزیرات حکومتی",
"projectid": 8,
"meta": "(مجازات‌های غیرقضایی)",
"otherid": 24,
"listtype": 0,
"id": 8030
},
{
"title": "تقسیمات کشوری و مدیریت محلی",
"projectid": 8,
"meta": "",
"otherid": 25,
"listtype": 0,
"id": 8031
},
{
"title": "ثبت اسناد و املاک",
"projectid": 8,
"meta": "",
"otherid": 26,
"listtype": 0,
"id": 8032
},
{
"title": "حمل و نقل",
"projectid": 8,
"meta": "",
"otherid": 27,
"listtype": 0,
"id": 8033
},
{
"title": "خانواده",
"projectid": 8,
"meta": "",
"otherid": 28,
"listtype": 0,
"id": 8034
},
{
"title": "رسانه",
"projectid": 8,
"meta": "",
"otherid": 29,
"listtype": 0,
"id": 8035
},
{
"title": "سلامت",
"projectid": 8,
"meta": "",
"otherid": 30,
"listtype": 0,
"id": 8036
},
{
"title": "صنعت",
"projectid": 8,
"meta": "",
"otherid": 31,
"listtype": 0,
"id": 8037
},
{
"title": "ارتباطات و فناوری اطلاعات",
"projectid": 8,
"meta": "",
"otherid": 32,
"listtype": 0,
"id": 8038
},
{
"title": "فرهنگ و هنر",
"projectid": 8,
"meta": "",
"otherid": 33,
"listtype": 0,
"id": 8039
},
{
"title": "کار",
"projectid": 8,
"meta": "",
"otherid": 34,
"listtype": 0,
"id": 8040
},
{
"title": "کشاورزی و دامپروری",
"projectid": 8,
"meta": "(منابع طبیعی)",
"otherid": 35,
"listtype": 0,
"id": 8041
},
{
"title": "کیفری",
"projectid": 8,
"meta": "",
"otherid": 36,
"listtype": 0,
"id": 8042
},
{
"title": "مالکیت فکری",
"projectid": 8,
"meta": "",
"otherid": 37,
"listtype": 0,
"id": 8043
},
{
"title": "مالیات",
"projectid": 8,
"meta": "",
"otherid": 38,
"listtype": 0,
"id": 8044
},
{
"title": "محاسبات عمومی",
"projectid": 8,
"meta": "",
"otherid": 39,
"listtype": 0,
"id": 8045
},
{
"title": "محیط زیست",
"projectid": 8,
"meta": "(اراضی مربوط به محیط زیست (خاک) زیر این کد قرار میگیرد)",
"otherid": 40,
"listtype": 0,
"id": 8046
},
{
"title": "مدنی و امور حسبی",
"projectid": 8,
"meta": " (ثبت احوال،تابعیت واتباع خارجی از سرفصل‌های این کد است)",
"otherid": 41,
"listtype": 0,
"id": 8047
},
{
"title": "مسکن و شهرسازی",
"projectid": 8,
"meta": " (اراضی مربوط به مسکن و شهرسازی زیر این کد قرار میگیرد)",
"otherid": 42,
"listtype": 0,
"id": 8048
},
{
"title": "مصرف",
"projectid": 8,
"meta": " (با زیرفصل قانون سازمان ملی استاندارد، سایر قوانین و مقررات استاندارد در زیر هر یک از کدهای مربوطه قرار می گیرد)",
"otherid": 43,
"listtype": 0,
"id": 8049
},
{
"title": "معدن",
"projectid": 8,
"meta": "",
"otherid": 44,
"listtype": 0,
"id": 8050
},
{
"title": "مناطق آزاد و ویژه اقتصادی",
"projectid": 8,
"meta": "",
"otherid": 45,
"listtype": 0,
"id": 8051
},
{
"title": "میراث فرهنگی، گردشگری و صنایع دستی",
"projectid": 8,
"meta": "",
"otherid": 46,
"listtype": 0,
"id": 8052
},
{
"title": "نظام قانونگذاری",
"projectid": 8,
"meta": " (که شامل سه سرفصل مجلس شورای اسلامی متشکل از (تقنین و نظارت)، شورای نگهبان، مجمع تشخیص مصلحت نظام)",
"otherid": 47,
"listtype": 0,
"id": 8053
},
{
"title": "نظامهای صنفی و حرفهای",
"projectid": 8,
"meta": "",
"otherid": 48,
"listtype": 0,
"id": 8054
},
{
"title": "نفت و گاز",
"projectid": 8,
"meta": "",
"otherid": 49,
"listtype": 0,
"id": 8055
},
{
"title": "ورزش",
"projectid": 8,
"meta": "",
"otherid": 50,
"listtype": 0,
"id": 8056
}
]