Pretty print JSON in Python (snippet)

The below depends on the json Python module to 'pretty print' JSON output in Python. I found this useful when trying to write my script to remove unused Todoist labels. import json # This function saves time printing JSON nicely def pj(str): print(json.dumps(json.loads(str.content), indent=4)) return pj(thing_containing_raw_json_here) Note that in my case this was contingent on having used the requests module in the following fashion to already make sure the format is a bit jsonified, Read more [...]

Todoist: Remove unused labels

Want to remove your unused labels/tags from Todoist in bulk? The various GUIs will have you do this one at a time but I have written a small, not very efficient Python script that will do this for you. Here's how it works: You need to provide your API token (Which you can find in Todoist settings) in a file called token.txt Then download or copy the script from my Todoist Remove Unused Tags GitHub repository Just run this using Python and it should work fine Please bear in mind I've Read more [...]