11 Commits

Author SHA1 Message Date
c692a01f72
Graph now saves the images and increases its width 2021-04-24 00:27:37 +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
2007f2bb9c
Adds better docstrings
and prints helpful messages to user.
2021-02-05 00:51:20 +00:00
51b16c7977
Fixes several FileNotFound at initialization
Added multiple Path.mkdir() when .pfstate, backup, raw and data
directories weren't created.
Adds try-except clause around functions called in init, so that errors
in the early stages are catched to remove already initialized state
files.
Moves filename definitions to tools using global vars.
Removed state.filename = p from main.py introduced when the state
filename was changed.
`self._save()` removed from `PFState` `__init__` as it's not needed. All
setattr already call it.
2021-02-04 23:45:24 +00:00
647af8be5b
Adds graph date options and report option
Also checks for transactions before loop incase of months without
transactions.
2021-02-03 21:57:57 +00:00
ff324ca0a6
Removes unnecessary Transactions class 2021-02-02 22:07:17 +00:00
311c5358f1
Removes duplicated sort_by_bank method 2021-02-02 22:03:55 +00:00
fe26bf8a6a
Adds two new plot methods and health expenses
Two new graphs created, discrete, where all discretionary expenses are
plotted, and average, for the yearly average. This later one will be
moved to report form.
Health expenses separated from required. Commute moved from fixed to
required expenses.
New by_month_and_category functions added to transactions.py.
2021-02-02 21:57:07 +00:00
fe840b622c
Adds graph subcommand
Moves all graph and matplotlib dependencies to graph.py.
Moves Transactions and Categories methods outside the class for better
visibility.
Variable expenses renamed to required.
transactions.py now has by_year, by_month, by_categories in global scope
and slightly improved perfomance.
2021-01-29 22:48:55 +00:00
9971e6214f
Major refactor
Add new tools.py to handle subcommands.
Most workflow moved to subcommands handlers, which in turn calls
tools.py functions.
Moves internal state (dict which gets parsed into PFState) to folder
.pfstate (sort of like git) and renamed to state.
New PFState class and factory pfstate function added.
*.pickle changed to .pfstate on .gitignore. Everything local stored in
.pfstate.

Adds vacation, status and backup commands. Modifies init, restart and
parse to receive PFState and call tools functions.
Vacation can add, list or remove vacations date intervals.
Backup saves either a full transaction list or the entire data folder
into .pfstate/backup folder.

Categorization functions moves to tools, deleted old one on
categories.py.
Moves parse_data and load_transactions/save_trasactions outside of
respective class to global scope.
Travel category class moved to the end of file, since it uses others in
its search method.
Removes unused initializer.py file.
2021-01-29 21:46:25 +00:00
909065eca6
Restructures project tree
Moves *.py except main and initializer.py to pfbudget folder
2020-12-18 19:11:50 +00:00