monzo.monzoexport: initial module
This commit is contained in:
parent
105928238f
commit
7631f1f2e4
3 changed files with 51 additions and 0 deletions
|
@ -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
45
my/monzo/monzoexport.py
Normal 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()
|
1
tox.ini
1
tox.ini
|
@ -153,6 +153,7 @@ commands =
|
|||
my.ip.all \
|
||||
my.kobo \
|
||||
my.location.gpslogger \
|
||||
my.monzo.monzoexport \
|
||||
my.orgmode \
|
||||
my.pdfs \
|
||||
my.pinboard \
|
||||
|
|
Loading…
Add table
Reference in a new issue