The source project of this merge request has been removed.
Add interface to 'export' command, like 'list' but takes tags
Currently with list() interface, it uses timew export but we can only give an interval. However timewarrior itself can also take a list of tags as additional arguments, applied with AND to filter the task list further. This is more useful if we want to grab intervals for only certain tags, presumably we want to get a list of ids tagged with something, so we can then modify their tags.
new interface .export() takes same args as .list() (ie optional date range), but also can take a list of tags=[] that will narrow the filter
supplying no argument to .export() just exports all tags, like timew command does itself
>>> from timew import TimeWarrior
>>> from pprint import pprint as pp
>>> timew = TimeWarrior()
>>> pp(timew.export())
[{'end': '20211010T231936Z',
'id': 2,
'start': '20211010T231340Z',
'tags': ['this/', 'this/test2/', 'this/test2/test2test1']},
{'id': 1,
'start': '20211011T020035Z',
'tags': ['!this is a test_->', 'this/']}]
>>> pp(timew.export(tags=['this/test2/test2test1']))
[{'end': '20211010T231936Z',
'id': 2,
'start': '20211010T231340Z',
'tags': ['this/', 'this/test2/', 'this/test2/test2test1']}]
>>> pp(timew.export(tags=['this/']))
[{'end': '20211010T231936Z',
'id': 2,
'start': '20211010T231340Z',
'tags': ['this/', 'this/test2/', 'this/test2/test2test1']},
{'id': 1,
'start': '20211011T020035Z',
'tags': ['!this is a test_->', 'this/']}]
>>> pp(timew.export(tags=['foo']))
[]
>>> pp(timew.export(tags=['this/', 'this/test2/']))
[{'end': '20211010T231936Z',
'id': 2,
'start': '20211010T231340Z',
'tags': ['this/', 'this/test2/', 'this/test2/test2test1']}]