def main():
ep = requests.get(TRELLO_API_DOC).content<EOL>root = html.fromstring(ep)<EOL>links = root.xpath('<STR_LIT>')<EOL>pages = [requests.get(TRELLO_API_DOC + u)<EOL>for u in links if u.endswith('<STR_LIT>')]<EOL>endpoints = []<EOL>for page in pages:<EOL><INDENT>root = html.fromstring(page.content)<EOL>sections = root.xpath('<STR_LIT>')<EOL>for sec in sections:<EOL><INDENT>ep_html = etree.tostring(sec).decode('<STR_LIT:utf-8>')<EOL>ep_text = html2text(ep_html).splitlines()<EOL>match = EP_DESC_REGEX.match(ep_text[<NUM_LIT:0>])<EOL>if not match:<EOL><INDENT>continue<EOL><DEDENT>ep_method, ep_url = match.groups()<EOL>ep_text[<NUM_LIT:0>] = '<STR_LIT:U+0020>'.join([ep_method, ep_url])<EOL>ep_doc = b64encode(gzip.compress('<STR_LIT:\n>'.join(ep_text).encode('<STR_LIT:utf-8>')))<EOL>endpoints.append((ep_method, ep_url, ep_doc))<EOL><DEDENT><DEDENT>print(yaml.dump(create_tree(endpoints)))<EOL>
Prints the complete YAML.