Finalized Confluence Script and Started Skuid

This commit is contained in:
Norm Rasmussen
2022-11-22 17:13:39 -05:00
parent d54f1e926a
commit b0395b5293
18 changed files with 1080 additions and 304 deletions

View File

@ -1,14 +1,8 @@
import io
from datetime import date
import markdown
from re import search
import re
# import pypandoc and/or panflute
rootdir = "/Users/normrasmussen/Documents/Northpass/Scripts/API_Notes/SampleNotes/"
#meetingstart = "##"
#meetingend = "##"
#rx = r'{}.*?{}'.format(re.escape(meetingstart), re.escape(meetingend))
def findheadings():
headingsarray = []
@ -21,25 +15,40 @@ def findheadings():
# 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}$"
#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}"):
if line.startswith("## "):
notes_flag = True
elif notes_flag:
notes += line
if not line.strip(): break
mdConvert(rootdir, notes)
print(notes)
# mdConvert(rootdir, notes)
def meetingSections(rootdir):
dateregex = "^[0-9]{1,2}\\/[0-9]{1,2}\\/[0-9]{4}$"
currentnote = rootdir + "Flink.md"
with open(currentnote, "r") as f:
text = f.read()
#print(text)
#m = re.search(f"##(.^[0-9]{1,2}\\/[0-9]{1,2}\\/[0-9]{4}$)\n(.*)\n\n")
#m = re.search("##"+dateregex+"(.*)"+"##"+dateregex, text)
if m:
print("Found a section!")
found = m.group(1)
print(found)
def mdConvert(rootdir, notes):
conversion = markdown.markdown(notes)
print(notes)
print(conversion)
# Add Conversion variable to payload for hubspot. Copy functions from the other files.
if __name__ == "__main__":
noteSections(rootdir)
meetingSections(rootdir)
#noteSections(rootdir)