my.google.takeout.parser: new takeout parser, using https://github.com/seanbreckenridge/google_takeout_parser

adapted from https://github.com/seanbreckenridge/HPI/blob/master/my/google_takeout.py

additions:
- pass my.core.time.user_forced() to google_takeout_parser
  without it, BST gets weird results for me, e.g. US/Aleutian
- support ZipPath via a config switch
- flexible error handling via a config switch
This commit is contained in:
Dima Gerasimov 2022-04-15 12:52:15 +01:00 committed by karlicoss
parent 6e921627d3
commit f9f73dda24
2 changed files with 129 additions and 0 deletions

View file

@ -6,6 +6,8 @@ See https://beepb00p.xyz/mypy-error-handling.html#kiss for more detail
from itertools import tee
from typing import Union, TypeVar, Iterable, List, Tuple, Type, Optional, Callable, Any, cast
from .compat import Literal
T = TypeVar('T')
E = TypeVar('E', bound=Exception) # TODO make covariant?
@ -14,6 +16,7 @@ ResT = Union[T, E]
Res = ResT[T, Exception]
ErrorPolicy = Literal["yield", "raise", "drop"]
def notnone(x: Optional[T]) -> T:
assert x is not None