-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add Search Utility #1949
base: dev
Are you sure you want to change the base?
Add Search Utility #1949
Conversation
Give an example use code, so people can try out. |
Sorry, by example use code do you mean providing a snippet here or adding to the README? In either case, here's a quick snippet. import json
from yfinance.utils import search
user_input = input("Enter a ticker query: ")
search_result = search(user_input, newsCount=0) # Just search for tickers
search_result_quotes = search_result.get("quotes", [])
print(json.dumps(search_result_quotes, indent=2)) # Pretty print Input
Output
|
Just so I understand the use case correctly - how is this different to |
This use case targets searching for tickers - the underlying API does also fetch related news articles, but the primary motivation behind this is some kind of ticker search functionality. I should also note that I haven't found anything in the library currently for this use case, but I could be missing something. Hope that clears this up! |
Line 502 in 930b305
|
@ValueRaider, the |
Agree. I wasn't rejecting the idea. |
Generalizes
isin
search to support new types of search queries.Use case:
I would like to be able to keep all yahoo finance code contained in the
yfinance
lib. Right now to perform a ticker search, I have to perform the following in my application:Related to #837