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.
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.
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.
Modification of existing Tasks and Projects require an auth token, which can be generated via the app. Things > Preferences > General > Enable Things URLs
Right click on a task, Share > Copy Link
paste that link, things:///show?id=$value
where $value
is the id of the task/project.
Create a task:
>>> from pyThings.tasks import AddTask
>>> AddTask(title='A New Task')
Perquisites:
Update an existing task:
>>> from pyThings.tasks import UpdateTask
>>> UpdateTask(auth_token=auth_token, task_id='ID_STRING', completed=True)
Create a project:
>>> from pyThings.projects import AddProject
>>> AddProject(title='My New Project')
Perquisites:
Update an existing project:
>>> from pyThings.projects import UpdateProject
>>> UpdateProject(auth_token=auth_token, task_id='ID_STRING', completed=True)
Query and and show the search:
>>> from pyThings.search import Search
>>> Search('search')
things:///search?&query=search
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
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'
}
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"
}
}
])