org-todo-count.py 616 B

1234567891011121314151617181920212223
  1. #!/usr/bin/env python
  2. # Simple regex program to parse a org file for all TODO headers and
  3. # print them out nicely. I use it to put into wheelofnames.com
  4. import re # I am not a regex god. yet...
  5. import pyperclip # gigachad
  6. TODO_file = "C:\\SGZ_Pro\\Hobbys\\Writing\\Org\\todo.org"
  7. with open(TODO_file) as f:
  8. text = f.read()
  9. # Godly regex building the third temple with this one
  10. found = re.findall("\*\* TODO .*",text)
  11. formatted = ""
  12. for i in found:
  13. formatted += ' '.join(i.split(" ")[2:]) + "\n"
  14. print(formatted)
  15. pyperclip.copy(formatted)
  16. print(f"===LEFT===\nYou have {len(found)} items you need TODO")