Giter Site home page Giter Site logo

martinpyka / financial_life Goto Github PK

View Code? Open in Web Editor NEW
134.0 134.0 26.0 888 KB

A framework for analysing financial products in personalized contexts

License: Apache License 2.0

Python 97.47% HTML 2.47% Shell 0.06%
financial financial-plans financial-products loan python simulation

financial_life's People

Contributors

martinpyka avatar siecje avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

financial_life's Issues

Add data-field to transaction

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).

Reports should be of type pandas.DataFrame

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.

SyntaxError: invalid syntax

  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

Use CapWords for class names

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?

Error simulation.add_regular()

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

Cannot build html reports - jpg not supported.

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.     

Add appreciation/depreciation rate for assets/properties

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.

Error with using add_unique() with loans

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.

Add predefined simulations to framework

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.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.