DouglasElliman & other scripts

This commit is contained in:
Norm Rasmussen
2022-11-08 14:47:53 -05:00
parent fce96a5ea6
commit 22704920d8
14 changed files with 2286 additions and 35 deletions

View File

@ -1,10 +1,11 @@
import io
from datetime import date
import markdown
from re import search
import re
# import pypandoc and/or panflute
rootdir = "/Users/normrasmussen/Documents/Northpass/CustomerNotes/"
rootdir = "/Users/normrasmussen/Documents/Northpass/Scripts/API_Notes/SampleNotes/"
#meetingstart = "##"
#meetingend = "##"
#rx = r'{}.*?{}'.format(re.escape(meetingstart), re.escape(meetingend))
@ -18,29 +19,26 @@ def findheadings():
headingsarray.append(headings)
print(headingsarray)
def pullnotes():
date1 = "!*!"
#"[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{4}"
date2 = "!@#"
#"[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{4}"
#range = r'{}.*?{}'.format(re.escape(date1), re.escape(date2))
with open(rootdir + "G2/G2.md", "r") as myfile:
file = myfile.read()
print(file[file.find(date1)+len(date1):file.rfind(date2)])
#print(chunk)
def pullnotes2():
inRecordingMode = False
file = "rootdir + Talkspace/Talkspace.md"
for line in file:
if not inRecordingMode:
if line.startswith(r'\d+/\d+/\d'):
inRecordingMode = True
elif line.startswith(r'\d+/\d+/\d'):
inRecordingMode = False
else:
yield line
# From StackOverflow:
def noteSections(rootdir):
today = date.today()
today = today.strftime("%m/%d/%Y")
dateregex = "^[0-9]{1,2}\\/[0-9]{1,2}\\/[0-9]{4}$"
with open(rootdir+"Flink.md", "r") as f:
notes_flag = False
notes = ''
for line in f:
if line.startswith(f"## {today}"):
notes_flag = True
elif notes_flag:
notes += line
if not line.strip(): break
mdConvert(rootdir, notes)
def mdConvert(rootdir, notes):
conversion = markdown.markdown(notes)
print(notes)
if __name__ == "__main__":
pullnotes()
noteSections(rootdir)