You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
R f9107720d0 This is version 1.0.7 1 month ago
pytodotxt This is version 1.0.7 1 month ago
tests Merge fix 2645b78 by sandervoerman 1 month ago
.gitignore init 11 months ago
AUTHORS.md AUTHORS file 1 month ago
CHANGELOG.md This is version 1.0.7 1 month ago
LICENSE Split packages 8 months ago
MANIFEST.in AUTHORS file 1 month ago
README.md This is version 1.0.1 8 months ago
setup.py This is version 1.0.1 8 months ago

README.md

pytodotxt

A tiny library to access todo.txt-like task lists.

Installation

To install pytodotxt, you can follow these steps to clone the repository, and install the program.

pip install pytodotxt

That’s all there is to do.

Example usage

Here’s an example how to open a todo.txt file and print the description of all tasks that are not marked as completed:

import pytodotxt


todotxt = pytodotxt.TodoTxt('todo.txt')
todotxt.parse()

for task in todotxt.tasks:
    if not task.is_completed:
        print(task.description)

Here is how you add a new task to an existing todo.txt file:

import datetime

import pytodotxt

todotxt = pytodotxt.TodoTxt('todo.txt')
todotxt.parse()

task = pytodotxt.Task()
task.parse('This is a new task')
task.creation_date = datetime.date.today()

todotxt.tasks.append(task)

todotxt.save()