Zum Inhalt

todo.txt 2 json

edge-soft logo

Use your ToDos in other contexts!

This is a python script to convert todo.txt to a json representation.

This eases the use of ToDos in other contexts that can work with json easier.

The script uses the pytodotxt library.

Format

For examples, see test directory.

For todo.txt see format description

The generated json format is (only description is mandatory):

{
    "todos": [
        {
            "is_completed": true,
            "priority": "priority",
            "completion_date": "yyyy-mm-dd",
            "creation_date": "yyyy-mm-dd",
            "description": "description",
            "projects": [
                "project1",
                "project2"
            ],
            "contexts": [
                "context1",
                "context2"
            ],
            "attributes": {
                "key": [
                    "value"
                ]
            },
        },
        { ... }
    ]
}

Python script

Use the script as follows:

$> python todo.txt-2-json.py --input <infile> --output <outfile> [--flatten] [--verbose]
--input
input file
--output
output file
--flatten
flatten substructures
--verbose
verbose output

Shell script

Use the script as follows:

$> todo.txt-2-json.sh -i <infile> -o <outfile> [-f] [-v] [-h]
-i
input file
-o
output file
-f
flatten substructures
-v
verbose output
-h
script help

License

This script is distributed under the terms of the GNU General Public License.

See readme or COPYING for details.