Git Product home page Git Product logo

things2md's Introduction

Things3 database -> Markdown conversion script.

Installation

pip3 install -r requirements.txt

Copy .env.example to .env and set:

  • Required: THINGS_DB = the path to your Things3 sqlite database file, for example: "~/Library/Group Containers/JLMPQHK86H.com.culturedcode.ThingsMac/ThingsData-X342B/Things Database.thingsdatabase/main.sqlite"
  • Optional: SKIP_TAGS = a comma-separated list of tags for any tasks you do not want included in output, for example: "personal,pers"

Usage

Run without any parameters to see the full list of arguments available:

--debug             If set will show script debug information.
--due               If set will show incomplete tasks with deadlines.
--format {import}   Format mode. Import: Outputs tasks as headings, notes as body text, subtasks as bullets.
--gcallinks         If provided, appends links to create a Google calendar event for the task.
--groupby {date,project}
                    How to group the tasks
--orderby {date,index,project}
                    How to order the tasks
--range RANGE       Relative date range to get completed tasks for (e.g., "0 days ago", "1 day ago", "1 week ago",
                    "this week" which starts on Monday). Completed tasks are relative to midnight of the day requested.
--simple            If set will hide task subtasks + notes and cancelled tasks.
--tag TAG           If provided, only uncompleted tasks with this tag are fetched.
--today             If set will show incomplete tasks in Today.

The --due, --range, --tag, or --today parameter is required, at a minimum.

Notes:

  • nothing will be returned if no tasks match the given arguments; and
  • any tasks tagged with any tags in SKIP_TAGS as defined in .env are not included in the output.

Examples

Listing Completed Tasks

Show tasks completed within the last week, grouped by project, ordered by project:

python3 things2md.py --range "1 week ago" --groupby project --orderby project

Show tasks completed today:

python3 things2md.py --range "today"

Show tasks completed today, and omit subtasks, notes, and cancelled tasks:

python3 things2md.py --range "today" --simple

Show tasks completed yesterday:

python3 things2md.py --range "yesterday"

...and ordered by project, but omit subtasks, notes, and cancelled tasks:

python3 things2md.py --range "yesterday" --orderby project --simple

Show tasks completed in the last 3 days, and omit subtasks, notes, and cancelled tasks:

python3 things2md.py --range "3 days ago" --simple

Show tasks completed in the last week, ordered by project, but omit subtasks, notes, and cancelled tasks:

python3 things2md.py --range "1 week ago" --orderby project --simple

Listing Todo Tasks

BETA: Show uncompleted tasks in Today.

python3 things2md.py --today

To further narrow down tasks to be done, I tag them with a special tag and retrieve just those tasks:

Show uncompleted tasks, tagged with "focus", ordered how they're ordered in Things (though Evening tasks seem to show at the top), and show links that you can click to create a Google Calendar event:

python3 things2md.py --tag "focus" --orderby index --gcallinks

Show uncompleted tasks with deadlines set, and those deadline dates, ordered by deadline:

python3 things2md.py --due

Exporting Tasks as Simple Markdown to be Imported (into Obsidian, or another note-taking tool)

I frequently draft notes in Things that I just want to get it out as simple markdown.

Show uncompleted tasks, tagged with "import", formatted in markdown with task names as headers, notes as body text, and subtasks as a list:

python3 things2md.py --tag "import" --format import --orderby index

Usage with Obsidian

This script was designed for use in Obsidian for Daily Notes, but as it outputs plain text as markdown, it really can be used anywhere you can run a Python script.

I call this script via the shell commands community plugin. Recommended configuration as follows:

  1. Add the command per the above example. Make sure your path to the things2md.py script is absolute.
  2. Click the gear icon for each command, and adjust these settings:
    • In the General tab, set an alias for the command. For example, tasks_today (You'll execute this from a slash command.)
    • In the Output tab, under Output channel for stdout set it to Current file: caret position

References

  • obsidian-things-logbook - This is an Obsidian plugin that periodically syncs the Things logook with your Obsidian vault. This wasn't the behavior I was looking for, hence why I developed things2md.
  • things.py - Had I done more research first, I may have maybe used this instead of writing my own script, but I'm definitely learning from it now! For example, how some dates are stored.
  • things.sh - I found this shell script late in the development of things2md, but it looks like another good interpretation of how to query the Things database.

things2md's People

Contributors

chrisgurney avatar mikez avatar

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.