diff --git a/.gitignore b/.gitignore index 053d60d..1c58fb2 100644 --- a/.gitignore +++ b/.gitignore @@ -100,3 +100,7 @@ ENV/ # mypy .mypy_cache/ /.project + + +# Database files (generated by code) +DB/ diff --git a/PR.py b/PR.py new file mode 100644 index 0000000..311d8f1 --- /dev/null +++ b/PR.py @@ -0,0 +1,123 @@ +# -*- coding: utf-8 -*- +""" +Created on Thu May 23 20:09:51 2019 + +@author: jarl +""" + +from sympy import symbols, Symbol, Function, solve, Eq, sympify, init_printing, Matrix, diff, summation, oo, exp, Sum, zeta + + +init_printing() +R, T_c, p_c, V_mc, C_a, C_b = symbols('R T_c p_c V_mc C_a C_b ') + +T, p, V_m, kappa, alfa, a, b = symbols('T p V_m, kappa alpha a b') + +V, n = symbols('V n') + +Z, Z_c, omega = symbols('Z Z_c omega') + +kappa_c = [0]*4 +for i in range(len(kappa_c)): + kappa_c[i] = Symbol("kappa_0c"+str(i)) +#kappa_c1, kappa_c2, kappa_c3, kappa_c4, omega = symbols('kappa_c1 kappa_c2 kappa_c3 kappa_c4 omega') + + + +#V_m = Z*R*T/p + +#C_a = 0.45724 +#C_b = 0.07780 +#R = 8.314 +#kappa_c1 = 0.37464 +#kappa_c2 = 1.54226 +#kappa_c3 = 0.26992 + + + + + +#a = C_a *R**2*T_c**2 /p_c +#b = C_b * R*T_c /p_c + + + + +kappa_PR = kappa_c[0] + kappa_c[1] *omega + kappa_c[2] * omega**2 +alfa_PR = (1+ kappa*(1- (T/T_c)**(sympify(1)/2) ))**2 + + + + +kappa_0_PRSV1 =kappa_c[0] + kappa_c[1] *omega + kappa_c[2] * omega**2 + kappa_c[3] * omega**3 +kappa_1, kappa_2, kappa_3 = symbols("kappa_1 kappa_2 kappa_3") +#kappa_PRSV1 = kappa_0_PRSV1 + kappa_1*(1 + (T/T_c)**(sympify(1)/2) ) * (0.7 - T/T_c ) +kappa_PRSV1 = kappa_0_PRSV1 + kappa_1*(1 + (T/T_c)**0.5 ) * (0.7 - T/T_c ) + +#kappa_PRSV2 = kappa_0_PRSV1 + (kappa_1 + kappa_2*(kappa_3-T/T_c)*(1- (T/T_c)**(sympify(1)/2)) ) * (1 + (T/T_c)**(sympify(1)/2) ) * (0.7 - T/T_c ) +kappa_PRSV2 = kappa_0_PRSV1 + (kappa_1 + kappa_2*(kappa_3-T/T_c)*(1- (T/T_c)**0.5) ) * (1 + (T/T_c)**0.5 ) * (0.7 - T/T_c ) + + + + +Cubic_State = Eq(p, R*T/(V_m-b) - a*alfa/(V_m**2 +2*b*V_m - b**2)) + +PR = Cubic_State.subs(alfa, alfa_PR.subs(kappa, kappa_PR) ) +PRSV1 = Cubic_State.subs(alfa, alfa_PR.subs(kappa, kappa_PRSV1) ) +PRSV2 = Cubic_State.subs(alfa, alfa_PR.subs(kappa, kappa_PRSV2)) + + + +#PR_Z_c = Matrix( solve( PR.subs(p, p_c).subs(T, T_c).subs(V_m, Z_c*R*T_c/p_c ), Z_c) ) +#PR_V_c = Matrix( solve( PR.subs(p, p_c).subs(T, T_c), V_m ) ) + +#V_m_c = PR_Z_c*R*T_c/p_c + +Critical_state_conds_PR = Matrix([ PR , Eq( diff(PR.rhs, V_m), 0) , Eq( diff(PR.rhs, V_m, 2), 0) ]).subs(p, p_c).subs(T, T_c).subs(V_m, V_mc) # .subs(V_m, Z_c*R*T_c/p_c ) + +solve_ab = solve(Critical_state_conds_PR[1:], [a, b] ) + +#PR_sol = PR.subs(a, solve_ab[0][0].evalf() ).subs(b, solve_ab[0][1].evalf() ) +PR_sol = PR.subs(a, solve_ab[0][0] ).subs(b, solve_ab[0][1] ) + + + +V_m_atCrit = Matrix(solve(PR.subs(T, T_c).subs(p, p_c), V_m)) +V_m_atCrit = V_m_atCrit.subs(a, solve_ab[0][0] ).subs(b, solve_ab[0][1] ) + +QA_Critical_Sate = Matrix( [ PR_sol, Eq( diff(PR_sol.rhs, V_m), 0), Eq( diff(PR_sol.rhs, V_m, 2), 0) ] ).subs(T, T_c).subs(V_m, V_mc).subs(p, p_c) +V_cm_sol = solve(QA_Critical_Sate[0], V_mc)[0] + + +#PR_sol2 = PR_sol.subs(V_mc, V_cm_sol ) +#V_m_CubicSol = solve(Cubic_State, V_m)[0].subs(alfa, alfa_PR.subs(kappa, kappa_PR) ).subs(a, solve_ab[0][0] ).subs(b, solve_ab[0][1] ).subs(V_mc, V_cm_sol ) + + +Van_der_Waals_EOS = Eq(p, R*T/(V_m - b) - a/V_m**2 ) + +Redlich_Kwong_EOS = Eq(p, R*T/(V_m -b) - a/(T**0.5 * V_m * (V_m + b))) + +Soave_Redlich_Kwong_EOS = Redlich_Kwong_EOS.subs(a, a*alfa) + + + +n, s, k, z, alpha_Bose = symbols('n s k z alpha_Bose') +#zeta = summation(1/(n**alpha_Bose), (n, 1, oo) ) +Li = summation(z**k/k**(alpha_Bose+1), (k, 1, oo) ) + + +Ideal_Bose_EOS = Eq(p*V_m, R*T* Li/zeta(alpha_Bose) * (T/T_c)**alpha_Bose) + + +rho_0, rho, A, B, v_D, p_CJ, R_1, R_2, e_0, M_W = symbols("rho_0 rho A B v_D p_CJ R_1 R_2 e_0 M_W") + +Jones_Wilkins_Lee_EOS = Eq(p, A*( 1 - omega/R_1/V)*exp(-R_1*V)+B*(1-omega/R_2/V)*exp(-R_2*V) + omega*e_0/V ) + +JWL_EOS_TNT = Jones_Wilkins_Lee_EOS.subs(V, rho_0/rho).subs(rho, M_W/V_m ).subs(rho_0, 1.63E3).subs(A, 373.8E9).subs(B, 3.747E9).subs(R_1, 4.15).subs(R_2, 0.9).subs(omega, 0.35).subs(e_0, 6E9) + + + + + + + diff --git a/PR_maple_vertif.mw b/PR_maple_vertif.mw new file mode 100644 index 0000000..a746107 --- /dev/null +++ b/PR_maple_vertif.mw @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHN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R_maple_vertif_MAS.bak new file mode 100644 index 0000000..c346efc --- /dev/null +++ b/PR_maple_vertif_MAS.bak @@ -0,0 +1,255 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzY7LUkjbWlHRiQ2JVEidUYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy1JI21vR0YkNi1RKiZjb2xvbmVxO0YnL0YzUSdub3JtYWxGJy8lJmZlbmNlR1EmZmFsc2VGJy8lKnNlcGFyYXRvckdGPS8lKXN0cmV0Y2h5R0Y9LyUqc3ltbWV0cmljR0Y9LyUobGFyZ2VvcEdGPS8lLm1vdmFibGVsaW1pdHNHRj0vJSdhY2NlbnRHRj0vJSdsc3BhY2VHUSwwLjI3Nzc3NzhlbUYnLyUncnNwYWNlR0ZMLUY2Ni1RIn5GJ0Y5RjtGPkZARkJGREZGRkgvRktRJjAuMGVtRicvRk5GUy1JI21uR0YkNiRRIjFGJ0Y5LUY2Ni1RIjtGJ0Y5RjsvRj9GMUZARkJGREZGRkhGUkZNRk8tSSVtc3ViR0YkNiYtRiw2JVEiQ0YnRi9GMi1GIzYlLUYsNiVRInlGJ0YvRjJGL0YyLyUvc3Vic2NyaXB0c2hpZnRHUSIwRicvSSttc2VtYW50aWNzR0YkUSdhdG9taWNGJ0ZPRjUtRlY2JFEkMC40RidGOUZZRk8tRmhuNiZGam4tRiM2JS1GLDYlUSJ6RidGL0YyRi9GMkZib0Zlb0Y1LUZWNiRRJTAuMDdGJ0Y5RllGTy1GLDYlUSJuRidGL0YyRk9GNUZPLUZWNiRRJDAuNUYnRjlGWS8lK2V4ZWN1dGFibGVHRj1GOQ== + +LV9JLFR5cGVzZXR0aW5nRzYkJSpwcm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bGljRicvJS5saW5ldGhpY2tuZXNzR0Y5LyUrZGVub21hbGlnbkdRJ2NlbnRlckYnLyUpbnVtYWxpZ25HRksvJSliZXZlbGxlZEdRJmZhbHNlRicvJStleGVjdXRhYmxlR0ZQRjpGOi1GIzYlLUY0NihGNi1GIzYlLUY3NiRRJDEuNUYnRjpGQkZFRkdGSUZMRk5GQkZFLyUxc3VwZXJzY3JpcHRzaGlmdEdRIjBGJ0ZRRjo= + +JCIrIXBNVzojISM1 + + + +JSFH + + + \ No newline at end of file diff --git a/Vizualization_data.py b/Vizualization_data.py new file mode 100644 index 0000000..77039d1 --- /dev/null +++ b/Vizualization_data.py @@ -0,0 +1,52 @@ +thon# -*- coding: utf-8 -*- +""" +Created on Fri May 24 15:20:18 2019 + +@author: jarl +""" + +from matplotlib import pyplot as plt + +import numpy as np + +from sympy import Symbol + +import os + +import re + +import json + +PC_dir = './DB/Pure Component Properties (Several Properties)' + +json_df = {} +T_c = [] +P_c = [] +V_m_c = [] +R = 8.314 +Z_c = 0.307401 # Symbol('Z_c') + +for fileName in os.listdir(PC_dir): + if fileName[-5:] == '.json': + #json_files.append(fileName) + pf = open(PC_dir + '//' + fileName, 'r') + json_df.update( {fileName[:-5] : json.load(pf) } ) + pf.close() + + +for key in json_df.keys(): + content = json_df[key] + for prop in content.keys(): + if prop == 'Critical Data': + for i in range(len(content[prop]['T [K]'])): + if ( re.match( '\d' , content[prop]['T [K]'][i]) and re.match( '\d' , content[prop]['P [kPa]'][i]) ): + T_c.append( float( content[prop]['T [K]'][i] ) ) + P_c.append( float( content[prop]['P [kPa]'][i]) ) + V_m_c.append( Z_c *R * T_c[-1] / P_c[-1] ) + if prop == "Vapor Pressure" : + np.interp(0.7*) + +plt.figure() +plt.scatter(P_c, T_c) + + diff --git a/chemical_rate.py b/chemical_rate.py new file mode 100644 index 0000000..aeccaab --- /dev/null +++ b/chemical_rate.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +""" +Created on Tue Jun 4 00:11:44 2019 + +@author: jarl +""" + +from sympy import Eq, Symbol, symbols, solve, nsolve, diff, exp, init_printing + + +init_printing() + +kappa, k_B, T, h, DeltaG_react, R = symbols('kappa k_B T hbar DeltaG_react R') + + +k = kappa*k_B*T/h*exp(-DeltaG_react/R/T) + + + + diff --git a/downloader.py b/downloader.py index e252cb6..294d253 100644 --- a/downloader.py +++ b/downloader.py @@ -4,6 +4,7 @@ import re import time import pdb +import json Head = testScrape.DDBST_DB_free(0) @@ -41,10 +42,12 @@ def PCP_dwnld(verbose): table.append(table_temp) elif ChemName != Chem_n: - createFile(ChemName+'_'+CAS_cur+'.tsv',dir_name,table,'\t') + + createFile(str(ChemName)+'_'+str(CAS_cur)+'.tsv',dir_name,table,'\t') + createJsonFile(str(ChemName)+'_'+str(CAS_cur)+'.json',dir_name,table ) if verbose: - print 'Pure component propeties downloaded: ' + ChemName + '; CAS: ' + CAS_cur - print 'Compnent #' + str(subsNum) + ' of ' + Head[1][-1] + print ('Pure component propeties downloaded: ' + str(ChemName) + '; CAS: ' + str(CAS_cur) ) + print ('Compnent #' + str(subsNum) + ' of ' + str(Head[1][-1] )) subsNum += 1 @@ -60,8 +63,8 @@ def PCP_dwnld(verbose): continue # save the last entry - createFile(ChemName+'_'+CAS_cur+'.tsv',dir_name,table,'\t') - + createFile(str(ChemName)+'_'+str(CAS_cur)+'.tsv',dir_name,table,'\t') + createJsonFile(str(ChemName)+'_'+str(CAS_cur)+'.json',dir_name,table) #return table def createFile(fileName, filePath, contentMat, sepStr): @@ -71,7 +74,8 @@ def createFile(fileName, filePath, contentMat, sepStr): dirSplit = re.split('/',filePath) lc = './' for loc in dirSplit: - dirLst = os.walk(lc).next()[1] + os.walk(lc) + dirLst = os.walk(lc).send(None)[1] pathExsits = False @@ -109,10 +113,367 @@ def createFile(fileName, filePath, contentMat, sepStr): except: fileStream.write('SOME_ERROR_OCCOURED_HERE'+sepStr) - print 'createFile: error at writing file' + print ('createFile: error at writing file' ) fileStream.write('\n') fileStream.close() + +def createJsonFile(fileName, filePath, contentMat): + # Task 1: create relevant directories for the intended path + + dirSplit = re.split('/',filePath) + lc = './' + for loc in dirSplit: + os.walk(lc) + dirLst = os.walk(lc).send(None)[1] + + pathExsits = False + + for actDirs in dirLst: + if actDirs == loc: + pathExsits = True # path exsits + else: + continue + + if pathExsits: + lc += loc +'/' + #elif pathExsits == False: + else: + lc += loc + '/' + try: + os.mkdir(lc) + except: + #print 'directory exists!' + #print 'loc = ' + loc + #print 'actDirs = ' + actDirs + '\n\n' + [] + # Task 2 : export json structure to file + fileStream = open(filePath + '/' + fileName, 'w') + json_dict = {} + l = 1 + + if (contentMat[0][0][0] == 'Formula'): # i.e. pure substance data + for i in range(len(contentMat[0][0])): + json_dict.update({contentMat[0][0][i]: contentMat[0][1][i] }) + + for j in range (len(contentMat)): + temp_keys = [] + temp_values = [] + if (contentMat[j][0][0][0:3] == '$$$'): + main_key = contentMat[j][0][0][3:] + for k in range(len(contentMat[j+1][0])): + temp_keys.append( contentMat[j+1][0][k]) + temp_values.append([]) + l = 1 + while (contentMat[j+1][l][0] != 'Number'): + temp_values[k].append( contentMat[j+1][l][k] ) + l += 1 + + # find the references... + temp_keys.append('Reference') + temp_values.append([]) + for p in range(l+1, len(contentMat[j+1])): + temp_values[-1].append([contentMat[j+1][p][0], contentMat[j+1][p][1] ]) + + + temp_dict = {} + for u in range(len(temp_keys)): + temp_dict.update({ temp_keys[u] : temp_values[u] }) + json_dict.update({main_key: temp_dict}) + + else: + continue + + + + + elif (contentMat[0][0][0][0:3] == '$$$' ): # i.e. we have mixture data + ## copy pased code ::: + temp_keys = [] + temp_values = [] + temp_dict = {} + temp_dict2 = {} + i = 0 + DatasetName_index = [] + Component_header_index = [] + Component_index = [] + Constants_index = [] + Table_head_index = [] + Table_data_index = [] + Author_index = [] + #Constant_regex_pat = re.compile('[a-zA-Z]+') + #Table_head_regpat = re.compile('[a-z]{1, 99}\[[a-z]{1, 99}\]') +# while ( i < len(contentMat[0])): +# if (contentMat[0][i][0][:3] == '$$$'): +# main_key = contentMat[0][0][0][3:] +# i += 1 +# elif (contentMat[0][i][0] == 'No.'): +# for j in range(len(contentMat[0][i])): +# k=i + 1 +# temp_keys.append( contentMat[0][i][j]) +# temp_values +# try: +# while ( k < len(contentMat[0]) and int ( contentMat[0][k][0] ) > 0 ): +# temp_values.append(contentMat[0][k][j]) +# k += 1 +# except: +# ## component list is finished... +# +# temp_dict.update({temp_keys[0] : temp_values}) +# +# temp_keys = [] +# temp_values = [] +# #while ( k < len(contentMat[0]) and int ( contentMat[0][k][0] ) ): +# temp_dict2.update({'Components' : temp_dict }) + ## extract constant values: + + dataset_key = '' + dataset = {} + Source_set = [] + + Num_datadict = {} + Num_datadict_keys = [] + Num_datadict_values = [] + + Mix_params_dict = {} + Mix_params_keys = [] + Mix_params_values = [] + + const_dict = {} + const_keys = [] + const_values = [] + + + data_set_name = '' + + + for i in range(len(contentMat)): + for j in range(len(contentMat[i])): + if ( contentMat[i][j][0][0:3] == '$$$'): # find the title of the dataset + DatasetName_index.append([i, j]) + + + if ( j > 0 or i > 0): + # update the json dict of previous data + for k in range(len(Mix_params_keys)): + Mix_params_dict.update({Mix_params_keys[k] : Mix_params_values[k] }) + + for k in range(len(const_keys)): + const_dict.update({const_keys[k]: const_values[k]}) + + for k in range(len(Num_datadict_keys)): + Num_datadict.update({Num_datadict_keys[k] : Num_datadict_values[k] }) + + if (len(Num_datadict_keys) < 0.1): + print("no datadict keys!") + + + dataset.update({"Constants": const_dict}) + dataset.update({"Components": Mix_params_dict}) + dataset.update({"Table": Num_datadict }) + dataset.update({'Source' : Source_set}) + + + json_dict.update({data_set_name : dataset}) + + # rinse and repeat :) + dataset = {} + Num_datadict = {} + Num_datadict_keys = [] + Num_datadict_values = [] + + Mix_params_dict = {} + Mix_params_keys = [] + Mix_params_values = [] + + const_dict = {} + const_keys = [] + const_values = [] + + + + + + data_set_name = contentMat[i][j][0][3:] + + else: + data_set_name = contentMat[i][j][0][3:] + + + elif(contentMat[i][j][0] == 'No.' and re.match( '\d{1,3}', contentMat[i][j+1][0] ) ): # find header of the component list + Component_header_index.append([i, j]) + for k in range( len( contentMat[i][j])): + Mix_params_values.append([]) + Mix_params_keys.append(contentMat[i][j][k]) + elif( len( contentMat[i][j]) == 5 and re.match('^[a-zA-Z]', contentMat[i][j][1] ) and not re.match('^[a-zA-Z]{1,4}\d{0,2} \[.*?\]$', contentMat[i][j][0] ) ): # find component list entries + if( re.match('^\d', contentMat[i][j][2] ) and re.match('^\d{1,5}-\d{1,5}-\d{1,5}$', contentMat[i][j][3] ) ): + Component_index.append([i, j]) + #Mix_params_keys.append(contentMat[i][j][0]) + for k in range( len( contentMat[i][j])): + Mix_params_values[k].append(contentMat[i][j][k]) + + + + + + elif ( re.match( '^[a-zA-Z]{4,99}', contentMat[i][j][0] ) and len(contentMat[i][j]) == 3 and re.match( '^\d{0,99}.\d{0,99}', contentMat[i][j][1] ) and not re.match("\[", contentMat[i][j][0]) and contentMat[i][j][0] != 'Excess Volume [cm3/mol]' and contentMat[i][j][0] != 'Density [g/cm3]' ): # find contant value for the dataset: + if contentMat[i][j][1] != '': + #Constants_index.append([i, j]) + const_keys.append(contentMat[i][j][0]) + const_values.append(contentMat[i][j][1:]) + + elif ( re.match('[a-zA-Z]{1,25}\d{0,2} \[.*?\]$', contentMat[i][j][0] ) or contentMat[i][j][0] == 'Excess Heat Capacity [J/mol*K]' or contentMat[i][j][0] == 'Heat Capacity [J/mol*K]' or contentMat[i][j][0] == 'Excess Volume [cm3/mol]' or contentMat[i][j][0] == 'Excess Volume [cm3/mol]' ): #elif ( re.match( '^[a-zA-Z]{0,99} \[[a-zA-Z]{0,99}\]$' , contentMat[i][j][0] ) ): # find table heading + # the table headings + Table_head_index.append([i, j]) + for k in range(len(contentMat[i][j])): + Num_datadict_keys.append(contentMat[i][j][k]) + #Num_datadict.update({Num_datadict_keys , []}) + Num_datadict_values.append([]) + elif ( len(contentMat[i][j]) == len(Num_datadict_keys) and not re.match('^Source$' , contentMat[i][j][0]) ): #elif ( re.match( '^\d{0,9}.\d{0,9}$' , contentMat[i][j][0] ) or contentMat[i][j][0] == '^' ): # find numerical table entries + Table_data_index.append([i, j]) + for k in range(len(Num_datadict_keys)): + #Num_datadict.update({ Num_datadict_keys[k] : Num_datadict[ Num_datadict_keys[k] ].append(contentMat[i][j][k]) } ) + Num_datadict_values[k].append(contentMat[i][j][k]) + elif (re.match('^Source$' , contentMat[i][j][0]) ): + Author_index.append([i, j]) + elif (re.match('^[a-zA-Z]{1,999999}', contentMat[i][j][0]) and len(contentMat[i][j][0]) > 23 ): + Source_set.append(contentMat[i][j][0]) + + + # save the last entries + for k in range(len(Mix_params_keys)): + Mix_params_dict.update({Mix_params_keys[k] : Mix_params_values[k] }) + + for k in range(len(const_keys)): + const_dict.update({const_keys[k]: const_values[k]}) + + for k in range(len(Num_datadict_keys)): + Num_datadict.update({Num_datadict_keys[k] : Num_datadict_values[k] }) + + if (len(Num_datadict_keys) < 0.1): + print("no datadict keys!") + #if (len(Num_datadict_values[0]) < 0.1): + # print("no values??") + + dataset.update({"Constants": const_dict}) + dataset.update({"Components": Mix_params_dict}) + dataset.update({"Table": Num_datadict }) + dataset.update({'Source' : Source_set}) + + + + json_dict.update({data_set_name : dataset}) + + elif (contentMat[0][0][0][0:3] == 'No.' ): # i.e. we have mixture data + ## copy pased code ::: + temp_keys = [] + temp_values = [] + temp_dict = {} + temp_dict2 = {} + i = 0 + DatasetName_index = [] + Component_header_index = [] + Component_index = [] + Constants_index = [] + Table_head_index = [] + Table_data_index = [] + Author_index = [] + + dataset_key = '' + dataset = {} + Source_set = [] + + Num_datadict = {} + Num_datadict_keys = [] + Num_datadict_values = [] + + Mix_params_dict = {} + Mix_params_keys = [] + Mix_params_values = [] + + const_dict = {} + const_keys = [] + const_values = [] + + + data_set_name = '' + + + for i in range(len(contentMat)): + for j in range(len(contentMat[i])): + if(contentMat[i][j][0] == 'No.' and re.match( '\d{1,3}', contentMat[i][j+1][0] ) ): # find header of the component list + Component_header_index.append([i, j]) + for k in range( len( contentMat[i][j])): + Mix_params_values.append([]) + Mix_params_keys.append(contentMat[i][j][k]) + elif( len( contentMat[i][j]) == 5 and re.match('^[a-zA-Z]', contentMat[i][j][1] ) and not re.match('^[a-zA-Z]{1,4}\d{0,2} \[.*?\]$', contentMat[i][j][0] ) ): # find component list entries + if( re.match('^\d', contentMat[i][j][2] ) and re.match('^\d{1,5}-\d{1,5}-\d{1,5}$', contentMat[i][j][3] ) ): + Component_index.append([i, j]) + #Mix_params_keys.append(contentMat[i][j][0]) + for k in range( len( contentMat[i][j])): + Mix_params_values[k].append(contentMat[i][j][k]) + + + + + + elif ( re.match( '^[a-zA-Z]{4,99}', contentMat[i][j][0] ) and len(contentMat[i][j]) == 3 and re.match( '^\d{0,99}.\d{0,99}', contentMat[i][j][1] ) ): # find contant value for the dataset: + if contentMat[i][j][1] != '': + #Constants_index.append([i, j]) + const_keys.append(contentMat[i][j][0]) + const_values.append(contentMat[i][j][1:]) + + elif ( re.match('^[a-zA-Z]{1,90}\d{0,2} \[.*?\]$', contentMat[i][j][0] ) or contentMat[i][j][0] == "Azeotropic Type" ): #elif ( re.match( '^[a-zA-Z]{0,99} \[[a-zA-Z]{0,99}\]$' , contentMat[i][j][0] ) ): # find table heading + # the table headings + Table_head_index.append([i, j]) + for k in range(len(contentMat[i][j])): + Num_datadict_keys.append(contentMat[i][j][k]) + #Num_datadict.update({Num_datadict_keys , []}) + Num_datadict_values.append([]) + elif ( len(contentMat[i][j]) == len(Num_datadict_keys) and not re.match('^Source$' , contentMat[i][j][0]) ): #elif ( re.match( '^\d{0,9}.\d{0,9}$' , contentMat[i][j][0] ) or contentMat[i][j][0] == '^' ): # find numerical table entries + Table_data_index.append([i, j]) + for k in range(len(Num_datadict_keys)): + #Num_datadict.update({ Num_datadict_keys[k] : Num_datadict[ Num_datadict_keys[k] ].append(contentMat[i][j][k]) } ) + Num_datadict_values[k].append(contentMat[i][j][k]) + elif (re.match('^Source$' , contentMat[i][j][0]) ): + Author_index.append([i, j]) + elif (re.match('^[a-zA-Z]{1,999999}', contentMat[i][j][0]) and len(contentMat[i][j][0]) > 23 ): + Source_set.append(contentMat[i][j][0]) + + + # save the last entries + for k in range(len(Mix_params_keys)): + Mix_params_dict.update({Mix_params_keys[k] : Mix_params_values[k] }) + + for k in range(len(const_keys)): + const_dict.update({const_keys[k]: const_values[k]}) + + for k in range(len(Num_datadict_keys)): + Num_datadict.update({Num_datadict_keys[k] : Num_datadict_values[k] }) + + if (len(Num_datadict_keys) < 0.1): + print("no datadict keys!") + #if (len(Num_datadict_values[0]) < 0.1): + # print("no values??") + + dataset.update({"Constants": const_dict}) + dataset.update({"Components": Mix_params_dict}) + dataset.update({"Table": Num_datadict }) + dataset.update({'Source' : Source_set}) + + + json_dict = dataset + + + + + #json.load + #json. + #json.dump(json_dict, fileStream) + fileStream.write(json.dumps(json_dict, indent=4, sort_keys=True) ) + + + fileStream.close() def mixPropDB_dwnld(url, name, verbose): DB_elems = testScrape.DB(url) @@ -129,8 +490,8 @@ def mixPropDB_dwnld(url, name, verbose): try: content = testScrape.DDBST_table(url) except: - print 'Some error occured for url: ' + url + ' \n broken???' - print 'Skipped ' + str(counter) + ' of ' + str(total_elems) + ' element' + print ('Some error occured for url: ' + url + ' \n broken???') + print ('Skipped ' + str(counter) + ' of ' + str(total_elems) + ' element') counter += 1 continue @@ -152,19 +513,18 @@ def mixPropDB_dwnld(url, name, verbose): inter += 1 - fileTitle += '.tsv' - - createFile(fileTitle, path, [content], '\t') + createFile(fileTitle + '.tsv', path, [content], '\t') + createJsonFile(fileTitle + '.json', path, [content]) if verbose: - print 'Status of Database: ' + name - print str(counter) + ' of ' + str(total_elems) + ' items downloaded' + print ('Status of Database: ' + name) + print (str(counter) + ' of ' + str(total_elems) + ' items downloaded') counter += 1 #time.sleep(10) def AllDB_dwnl(verbose): - for line in Head[2:-1]: + for line in Head[2:-1]:#Head[2:-1]: urlIndex = line[0]; curDir = line[1] if len(urlIndex) == 2: DB_names = [line[2], line[3]] @@ -198,9 +558,9 @@ def slimDB(DBelements): def main(verbose): - PCP_dwnld(verbose) + #PCP_dwnld(verbose) AllDB_dwnl(verbose) - print 'DDBST free database downloaded to ./DB' + print ('DDBST free database downloaded to ./DB') if __name__ == '__main__': diff --git a/testScrape.py b/testScrape.py index 6d3c0fb..e07988d 100644 --- a/testScrape.py +++ b/testScrape.py @@ -1,6 +1,4 @@ -import urllib2 import requests - import re from bs4 import BeautifulSoup @@ -23,6 +21,7 @@ def DDBST_table(DDBST_url): soup = BeautifulSoup(page, 'html.parser') tab = [] + soup.getText for rel_item in soup.find_all(['table','h3']): if re.search('Data Set',rel_item.get_text() ): tab.append(['$$$'+rel_item.get_text()] ) @@ -36,10 +35,14 @@ def DDBST_table(DDBST_url): for elem in line.find_all(['th','td']): # string without whitespace before of after characters # added utf-8 formating to include unusual letters i.e. german letters ect.. - item = elem.get_text().strip().encode('utf-8') + item = elem.get_text().strip('\t').strip(' ') + try: - fetchline.append(item) + if (item != '\xa0'): + fetchline.append(item) + else: + fetchline.append('') except: fetchline.append('PARSING_ERROR_HERE') @@ -49,7 +52,7 @@ def DDBST_table(DDBST_url): return tab def DDBST_DB_free(prnt): - page = urllib2.urlopen(page_main) + page = requests.get(page_main).text soup = BeautifulSoup(page, 'html.parser') tab = soup.find_all('table')[0] res = ['url'] @@ -66,7 +69,7 @@ def DDBST_DB_free(prnt): qlist = [li] for elem in line.find_all(['a','td','th']): - qlist.append( elem.get_text() ) + qlist.append( str( elem.get_text() ) ) res.append(qlist) # end for @@ -79,7 +82,7 @@ def DDBST_DB_free(prnt): def All_links(url): ''' fetches all possible urls from href tags''' - page = urllib2.urlopen(url) + page = requests.get(url).text soup = BeautifulSoup(page, 'html.parser') h = [] for link in soup.find_all('a'): @@ -102,8 +105,8 @@ def DB(DDBST_url): ret_elem = [] for link in soup.find_all('p')[3:-1]: #pdb.set_trace() - header = link.find('a').get('href') - name = link.find('a').getText() + header = str( link.find('a').get('href') ) + name = str ( link.find('a').getText() ) #wspace_iter = [m.start(0) for m in re.finditer(' ', header)] #if wspace_iter: