new: todoist

This commit is contained in:
Madeline Cameron 2021-04-06 19:43:25 -04:00
parent c858189508
commit 1eb8d067c5

37
my/todoist.py Normal file
View file

@ -0,0 +1,37 @@
'''
Todoist data
'''
REQUIRES = [
'git+https://github.com/hpi/todoist'
]
from dataclasses import dataclass
from pathlib import Path
from typing import Sequence, Iterable
from .core import Paths, get_files
from my.config import todoist as user_config
@dataclass
class todoist(user_config):
# paths[s]/glob to the exported JSON data
export_path: Paths
def inputs() -> Sequence[Path]:
return get_files(todoist.export_path)
import todoist.dal as dal
def projects():
_dal = dal.DAL(inputs())
yield from _dal.projects()
def tasks():
_dal = dal.DAL(inputs())
yield from _dal.tasks()