monzo.monzoexport: initial module

This commit is contained in:
karlicoss 2023-11-02 00:27:09 +00:00
parent 105928238f
commit 7631f1f2e4
3 changed files with 51 additions and 0 deletions

View file

@ -269,3 +269,8 @@ class whatsapp:
class harmonic:
export_path: Paths
class monzo:
class monzoexport:
export_path: Paths

45
my/monzo/monzoexport.py Normal file
View file

@ -0,0 +1,45 @@
"""
Monzo transactions data (using https://github.com/karlicoss/monzoexport )
"""
REQUIRES = [
'git+https://github.com/karlicoss/monzoexport',
]
from dataclasses import dataclass
from pathlib import Path
from typing import Sequence, Iterator
from my.core import (
Paths,
get_files,
make_logger,
)
import my.config
@dataclass
class config(my.config.monzo.monzoexport):
'''
Uses [[https://github.com/karlicoss/monzoexport][ghexport]] outputs.
'''
export_path: Paths
'''path[s]/glob to the exported JSON data'''
logger = make_logger(__name__)
def inputs() -> Sequence[Path]:
return get_files(config.export_path)
import monzoexport.dal as dal
def _dal() -> dal.DAL:
return dal.DAL(inputs())
def transactions() -> Iterator[dal.MonzoTransaction]:
return _dal().transactions()

View file

@ -153,6 +153,7 @@ commands =
my.ip.all \
my.kobo \
my.location.gpslogger \
my.monzo.monzoexport \
my.orgmode \
my.pdfs \
my.pinboard \