new: todoist
This commit is contained in:
parent
c858189508
commit
1eb8d067c5
1 changed files with 37 additions and 0 deletions
37
my/todoist.py
Normal file
37
my/todoist.py
Normal 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()
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue