All Projects → JamesClonk → go-todotxt

JamesClonk / go-todotxt

Licence: MPL-2.0 license
📝 Golang client library for todo.txt files

Programming Languages

go
31211 projects - #10 most used programming language

Labels

Projects that are alternatives of or similar to go-todotxt

todo-txt
Parser for the todo.txt format
Stars: ✭ 21 (-22.22%)
Mutual labels:  todotxt
ttdl
TTDL - Terminal Todo List Manager
Stars: ✭ 91 (+237.04%)
Mutual labels:  todotxt
pomogoro
Text-file based todo time tracking
Stars: ✭ 22 (-18.52%)
Mutual labels:  todotxt
todo.txt-ext
Thunderbird extension for the Todo.txt application.
Stars: ✭ 28 (+3.7%)
Mutual labels:  todotxt
mindstream
Task management app, built on todo.txt.
Stars: ✭ 33 (+22.22%)
Mutual labels:  todotxt
webtodotxt
Web-based GUI to manage a Todo.txt file
Stars: ✭ 30 (+11.11%)
Mutual labels:  todotxt
Todo.txt Cli
☑️ A simple and extensible shell script for managing your todo.txt file.
Stars: ✭ 4,725 (+17400%)
Mutual labels:  todotxt
todo.txt-graph
A todo.txt plugin which visualizes the amount of done tasks per day
Stars: ✭ 17 (-37.04%)
Mutual labels:  todotxt
todo-txt
Todo.txt syntax highlighter and helper extension for visual studio code.
Stars: ✭ 39 (+44.44%)
Mutual labels:  todotxt
todofi.sh
Handle your todo-txt tasks directly from Rofi
Stars: ✭ 46 (+70.37%)
Mutual labels:  todotxt

go-todotxt

A Go todo.txt library.

GoDoc Build Status

The todotxt package is a Go client library for Gina Trapani's todo.txt files. It allows for parsing and manipulating of task lists and tasks in the todo.txt format.

Installation

$ go get github.com/JamesClonk/go-todotxt

Requirements

go-todotxt requires Go1.1 or higher.

Usage

	package main

	import (
		"fmt"
		"github.com/JamesClonk/go-todotxt"
		"log"
	)

	func main() {
		todotxt.IgnoreComments = false

		tasklist, err := todotxt.LoadFromFilename("todo.txt")
		if err != nil {
			log.Fatal(err)
		}

		// tasklist now contains a slice of Tasks
		fmt.Printf("Task 2, todo: %v\n", tasklist[1].Todo)
		fmt.Printf("Task 3: %v\n", tasklist[2])
		fmt.Printf("Task 4, has priority: %v\n\n", tasklist[3].HasPriority())
		fmt.Print(tasklist)

		// Filter list to get only completed tasks
		completedList := tasklist.Filter(func(t Task) bool {
			return t.Completed 
		})
		fmt.Print(completedList)

		// Add a new empty Task to tasklist
		task := NewTask()
		tasklist.AddTask(&task)

		// Or a parsed Task from a string
		parsedTask, _ := ParseTask("x (C) 2014-01-01 Create golang library documentation @Go +go-todotxt due:2014-01-12")
		tasklist.AddTask(parsed)

		// Update an existing task
		task, _ := tasklist.GetTask(2) // Task pointer
		task.Todo = "Do something different.."
		tasklist.WriteToFilename("todo.txt")
	}

Documentation

See GoDoc - Documentation for further documentation.

License

The source files are distributed under the Mozilla Public License, version 2.0, unless otherwise noted.
Please read the FAQ if you have further questions regarding the license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].