15 Commits

Author SHA1 Message Date
ba608093d3
Fix parsing for files w/o bank_cc naming
Fixes code flow for transactions' files with undescriptive filenames.
Adds default indexing to support banks not described in parsers.yaml.
Adds creditcard optional argument.
Command line options now passed as `dict` instead of `Namespace` to
`parse_data`. This will allow for an easier addition of future command
line options.
2021-07-07 17:05:25 +01:00
66262d8dc2
Moves period parser outside of Graph section
`period` ArgumentParser was inside of the Graph section of the
`argparser` function, resulting in confusing logical sequence.
Moved around to the beginning of the function to clarify code.
2021-07-07 16:46:50 +01:00
c0cc8d5563
Removes obsolete code
Removes `PFState` class and surrounding code.
Removes load/save transactions methods, that were not used since
database introduction.
Removes status command from runnable.py.
2021-07-05 23:07:56 +01:00
37c97453a9
Refactored report module
Bring report up-to-date with sqlite3 database and yaml configuration
files.
Updates report command in runnable.py. Moves date arg parsing to utils
module
Report and graph now share an ArgumentParser with shared date options.
2021-07-05 22:53:03 +01:00
42ab10fd90
Refactored graph module
Bring graph up-to-date with sqlite3 database and yaml files.
Fix sorted transaction query. Removes date as passed parameters.
Updates graph command in runnable.py.
2021-07-04 00:53:07 +01:00
1139dff249
Add long --database arg option 2021-07-03 00:51:55 +01:00
fb93f9d4fd
Replaces one-liner function with lambda 2021-07-03 00:23:27 +01:00
703acadaa9
Adds ArgumentParser to contain general arguments
Fix parser func arguments. The database should be passed as an argument,
not used before parsing.
Reordered and added logging to `DBManager` for better recording.
2021-06-30 21:18:06 +01:00
3e20ae97db
parser command now writes do DB
`parse_data` from parser.py now takes a `DBManager` and runs
`insert_transactions` after parsing.
`DBManager` now takes `Transaction` type and returns the same on select
queries.
`DBManager` refactored with extensive type hinting.
`Transaction` updated to reflect use in `DBManager`.
2021-06-21 23:49:23 +01:00
393e3310a4
Removes unused commands
Removes obsolete vacation and restart argument parser.
Also updates some docstrings.
2021-06-12 22:30:04 +01:00
deaa71ead4
Categorizing refactored with SQLite DB and YAML
`categorize_data` is the new entry for data categorization and receives
a DBManager. Contains the categorizing logic.
Categorizer configuration now done solely from categories.yaml file.

Ancilliary database methods added to DBManager required for categorizing
transactions.

Adds categorize to command line options.
Removes obsolete restart options and method from runnable.py.
Fixes parse and categorize method, now take cmd line arguments and
`DBManager`.

Removes obsolete tools.py, all functions already rewritten in relevant
modules.

Updated categories.yaml with new keys.
2021-06-11 22:11:07 +01:00
4d6c865bb5
Parsers configuration now on parsers.yaml
parsers.py redid with single default parser that takes configurating
parameters from a yaml file.
Additional parsing configuration can be achieved with the additional_parser
attribute on yaml and rewriting the func and parser method on child
classes of Parser.
func will be called after each transaction is created and the parser
should call the parent parser method or rewrite the entire parser
process.
The parse_data function is now called from the runnable and the parsing
process is now called from there. The parse command can take an optional
bank before is tries to extract it from the filename and multiple paths,
either files or directories.
The Transaction __init__ was fixed to take inputs from previously
initiated Transaction.
Also adds utils.py with helper functions.
2021-06-03 23:30:32 +01:00
4d9e8edec8
Changed run logic to adjust to SQLite db
Removed init and restart functions and writes to state file.
Moved create tables to init method of DBManager and launch from init
command.
Restart removed.
Rearranged order in runnable.py according to sections.

Only init command working since rest of runnable function not updated
at the moment.
2021-06-03 23:11:52 +01:00
84e5d68a6b
Removes unused imports and adds setuf.cfg
with flake8 setup.
2021-04-24 01:03:52 +01:00
88c1d9d5ca
Refactor argparser and PFState classes
Moves argparser functions to runnable.py and PFState to state.py

Main function will now only call run from runnable.py. Should make it
easier to run additional functions. Program can now be run from main.py,
or imported from pfbudget.
2021-03-07 03:14:25 +00:00