Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggest to loosen the dependency on yfinance #3

Closed
Agnes-U opened this issue Nov 16, 2022 · 3 comments
Closed

Suggest to loosen the dependency on yfinance #3

Agnes-U opened this issue Nov 16, 2022 · 3 comments

Comments

@Agnes-U
Copy link
Contributor

Agnes-U commented Nov 16, 2022

Hi, your project Options-Max-Pain-Calculator requires "yfinance==0.1.68" in its dependency. After analyzing the source code, we found that some other versions of yfinance can also be suitable without affecting your project, i.e., yfinance 0.1.69. Therefore, we suggest to loosen the dependency on yfinance from "yfinance==0.1.68" to "yfinance>=0.1.68,<=0.1.69" to avoid any possible conflict for importing more packages or for downstream projects that may use Options-Max-Pain-Calculator.

May I pull a request to loosen the dependency on yfinance?

By the way, could you please tell us whether such dependency analysis may be potentially helpful for maintaining dependencies easier during your development?



For your reference, here are details in our analysis.

Your project Options-Max-Pain-Calculator(commit id: e67bd57) directly uses 2 APIs from package yfinance.

yfinance.ticker.Ticker.__init__, yfinance.ticker.Ticker.option_chain

From which, 13 functions are then indirectly called, including 7 yfinance's internal APIs and 6 outsider APIs, as follows (neglecting some repeated function occurrences).

[/asad70/Options-Max-Pain-Calculator]
+--yfinance.ticker.Ticker.__init__
|      +--yfinance.base.TickerBase.__init__
|      |      +--yfinance.utils.empty_df
|      |      |      +--pandas.DataFrame
|      |      +--yfinance.utils.is_isin
|      |      |      +--re.match
|      |      +--yfinance.utils.get_ticker_by_isin
|      |      |      +--yfinance.utils.get_all_by_isin
|      |      |      |      +--yfinance.utils.is_isin
+--yfinance.ticker.Ticker.option_chain
|      +--yfinance.ticker.Ticker._download_options
|      |      +--requests.get
|      |      +--datetime.datetime.utcfromtimestamp
|      +--collections.namedtuple
|      +--yfinance.ticker.Ticker._options2df
|      |      +--pandas.DataFrame
|      |      +--pandas.to_datetime

We scan yfinance's versions among [0.1.69] and 0.1.68, the changing functions (diffs being listed below) have none intersection with any function or API we mentioned above (either directly or indirectly called by this project).

diff: 0.1.68(original) 0.1.69
['yfinance.base.TickerBase.history', 'yfinance.base.TickerBase']

As for other packages, the APIs of @outside_package_name are called by yfinance in the call graph and the dependencies on these packages also stay the same in our suggested versions, thus avoiding any outside conflict.

Therefore, we believe that it is quite safe to loose your dependency on yfinance from "yfinance==0.1.68" to "yfinance>=0.1.68,<=0.1.69". This will improve the applicability of Options-Max-Pain-Calculator and reduce the possibility of any further dependency conflict with other projects/packages.

@asad70
Copy link
Owner

asad70 commented Nov 16, 2022

Make a pr

@Agnes-U
Copy link
Contributor Author

Agnes-U commented Nov 20, 2022

#4

@asad70
Copy link
Owner

asad70 commented Nov 20, 2022

Done, thankx

@asad70 asad70 closed this as completed Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants