Git Product home page Git Product logo

gtasks-md's Introduction

gtasks-md

Google Tasks is a Google Workspace tool that has the following advantages:

  • It has great integration with Google Calendar.
  • There are mobile apps developed by Google for Android and iOS.
  • It is pretty straightforward to use, there is no feature creep.

All great, this works pretty well for shopping groceries or something, but what if it was to be suitable for tracking more advanced tasks (e.g. work related)? It is possible to add some text as note to a task but this is very limited and not very convenient to use on desktop computer.

The idea that this project represents is declarative approach to task management. It provides an interface for manipulating Google Tasks via Markdown1. See the following demo:

Application demo

Supported operations

All commands support --user flag which allows multi-user usage.

auth

gtasks-md auth ./credentials.json

In order to run gtasks-md it is needed first to obtain API credentials. This can be achieved with the following steps2:

  1. Create a new project in GCP and go to Google APIs.

  2. Click ENABLE APIS AND SERVICES add Google Tasks API.

  3. Go to Google APIs and click OAuth consent screen from the sidebar.

    • Choose External (Available to any user with a Google Account.) and click CREATE.
    • Input your favorite name to Application name. In the Scopes for Google APIs section, click Add scope and add Task API ../auth/tasks.
    • Click Save (DO NOT Submit for verification).
  4. Go to the Credentials page from the sidebar.

    • Create a new OAuth client ID. Select Desktop application for the application type.
    • Download the credentials as JSON file.
    • Run gtasks-md auth command with that file as argument.

In case of troubles consult OAuth client ID credentials creation documentation for a Desktop app.

view

$ gtasks-md view
# # TODO
#
# ## My Tasks
#
# 1.  [ ] Task 1
#
#     Example note 1.
#
# 2.  [ ] Task 2
#
#     1.  [ ] SubTask 1
#
#         This is another useful note.
#
#     2.  [ ] SubTask 2

Downloads all task lists, parses them to Markdown format and prints to stdout.

edit

gtasks-md edit

Begins with the same operations as gtasks-md view but later opens the text in an editor. After user is done with entering changes, the resulting file is parsed back to task lists and local state is reconciled with server state.

reconcile

gtasks-md reconcile ./tasks.md

Similar to gtasks-md edit but instead of editing the Markdown it sources the provided file as local state and reconciles it.

rollback

gtasks-md rollback

Rolls back the server state to the most recent locally backuped state. Useful if something goes wrong.

Installation

  1. Install binary dependencies

    # Ubuntu
    $ sudo apt install pandoc pip
    # Fedora
    $ sudo dnf install pandoc pip
  2. Install the PyPI package

    pip install gtasks-md
  3. Run gtasks-md

    gtasks-md --help

Development

Ubuntu

# 1. Install binary dependencies
$ sudo apt install pandoc pip
# 2. Install Python dependencies
$ pip install -r requirements.txt
# 3. Run the runner.py
$ ./runner.py --help

NixOS (or when using Nix)

# 1. Enter nix-shell (this may be done automatically when using direnv)
$ nix-shell
# 2. Run the runner.py
$ ./runner.py --help

Footnotes

  1. Subset of Pandoc's Markdown to be exact

  2. Shamelessly stolen from calendar.vim

gtasks-md's People

Contributors

jupblb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

gtasks-md's Issues

needsAction status?

I cannot filter tasks by --status needsAction.

(base) jovyan@c9c4fe9ec430:~/work$ gtasks-md view
# Google Tasks

## My Tasks

1.  [ ] Bicycle hitch

2.  [ ] Sandbox 2.0

3.  [ ] Travel arrangement to conference

5.  [ ] NYTimes subscription

8.  [x] Water plants 💦

(base) jovyan@c9c4fe9ec430:~/work$ gtasks-md --status completed view
# Google Tasks

## My Tasks

1.  [x] Water plants 💦

(base) jovyan@c9c4fe9ec430:~/work$ gtasks-md --status needsAction view
Traceback (most recent call last):
  File "/opt/conda/bin/gtasks-md", line 8, in <module>
    sys.exit(main())
  File "/opt/conda/lib/python3.10/site-packages/app/cli.py", line 45, in main
    service = GoogleApiService(
  File "/opt/conda/lib/python3.10/site-packages/app/googleapi.py", line 45, in __init__
    self.task_status = TaskStatus(task_status) if task_status else None
  File "/opt/conda/lib/python3.10/enum.py", line 385, in __call__
    return cls.__new__(cls, value)
  File "/opt/conda/lib/python3.10/enum.py", line 710, in __new__
    raise ve_exc
ValueError: 'needsaction' is not a valid TaskStatus
(base) jovyan@c9c4fe9ec430:~/work$ gtasks-md --status unknown view
# Google Tasks

## My Tasks

Add dates

Hi @jupblb! Thanks for this tool!
Is it planned to add dates sync in any format?

SyntaxError: Could not parse Task title

Hello, thanks for his project! I just installed in my Ubuntu 20.04 box and the gtasks-md auth command worked, I think, but when I run gtasks-md view, I got the following error:

Traceback (most recent call last):
  File "/home/pfsmorigo/.local/bin/gtasks-md", line 8, in <module>
    sys.exit(main())
  File "/home/pfsmorigo/.local/lib/python3.10/site-packages/app/cli.py", line 62, in main
    view(service)
  File "/home/pfsmorigo/.local/lib/python3.10/site-packages/app/cli.py", line 141, in view
    _, text = fetch_task_lists(service)
  File "/home/pfsmorigo/.local/lib/python3.10/site-packages/app/cli.py", line 174, in fetch_task_lists
    return task_lists, task_lists_to_markdown(task_lists)
  File "/home/pfsmorigo/.local/lib/python3.10/site-packages/app/pandoc.py", line 94, in task_lists_to_markdown
    OrderedList(ORDERED_FIRST_ELEM, tasks_to_pandoc(task_list.tasks))
  File "/home/pfsmorigo/.local/lib/python3.10/site-packages/app/pandoc.py", line 49, in tasks_to_pandoc
    pandoc_tasks.append(task_to_pandoc(task, has_notes))
  File "/home/pfsmorigo/.local/lib/python3.10/site-packages/app/pandoc.py", line 75, in task_to_pandoc
    raise SyntaxError(f"Could not parse Task title {task.title}")
SyntaxError: Could not parse Task title

I'm using pandoc version 2.9.2.1-3ubuntu2. Maybe that's the reason?

Thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.