import os DB_PATH = "materials" REWRITE = True def gen_index(filepath, pathlist): ''' makes a index page for the entire database just a list of links to the material files later update with a table summarizing the values of everything filepath: path to html file created pathlist: list of strings that are the material pages to link to, assume name from path format ''' dir = os.path.split(filepath)[0] html_file = open(filepath, mode='w') content = '''

Filter Media Database

This is a tracking page to follow the filter efficiency and physical properties of various types of face mask or ventilator filter materials - a central page to compare NOISH-approved N95 masks to new materials developed by the larger CBA COVID repsonse team (electrospining, rotary jet ) to DIY materials that could be easily sourced or readily available.

With the CDC now recommending everyone uses any type of makeshift mask before going out in public, and as more people become caretakers for sick family members, we should get a quantitative measurement of which type of household items are best for transmission protection, breathability, and longenvity.

Similar questions have been asked and answered before - Effficiency of homemade masks, filtering performance of 20 protective fabrics, etc. - this projects exists to verify and expand these findings, specialize them to known SARS-CoV-2 aerosol Characteristics, and provide an inital comparison for novel materials.

filtration efficiency testing is inspired by ASTM standards F2299 and F2101, but it's NOT intended to replace or be as rigorous as NOISH testing - more details here. the hope is two fold: (1) to provide convenient testing for materials developed in house before sending them to more rigorous and qualified testing labs, and (2) to provide comparative insight backed by quantitative measurement to the growing DIY mask movement.

click the mask name for more images & details ''' table = sum_table(pathlist, dir) content += table content = content + "\n \n" html_file.write(content) html_file.close() print("generated index file: ", filepath) return def gen_media_page(dirpath): ''' generates a main page for each material studied data must be stored in a txt file in the same directory image folders will be scanned and images attached below text information dirpath: directory to media summary ''' name = os.path.split(dirpath)[1] html_path = os.path.join(dirpath, name+".html") txt_path = os.path.join(dirpath, name+".txt") if not os.path.isfile(txt_path): print("text data file does not exist for %s! No html file will be added." % name) return html_file = open(html_path, mode="w") txt_file = open(txt_path, mode="r") content = '''