Git Product home page Git Product logo

Comments (4)

JerBouma avatar JerBouma commented on August 28, 2024 1

This issue has been resolved. This is due to you being on an older version of Python. You are on 3.8 while the typing requirements are added in 3.10. I've made a temporary repository that will work (https://pypi.org/project/financetoolkit/1.0.2/) and it is made in such a way if you now will do pip install financetoolkit -U it will update to this version.

However, note that from now on, all future package versions will be based on Python 3.10 and onwards. I would recommend upgrading your Python distribution to get access to the newest features in due time.

(test_python38) jeroenbouma@Jeroens-MacBook-Pro FinanceToolkit % pip install financetoolkit 
Collecting financetoolkit
  Using cached financetoolkit-1.0.2-py2.py3-none-any.whl (42 kB)
Installing collected packages: financetoolkit
Successfully installed financetoolkit-1.0.2
(test_python38) jeroenbouma@Jeroens-MacBook-Pro FinanceToolkit % pip install pandas
Collecting pandas
  Using cached pandas-2.0.2-cp38-cp38-macosx_11_0_arm64.whl (10.7 MB)
Collecting pytz>=2020.1
  Using cached pytz-2023.3-py2.py3-none-any.whl (502 kB)
Collecting numpy>=1.20.3
  Using cached numpy-1.24.3-cp38-cp38-macosx_11_0_arm64.whl (13.8 MB)
Collecting python-dateutil>=2.8.2
  Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting tzdata>=2022.1
  Using cached tzdata-2023.3-py2.py3-none-any.whl (341 kB)
Collecting six>=1.5
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: pytz, tzdata, six, numpy, python-dateutil, pandas
Successfully installed numpy-1.24.3 pandas-2.0.2 python-dateutil-2.8.2 pytz-2023.3 six-1.16.0 tzdata-2023.3
(test_python38) jeroenbouma@Jeroens-MacBook-Pro FinanceToolkit % python
Python 3.8.16 (default, Mar  1 2023, 21:18:45) 
[Clang 14.0.6 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from financetoolkit import Toolkit
>>> Toolkit(['AAPL', 'TSLA'], 'API_KEY').get_balance_sheet_statement()
<stdin>:1: DeprecationWarning: This version of the Finance Toolkit is depreciated. Finance Toolkit 1.0.3 and onwards require Python 3.10 and higher. Please update to the latest version of Python and the Finance Toolkit.
date                                         2018          2019         2020          2021          2022
AAPL Cash and Cash Equivalents        25913000000   48844000000  38016000000   34940000000   23646000000
     Short Term Investments           40388000000   51713000000  52927000000   27699000000   24658000000
     Cash and Short Term Investments  66301000000  100557000000  90943000000   62639000000   48304000000
     Accounts Receivable              48995000000   45804000000  37445000000   51506000000   60932000000
     Inventory                         3956000000    4106000000   4061000000    6580000000    4946000000
...                                           ...           ...          ...           ...           ...
TSLA Minority Interest                 1390361000    1492000000   1454000000    1394000000    1194000000
     Total Liabilities and Equity     29739614000   34309000000  52148000000   62131000000   82338000000
     Total Investments                          0             0            0     131000000    5932000000
     Total Debt                       13827271000   13419000000  11739000000    6834000000    3099000000
     Net Debt                         10141653000    7151000000  -7645000000  -10742000000  -19086000000

[86 rows x 5 columns]
>>> exit()
(test_python38) jeroenbouma@Jeroens-MacBook-Pro FinanceToolkit % conda list
# packages in environment at /Users/jeroenbouma/miniconda3/envs/test_python38:
#
# Name                    Version                   Build  Channel
ca-certificates           2023.05.30           hca03da5_0  
financetoolkit            1.0.2                    pypi_0    pypi
libcxx                    14.0.6               h848a8c0_0  
libffi                    3.4.4                hca03da5_0  
ncurses                   6.4                  h313beb8_0  
numpy                     1.24.3                   pypi_0    pypi
openssl                   1.1.1t               h1a28f6b_0  
pandas                    2.0.2                    pypi_0    pypi
pip                       23.0.1           py38hca03da5_0  
python                    3.8.16               hc0d8a6c_3  
python-dateutil           2.8.2                    pypi_0    pypi
pytz                      2023.3                   pypi_0    pypi
readline                  8.2                  h1a28f6b_0  
setuptools                67.8.0           py38hca03da5_0  
six                       1.16.0                   pypi_0    pypi
sqlite                    3.41.2               h80987f9_0  
tk                        8.6.12               hb8d0fd4_0  
tzdata                    2023.3                   pypi_0    pypi
wheel                     0.38.4           py38hca03da5_0  
xz                        5.4.2                h80987f9_0  
zlib                      1.2.13               h5a0b063_0  
(test_python38) jeroenbouma@Jeroens-MacBook-Pro FinanceToolkit % 

from financetoolkit.

JerBouma avatar JerBouma commented on August 28, 2024

Hello! Can you provide me with the full error message so I can look into it?

Seems to be working just fine from my side.

image

from financetoolkit.

xmagcx avatar xmagcx commented on August 28, 2024

sure, i also attached the source code that i am using
error.log

from financetoolkit import Toolkit

companies = Toolkit(['AAPL', 'MSFT'], api_key="f127ecd7b9084a166e1a7c853a7ef195")

an Enterprise example

enterprise = companies.get_enterprise()

a Historical example

historical_data = companies.get_historical_data(start='2000-01-01', end='2020-01-01')

a Financial Statement example

balance_sheet_statement = companies.get_balance_sheet_statement()

a Ratios example

profitability_ratios = companies.ratios.collect_profitability_ratios()

Show the profitability ratios for Apple

profitability_ratios.loc['AAPL']

from financetoolkit.

JerBouma avatar JerBouma commented on August 28, 2024

Got it, will fix tomorrow!

from financetoolkit.

Related Issues (20)

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.