Skip to content

ian-barnes/todo_txt_py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

todo_txt_py

Minimal toy todo.txt implementation in Python.

Install

Set up a virtual environment if you want, however you usually do it. (One possible way described below.)

Run poetry install.

Usage

To run:

todo <cmd> <args>

Development

To format code, check linting, run tests etc., use the Makefile. Just running make will list the targets.

Purpose

This is not intended as a production project, but mostly as a source of easy exercises for pair programming interviews and as a sandbox for learning more about project setup, structure, packaging, CI and so on.

As such, it comes with absolutely no guarantee that it does anything useful or correct at all. It should not be used other than to play with.

To do

In the spirit of eating your own dog food, the project to do list is stored in the top-level todo.txt. To view it, run todo list.

Notes

  • I'm aware that class Task and its constructor could be simplified using attrs, but I didn't want to require too much Python knowledge to be able to work on this.
  • In some ways this is deliberately a bit sloppy so as to generate opportunities for discussion and criticism.

Useful links

Example virtual environment setup

Just one possible example of how to set things up for development, not necessarily optimal:

Poetry sets up a virtual environment and direnv automates activating it whenever I go into the project directory.

I added the following snippet to my .direnvrc:

layout_poetry() {
  if [[ ! -f pyproject.toml ]]; then
    log_error 'No pyproject.toml found.  Use `poetry new` or `poetry init` to create one first.'
    exit 2
  fi

  local VENV=$(dirname $(poetry run which python))
  export VIRTUAL_ENV=$(echo "$VENV" | rev | cut -d'/' -f2- | rev)
  export POETRY_ACTIVE=1
  PATH_add "$VENV"
}

and then put this in the local .envrc:

layout poetry

Without doing the direnv, you can activate the virtual environment with poetry shell.

About

Minimal todo.txt implementation in Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published