Skip to content

A python library for creating Things 3 x-calllback-urls.

License

Notifications You must be signed in to change notification settings

lucasjhall/pyThings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyThings

About

A Python library to systematically create and call x-callback-urls for Cultured Code's Things application. The entire Things URL Scheme is available here as well as a "Link Builder" which this library seeks to emulate in a pythonic way.

Requirements

xcall

Call X-Callback-URLs From the Command Line. Outputs the x-success and x-error responses to stdout/stderr.

Things running on the macOS device utilizing this library.

A write only environment

Things Callback URL Scheme is robust, but write oriented. It is not currently possible to get anything from Things as far as I could find, aside from an associated x-things-id. Which is needed to update any Task or project as touched on below.

This greatly impedes the ability to systematically update tasks that may be propagated from another source of truth, like a web based, API driven, project management suite.

Use of auth_token

Modification of existing Tasks and Projects require an auth token, which can be generated via the app. Things > Preferences > General > Enable Things URLs

Finding a Task ID

Right click on a task, Share > Copy Link paste that link, things:///show?id=$value where $value is the id of the task/project.

Examples

Tasks

Add Task

Create a task:

>>> from pyThings.tasks import AddTask
>>> AddTask(title='A New Task')

Update Task

Perquisites:

Update an existing task:

>>> from pyThings.tasks import UpdateTask
>>> UpdateTask(auth_token=auth_token, task_id='ID_STRING', completed=True)

Projects

Add Project

Create a project:

>>> from pyThings.projects import AddProject
>>> AddProject(title='My New Project')

Update Project

Perquisites:

Update an existing project:

>>> from pyThings.projects import UpdateProject
>>> UpdateProject(auth_token=auth_token, task_id='ID_STRING', completed=True)

Other Features

Search

Query and and show the search:

>>> from pyThings.search import Search
>>> Search('search')
things:///search?&query=search

Show

Navigate to and show an area, project, tag or to-do, or one of the built-in lists, optionally filtering by one or more tags. - show

>>> from pyThings.show import Show
>>> Show(query="search")

Which should generate and call:

things:///show?&query=search

Version

Get the version of the Things app and URL scheme:

>>> from pyThings.version import Version
>>> Version()
<pyThings.version.Version object at 0x102c93850>

Which looks like:

{
    'x-things-client-version': '31309505',
    'x-things-scheme-version': '2'
}

JSON

Things also has an advanced, JSON-based add command that allows more control over the projects and to-dos imported into Things. This command is intended to be used by app developers or other people familiar with scripting or programming. - json

>>> from pyThings.json import Json
>>> task = Json(
      data=[
      {
        "type": "to-do",
        "attributes": {
          "title": "Buy milk"
        }
      },
      {
        "type": "to-do",
        "attributes": {
          "title": "Buy eggs"
        }
      }
    ])

About

A python library for creating Things 3 x-calllback-urls.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages