This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################### | |
import re | |
from tabulate import tabulate | |
with open("doc/jsonrpc.md.out", "w") as wfile: | |
with open("doc/jsonrpc.md", "r") as rfile: | |
in_table = False | |
for line in rfile.readlines(): | |
if re.search("Name.+?\|.+?Optional.+?\|.+?Type.+?\|.+?Description", line): | |
# print(">>", line ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################### | |
import re | |
with open("doc/jsonrpc.md", "r") as file: | |
data = file.read() | |
examples = re.findall("~~~json(.+?)~~~", data, re.MULTILINE | re.DOTALL) | |
for example in examples: | |
try: | |
json.loads(example) | |
except json.decoder.JSONDecodeError: | |
for i, x in enumerate(example.splitlines()): |