Skip to main content

A developed command-line task manager

Project description

Project Status: Active – The project has reached a stable, usable state and is being actively developed. GPLv3 License PyPI PyPI - Python Versions Build Status Documentation Status Code Coverage Updates Codestyle: Black

Introduction

Move your ToDo’s to ToDone’s!

ToDonePy is a command-line interface for managing your to do list. It provides a root command, to, and three subcommands:

  • to do adds a new task to your list at different priorities.

  • to doing shows you what you should be doing.

  • to done removes a completed tast from your list.

Docs and Code

The documentation lives at https://ToDonePy.readthedocs.io/ .

The code lives at https://github.com/rbpatt2019/ToDonePy/ .

Installation

This project has been released on PyPI, so it can be installed with pip:

pip install -U ToDonePy

Alternatively, you can install the project manually by cloning the repo, and using the included Makefile.

git clone https://github.com/rbpatt2019/ToDonePy/
make install

If you would like to contribute to development, the install instructions are slightly different. Please see the section on contributing.

Usage

The base command to

The base command to has a few useful features of its own. To see what version of the command you are using, call:

to --version

As with any good command-line tool, you can get some basic help by calling:

to --help

You can get help on any subcommand by calling –help after that subcommand. For example, to get help with to doing, call:

to doing --help

Under the hood, to creates a Filer object that holds the information on the file you use for tracking you’re TODOs. If you don’t specify a file to use, it will default to $HOME/.TODO.tsv. If you would like to specify a different file to use, than call the command with the –file/-f flag like so:

to --file /path/to/your/TODO.tsv subcommand

Regardless of whether you use the default or not, calling to with any of the subcommands - do, doing, or done - will check to see if the file exists. If it does exist, to then pass the path on to the subcommand. If it doesn’t exist, then to creates an empty file which it then passes on to the subcommand.

As a final note, it is worth emphasising that the contex object is only created when to is invoked with a subcommand. So, after a clean install, calling to –help or to –version will NOT create your TODO.tsv file, even if you pass the –file/-f flag. However, call to do, and it will pop into existence.

Adding new tasks with to do

To begin tracking your TODOs, call the command as follows:

to do rank tasks

to is the base command. It must be invoked to use any part of the tool. The do subcommand is how you add tasks to your TODO.tsv. After to do, there are two mandatory arguments: rank and tasks. The first argument is rank. rank should be a number indicating how important this task is. 1 is very important, 2 less so, etc. Though nothing explicitly bans you from using as many ranks as you want, I would reccomed using 3 for high, medium, and low priority.

The second argument is tasks. Here, specify what it is you need to do. If your task takes more than one word to describe, then you need to include it in quotes. tasks supports an indefinite number of arguments, from 1 to as many as you want.

So, if you wanted to remind yourself to write an abstract for that paper you have been delaying and to email your boss, call:

to do 1 'Write my abstract' 'Email boss'

This will create TODO.tsv if it does not already exist, and add ‘Write my abstract’ and ‘Email boss’, both with a rank of one, to TODO.tsv. to do also logs the date and time the task was added, so that you always know how old a task is.

Sometimes, you want to sort your tasks as you add them. You can do that with the –sort/-s option. This specifies how to sort your list after a new task is added. It must be one of: [rank, date, both, none]. both sorts by rank and then date, and none does not sort, simply appending tasks to the end of your list. It defaults to none, on the grounds its better not to do something unless you ask. Explicit is better than implicit, as they say. If you just wanted to sort by date after adding a new task, then you could call:

to --sort do date 1 'Important work'

Keeping track of tasks with to doing

Once you have added some TODOs to your list, you need to make sure you stay on top of them. To see what needs to be done, call:

to doing

This should echo the 5 tasks at the top of your TODO.tsv to the terminal.

You can specify how to sort your tasks by passing the –sort/-s flag with one of: [rank, date, both, none]. It defaults to none, thus preserving the order in your TODO.tsv. Any call to sort will also change the order currently in your TODO.tsv, not just the order they are echoed.

Also, specifying the –number/-n flag will let you change how many tasks are returned, and it defaults to 5. So, if you want to return 3 tasks sorted by rank, call:

to -s rank doing -n 3

Maybe you prefer a graphic reminder instead of echoing in the terminal - I find this useful for spawning reminders while I am coding in VIM. ToDonePy has that covered, too! Just call:

to doing --reminder

to trigger a notification window. By default, it stays up for 5 seconds. Currently, you can not set the time, though that’s in the works!

Sometimes, you might want to correct an error, change a priority, or in some way edit yout TODO.tsv. In these cases, you can call to doing in editor mode:

to doing --edit

This will open TODO.tsv in your system editor. Where you would see something like below, if you have been following along:

ID      Rank    Date    Task
1       1       YYYY-MM-DD HH:MM     Write my abstract
2       1       YYYY-MM-DD HH:MM     Email boss
3       1       YYYY-MM-DD HH:MM     Important work

Nothing fancy, just a plain tsv with ID in the first column, rank in the second column, the date/time of addition in the third, and task in the fourth. Now, you can make all the changes you want, then save and close the file to return to the command line.

Calling –edit will trump any calls to sort or number made in the same command.

This call opens the default editor on your system, usually defined by the environmental variable EDITOR for Linux systems. If this variable is undefined, then it defaults to VIM - which should be your choice anyways! :P If that command is not found, then it will thros an OSError.

Completing your tasks with to done

After the end of a productive work session, you have completed a task from your list. Boom! Time well spent. To remove it from your TODO.tsv, call:

to done tasks

As with to do, to done suports an indefinite number of tasks, as long as all multi-word tasks are enclosed in quotes. For example, if you emailed your boss that finished abstract, then you can remove those tasks like so:

to done 'Write my abstract' 'Email boss'

If to done finds these tasks in your TODO.tsv, it’ll remove them! If it can’t find the tasks, it will print a message saying which ones couldn’t be removed.

Under the hood, to done creates a temp file, then performs a string match to each line of your TODO.tsv. If a perfect match to ‘’task’’ is not in a line, that line is written to the temp file. If ‘’task’’ is in a line, that line is skipped. This way, the temp file ends up containing only those tasks that aren’t completed. Once every line is checked, the temp file replaces TODO.tsv with its contents. Task deleted!

Known Bugs

  • Test hang when testing

Recent Changes

Please see the CHANGELOG

Next Steps

  • Addition of TODOs from file parsing

  • Support removal of tasks by task ID number

  • Full, OS-independent graphic interface

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

todonepy-4.0.9.tar.gz (28.0 kB view details)

Uploaded Source

Built Distribution

todonepy-4.0.9-py3-none-any.whl (26.4 kB view details)

Uploaded Python 3

File details

Details for the file todonepy-4.0.9.tar.gz.

File metadata

  • Download URL: todonepy-4.0.9.tar.gz
  • Upload date:
  • Size: 28.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.0 Linux/4.15.0-1077-gcp

File hashes

Hashes for todonepy-4.0.9.tar.gz
Algorithm Hash digest
SHA256 fcb8119f2eb81c38a9c38644f26573ad1d37c3085f734444fe19de07d93db8aa
MD5 c89ce989f53ff769db2e5acaa25380f4
BLAKE2b-256 1aa99183708434bd1b2b0546377670a82698ed6ac6729c3e7e7f58ebecfea86f

See more details on using hashes here.

File details

Details for the file todonepy-4.0.9-py3-none-any.whl.

File metadata

  • Download URL: todonepy-4.0.9-py3-none-any.whl
  • Upload date:
  • Size: 26.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.0 Linux/4.15.0-1077-gcp

File hashes

Hashes for todonepy-4.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 9e1dc44fc511097bc0637bbc071a2d25006cc8c2b6e0855739b56517f5c8f41f
MD5 be3ae3c69c7093cd1eee437d617c4f15
BLAKE2b-256 9bbde21d2a5927283507ed847e9d3269ef391e8e55e1da6c449e9cc60110465f

See more details on using hashes here.

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