Created
December 3, 2022 14:26
-
-
Save ebal/27e75fd21eead21112b4ca1ba76c2201 to your computer and use it in GitHub Desktop.
a simple BoostNote cson converted to MarkDown format
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
#!/usr/bin/env python | |
import os | |
import sys | |
import cson | |
path = sys.argv[1] | |
i=0 | |
for x in os.listdir(path): | |
if x.endswith(".cson"): | |
with open(path+x, 'rb') as fin: | |
obj = cson.load(fin) | |
if ( obj['type'] == "MARKDOWN_NOTE" ): | |
md_file = obj['title']+".md" | |
md_text = obj["content"] | |
i += 1 | |
print ("Converting "+ str(i) + " : " + obj['title']+".md") | |
f = open(md_file, "w") | |
f.write(md_text) | |
f.close() | |
print ("Finished") |
Author
ebal
commented
Dec 3, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment