Skip to main content

Library to access todo.txt like task lists

Project description

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()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytodotxt-1.1.0.tar.gz (6.1 kB view hashes)

Uploaded Source

Built Distribution

pytodotxt-1.1.0-py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page