<jupyter_start><jupyter_text>BroBeurKids NikolaThis script deals with creating data for BroBeurKids/wcmckee Nikola site.The directory to look at is brobeurkidsdotcom/posts or folderwcmckee.com /posts/github folders are scanned with the input for folders.It's basically a search for notebook, then turn notebook into a blog posts.Arrow is used to generate the date (YR/MONTH/DAY),and time(HR : MIN: SEC)This is where ipynb files are kept. This script generates the .meta files needed. The meta file is called the same as the ipynb.  It also contains the slug and title, and date.The date is collected by looking at the save date of the ipynb.<jupyter_code>import os
import getpass
from walkdir import filtered_walk, dir_paths, all_paths, file_paths
import arrow
import nikola

raw = arrow.utcnow()
print raw

def returntime():
    return raw.strftime('%H:%M:%S')

returntime()
yraw = raw.strftime("%Y")
mntaw = raw.strftime("%m")
dytaw = raw.strftime("%d")
#gmtz.strftime("%Y")
fulda = yraw + '/' + mntaw + '/' + dytaw
fultim = fulda + ' ' + returntime()
#fultim
#gtur = getpass.getuser()
#lisbbkn = os.listdir('/home/' + gtur + '/brobeurkidsdotcom/posts')
#lisbbkn
#for lisb in lisbbkn:
#    if '.ipynb' in lisb:
#        print lisb  
#Name of notebook you want to turn into a blog
nbog = raw_input('Name of notebook to blog: ')
#Search for blog through folders. 
files = file_paths(filtered_walk('/home/wcmckee/github/', depth=100, included_files=[nbog + '.ipynb']))
#print files
opblog = ('/home/wcmckee/github/')
podir = ('/home/wcmckee/github/wcmckee.com/posts/')
podir
for fie in files:
    #print fie
    print fie
    os.system('cp ' + fie + ' ' + podir)
opeza = open(podir + nbog + '.meta', 'w')
opeza.write(nbog + '\n' + nbog + '\n' + fultim)
opeza.close()
os.chdir('/home/wcmckee/github/wcmckee.com/')
os.system('nikola build')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.129084092126406, 'fraction_numerical': 0.0016068559185859668, 'mean_word_length': 4.430232558139535, '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': '198964', 'license': 'MIT', 'n_tokens_mistral': 698, 'n_tokens_neox': 669, 'n_words': 207, 'path': 'posts/bbknikola.ipynb', 'repo_name': 'wcmckee/wcmckee.com', 'size': '1867'}