markup: add spreadsheet writing

This commit is contained in:
2019-10-18 16:40:15 -07:00
parent 2b498fd2e3
commit 4cde2233cd
3 changed files with 46 additions and 1 deletions

View File

@ -20,6 +20,7 @@ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'procat2.settings')
django.setup()
from markup.matching import find_marked_products
from markup.spreadsheet import write_spreadsheet
def main(argv):
@ -43,7 +44,8 @@ def main(argv):
catname = re.sub(r'[^\w]', '_', catname)
matches = find_marked_products(fname, subdir, catname, debug=0)
print(matches)
print(f'{len(matches)} product matches')
write_spreadsheet(matches, subdir, catname, path.stem)
if __name__ == '__main__': sys.exit(main(sys.argv))