Try the NamedTuple apptoach got google takeouts
This commit is contained in:
parent
c877104b90
commit
5fd5b91b92
1 changed files with 20 additions and 1 deletions
|
@ -1,10 +1,29 @@
|
|||
from typing import NamedTuple
|
||||
from ...core.common import Paths
|
||||
|
||||
class google(NamedTuple):
|
||||
'''
|
||||
Expects [[https://takeout.google.com][Google Takeout]] data.
|
||||
'''
|
||||
takeout_path: Paths # path/paths/glob for the takeout zips
|
||||
|
||||
###
|
||||
|
||||
from my.config import google as user_config
|
||||
|
||||
###
|
||||
# TODO: generalize the thing from my.reddit
|
||||
# i.e. config = make_config(google, user_config)
|
||||
# reveal_type(config) should be 'google'
|
||||
config = google(**{k: v for k, v in vars(user_config).items() if k in google._fields})
|
||||
###
|
||||
|
||||
from pathlib import Path
|
||||
from typing import Optional, Iterable
|
||||
|
||||
from ...common import get_files
|
||||
from ...kython.kompress import kopen, kexists
|
||||
|
||||
from my.config import google as config
|
||||
|
||||
def get_takeouts(*, path: Optional[str]=None) -> Iterable[Path]:
|
||||
"""
|
||||
|
|
Loading…
Add table
Reference in a new issue