30 Commits

Author SHA1 Message Date
9513016d42
Adds SQLite interface and logging.conf
Begins process of porting transaction data from csv to SQLite.
Improves logging and introduces logging.conf.
2021-05-16 00:42:35 +01:00
466c884b1c
Adds README.md 2021-04-25 22:13:57 +01:00
84e5d68a6b
Removes unused imports and adds setuf.cfg
with flake8 setup.
2021-04-24 01:03:52 +01:00
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
9cdf626bdd
Adds requirements.txt 2021-01-29 22:54:34 +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
69b44fecae
Adds argparse lib to handle different run modes 2020-12-18 18:55:48 +00:00
fd1059ffb3
Moves initializer function to its own file 2020-12-18 00:14:25 +00:00
d165f566de
Bump month to last November 2020-12-04 22:52:57 +00:00
8ae1ecb2a4
Updates Bank2 parser for different locales 2020-12-04 22:49:44 +00:00
0e671ec838
Adds new travel dates 2020-09-09 21:19:00 +01:00
806bf258e4
Multiple fixes on the addition of new raw files
The initialize function has been updated with a new possible option for
a new raw file, where the Last Accessed date changed the content hadn't.
Also removes sort() when using extend() on a list as it doesn't work
correctly.
Categorization code moved to if False statement to add posterior toggle
behaviour.
New transaction print added (.desc()) which prints the description of a
transaction instead of its category to help on the manual
categorization.
Raw files now on raw dir instead of .raw
It now also accepts empty lines and # at the start for comments on data
files. TODO these are overwritten whenever the data files are updated.
2020-09-09 21:09:51 +01:00
ad9bc4a7c4
Adds plot with monthly income/spending
It separates the monthly transactions by categories and tracks income
and spending along the defined time range.
Now prints the total income/spending and the net result for the define
period of time.
Plot code is surrounded with an if False for future toggle on/off.
2020-09-09 21:03:50 +01:00
7a587213c9
Adds Transactions derived from list
New `Transactions` class derived from `list` to add auxilliary methods to a
transaction list.
New get_transactions_by_(year,month,category) methods return dict sorted
by (year,month,category).
Also adds sort_by_bank inplace.
2020-08-07 20:55:49 +01:00
2eecd2191a
Ancilliary methods to retrieve categories by type
Get methods added for income, fixed expenses, variable expenses and
discretionary expenses.
Search has regex check to detect placeholder category. Removes the need
for an additional search.
2020-08-07 20:47:17 +01:00
ca12d1846c
Automatic and manual categorization
reader.py is removed, with main.py becoming the main function where all
others are called from.
All categories added on categories.py, each with its own search function
and regex. The categorize function is also defined on the base class

The parsers have been cleaned to a more strimmed version. Each parser has
its own parse method and encoding and separator attributes.

The `Transaction` class has been incremented with all the comparator
methods. It also has the read and write from file methods.

The transactions.pickle is no longer used, since changes can be done
directly to the parsed data in the data_dir, making the file unused. A
manual categorization function has been created to help fill in the
gaps, interchangeable with directly editing the parsed .csv files. The
master record of data are the .csv present in the data_dir.
2020-08-04 20:42:29 +01:00
41d599c025
Adds parsers for multiple bank/cards
All parsers defined in parsers.py.
main.py is the calling script and reader/writer.
2020-07-11 22:26:06 +01:00
a70ca6951c
Trades tabs from report with formatting honey 2020-07-06 21:56:23 +01:00
02bf111b6d
Moves plotting to its own function 2020-07-06 21:11:07 +01:00
fa511b5e42
Adds stacked area chart to track expenditure 2020-07-06 21:06:31 +01:00
1619ee8561
Initial commit
Working csv reader, which reorders the transactions on transaction.csv
based on date. Then it aggregates the information per month based on the
used categories, and prints that information.
2020-12-03 22:39:55 +00:00