jackmoody11 / autodcf

📊 Easy plug-and-chug discounted cash flow model framework that allows for advanced modeling and sensitivity tests.
https://jack-moody.com/autodcf/
MIT License
15 stars 2 forks source link

Balance cannot interpret "assets" parameter. #14

Open jeongmincha opened 4 years ago

jeongmincha commented 4 years ago

Describe the bug Even the first line of your example in the main README doesn't work.

To Reproduce

from autodcf.company import BalanceSheet, CashFlows, Company, IncomeStatement
from autodcf.models import SimpleDCF
balance_sheet = BalanceSheet(assets=100, liabilities=50)

Error Message:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-3-d255612aabf1> in <module>
----> 1 balance_sheet = BalanceSheet(assets=100, liabilities=50)

TypeError: __init__() got an unexpected keyword argument 'assets'

Expected behavior This code is expected not to make any error.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information): If specific to your OS, please specify which OS you are using [e.g. Windows, macOS, Ubuntu Linux, etc.]

Additional context Add any other context about the problem here.

Crazylegs85 commented 3 years ago

This issue seems old, but for anyone wondering about it I'm leaving a response.

It seems the example in the README.rst is incorrect. If you look in the balance_sheet.py file, or better yet run help(balance_sheet) in the REPL or Ipython session, you'll see that the assets and liabilities are read-only properties. All you need to do to continue with the example is fill-in the values for each of the parameters for the assets and liabilities. In my case, I just set everything to 10.00.

balance_sheet = BalanceSheet(cash=10.00,
                             short_term_investments=10.00,
                             net_receivables=10.00,
                             inventory=10.00,
                             other_current_assets=10.00,
                             ppe=10.00,
                             goodwill=10.00,
                             intangible_assets=10.00,
                             other_lt_assets=10.00,
                             accounts_payable=10.00,
                             accrued_liabilities=10.00,
                             short_term_debt=10.00,
                             current_part_lt_debt=10.00,
                             other_current_liabilities=10.00,
                             long_term_debt=10.00,
                             other_lt_liabilities=10.00,
                             deferred_lt_liabilities=10.00,
                             minority_interest=10.00,)
jackmoody11 commented 3 years ago

Thanks for leaving this @Crazylegs85! I haven't been great about updating the documentation for this project. I was doing this more as a proof of concept, but it seems that people might actually be interested in using it.

If that is the case, I need to find a better way to allow users to load data. I'm open to any suggestions.