martinpyka / financial_life Goto Github PK
View Code? Open in Web Editor NEWA framework for analysing financial products in personalized contexts
License: Apache License 2.0
A framework for analysing financial products in personalized contexts
License: Apache License 2.0
Each transaction should have an optional data-field in which additional information about the transaction can be stored in a dictionary form. This would allow to create controllers that can operate on meta-information about transactions (e.g. for tax return calculations).
This will be the next feature that I plan to implement. Reports should be of type pandas.DataFrame, to leverage the data analysis tools available through pandas in this context.
File "/usr/local/lib/python2.7/site-packages/financial_life/financing/accounts.py", line 103
def __init__(self, *accounts, name = None, date = None, meta = None):
^
SyntaxError: invalid syntax
It's the Python standard in PEP-8, and having classes with Cap_Words (e.g., Bank_Account
) is confusing. Since the API is not finalized yet, do you think it's possible to change those to BankAccount
etc, and maybe keep the old ones, but with a deprecation warning?
I get an error when I run the usage example in the readme.
Traceback (most recent call last):
File "fin.py", line 12, in <module>
simulation.add_regular('Income', account, 2000, interval = 'monthly')
File "C:\Users\cody\Desktop\fin\venv\lib\site-packages\financial_life\financing\accounts.py", line 236, in add_regular
date_start = validate.valid_date(date_start)
File "C:\Users\cody\Desktop\fin\venv\lib\site-packages\financial_life\financing\validate.py", line 44, in valid_date
return Bank_Date.fromtimestamp(date.timestamp())
OverflowError: timestamp out of range
Traceback:
Traceback (most recent call last):
File "simple.py", line 135, in <module>
example2()
File "simple.py", line 81, in example2
html.report(simulation, style="standard", output_dir = result_folder)
File "/home/masasin/.virtualenvs/financial_life/lib/python3.6/site-packages/financial_life/reports/html.py", line 34, in report
render_module.render(simulation, output_dir)
File "/home/masasin/.virtualenvs/financial_life/lib/python3.6/site-packages/financial_life/reports/../templates/html/standard/render.py", line 35, in render
img_data = plt.summary_img(*simulation.reports('yearly'), target = img_folder)
File "/home/masasin/.virtualenvs/financial_life/lib/python3.6/site-packages/financial_life/financing/plotting.py", line 74, in summary_img
fig.savefig(target + prefix + 'wealth.jpg', dpi = dpi)
File "/home/masasin/.virtualenvs/financial_life/lib/python3.6/site-packages/matplotlib/figure.py", line 1573, in savefig
self.canvas.print_figure(*args, **kwargs)
File "/home/masasin/.virtualenvs/financial_life/lib/python3.6/site-packages/matplotlib/backend_bases.py", line 2153, in print_figure
canvas = self._get_output_canvas(format)
File "/home/masasin/.virtualenvs/financial_life/lib/python3.6/site-packages/matplotlib/backend_bases.py", line 2093, in _get_output_canvas
'%s.' % (format, ', '.join(formats)))
ValueError: Format "jpg" is not supported.
Supported formats: eps, pdf, pgf, png, ps, raw, rgba, svg, svgz.
It would be useful to have an appreciation/depreciation rate for properties. This would allow a user to do thinks like add their car and car loan to a simulation as a depreciating asset, or add an appreciation factor to a property to make it easy to see LTV over time, if an asset is going to be underwater in the future, etc. This functionality could also be used to add inflation to simulations to produce outputs in inflation adjusted dollars.
Some formats (e.g. '1.1.2020') work, but others, like the standard ISO one, do not: '2020-01-01'.
When adding a unique from loan to a dummy account:
simulation.add_unique(loan, 'Damages', 12000, date=datetime(2020,1,1))
I get the following error:
/home/masasin/.virtualenvs/financial_life/lib/python3.6/site-packages/financial_life/financing/accounts.py:706: UserWarning: Difference between current date and next date is 0 and not 1
warnings.warn('Difference between current date and next date is %i and not 1' % delta)
Traceback (most recent call last):
File "finsim.py", line 19, in <module>
simulation.simulate(delta=timedelta(days=365*10))
File "/home/masasin/.virtualenvs/financial_life/lib/python3.6/site-packages/financial_life/financing/accounts.py", line 509, in simulate
self.make_transfer(payment)
File "/home/masasin/.virtualenvs/financial_life/lib/python3.6/site-packages/financial_life/financing/accounts.py", line 462, in make_transfer
meta = payment['meta']
TypeError: make_report() got an unexpected keyword argument 'date'
You can simulate the expected behaviour by doing:
simulation.add_unique('Damages', loan, -12000, date=datetime(2020,1,1))
edit: This doesn't do anything either if the starting loan amount is 0, but works when it is 0.01 or any other number.
Account classes require thorough test cases.
Predefined and parametrized simulations would help to focus even more on certain questions that the user wants to answer with fl.
Example:
buying real estate for living and later on for renting
the simulation could setup all revelant accounts and could be parametric (e.g. number of years living in this property before renting, interests etc.)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.