This will provide differentiation between income that's regular and
stable (long-term contract) and that which is not, such as gigs,
presents, etc.
It presents the information separated in both graphs and reports.
To have cleared information on manually added transactions to the
database, this patch adds the original column so those added after
the parsing can be marked as such.
Also adds a column to add comments to transaction, when they are not
explicit from the transaction message.
Now possible to configure each group in the categories.yaml. Only color
added at this moment. The order in which the groups are listed is used
by the graph module and will later be used by the report.
Fixes search for vacations. The negative match is now done by groups,
and the key changes from negative_regex to not_in_groups.
Only updates transactions when any travel is assigned. Was previously
updating all uncategorized transactions that reached the travel search.
Regex match now correctly done lower letters to lower letters.
Transaction __repr__ method added and updated along with __str__, to
provide a more clearer output when manually categorizing.
- Remove unnecessary category null check after db select
- Adds multiple try-catch block for misbehaving parsing
- matplotlib.plt tight_layout moved to figure method
- Fixes debit/credit index with different dates
- Check for existing banks transformed to lower chars, to avoid
capitilization problem
Investments are not normally reported on the receiving end in
transaction logs, and they introduce too much visual noise in monthly
expense graphs. As such they will later appear in relevant invesment
graphs, but are removed for now from the available choices.
Category argument added to allow the parsing of already categorized
transaction files. The new option takes an integer to indicate the
category index in a transaction row.
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.
`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.
Removes `PFState` class and surrounding code.
Removes load/save transactions methods, that were not used since
database introduction.
Removes status command from runnable.py.
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.
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.
Updates `categorize_data` to work with the `Transaction` class, which is now
used by the database.
Vacation categorizing will no longer replace previous category assigned.
`DBManager` gained new method to retrieve transactions between two dates
without any category.
Add method to `Transaction` to prepare for category update in database.
Transaction's returns from database queries are checked and assigned in
`if`s with the walrus (`:=`) operator.
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.
`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`.
`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.
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.
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.
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.
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.
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.
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.
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.