<jupyter_start><jupyter_text>NikoladuScript to take json object of ministry of education jobs and create Nikola blog posts - rst and meta files.<jupyter_code>#import nikola

import requests
import json
import pandas
opedu = open('/home/wcmckee/github/wcmckee.com/output/minedujobs/index.json', 'r')
minjob = opedu.read()
dicminj = json.loads(minjob)
ldic = len(dicminj)
catlis = list()

loclis = list()
datlis = list()
jobti = list()
numdic = dict()
for ldi in range(ldic):
    dicjob = dict()
    catedi = (dicminj[str(ldi)]['Category'])
    locdi = (dicminj[str(ldi)]['Location'])
    datdi = (dicminj[str(ldi)]['Date Advertised'])
    pandatz = pandas.to_datetime(datdi)
    pdate = pandatz.date()
    titdi = (dicminj[str(ldi)]['Job Title'])
    
    jobref = (dicminj[str(ldi)]['Job Reference'])
    jorefd = jobref[4:]
    #print (jorefd)
    
    skildi = (dicminj[str(ldi)]['lidocend'])
    
    #for ski in skildi:
        #print (ski)
        #for sk in ski:
            #print (sk)
    #print (titdi + '\n' + skildi)
            
            
    
    opmetf = open('/home/wcmckee/minstryofedu/posts/' + jorefd + '.meta', 'w')
    opmetf.write(jorefd + '\n' + jorefd + '\n' + str(pdate) + ' ' + str('09:00:00') + '\n' + catedi + ', ' + locdi)
    opmetf.close()
    
    oprstfi = open('/home/wcmckee/minstryofedu/posts/' + jorefd + '.rst', 'w')
    oprstfi.write(titdi)
    for ski in skildi:
        #print (ski)
        #for sk in ski:
        #    print (sk)
        oprstfi.write(str(ski))
    
    oprstfi.close()



    dicjob.update({'Category' : catedi, 'Date Advertised' : str(pdate), 'Job Title' : titdi,
    'Location' : locdi, 'Job Reference' : jobref})
    
    numdic.update({ldi : dicjob})
    #numdic.update({ldi : dicjob})
    
    loclis.append(locdi)
    datlis.append(datdi)
    jobti.append(titdi)
    
    nedicf = dicjob.copy()
    nedicf.update(nedicf)
    
    numdic.update({ldi : nedicf})
    
    #if 'education' in catedi:
    #    print (catedi)

        
allpda = list()

for dal in datlis:
    allpdata = pandas.to_datetime(dal)
    allpda.append(allpdata)
datsli = list(set(datlis))
import arrow
panlis = list()
for dalz in datsli:
    print (dalz)
    panlis.append(pandas.to_datetime(dalz))
    
for panl in panlis:
    #print (panl.dayofweek)
    print (panl.dayofyear)
    print (panl.date())
catsli = list(set(catlis))
locset = list(set(loclis))
locset<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15378289473684212, 'fraction_numerical': 0.0028782894736842104, 'mean_word_length': 2.874203821656051, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '425542', 'license': 'MIT', 'n_tokens_mistral': 999, 'n_tokens_neox': 971, 'n_words': 193, 'path': 'posts/nikoladu.ipynb', 'repo_name': 'wcmckee/wcmckee.com', 'size': '2432'}