Repository Analysis

ranaroussi/yfinance

Download market data from Yahoo! Finance's API

34.2 Strong AI signal View on GitHub
34.2
Adjusted Score
34.2
Raw Score
100%
Time Factor
2026-05-28
Last Push
23,900
Stars
Python
Language
17,881
Lines of Code
91
Files
332
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 46MEDIUM 29LOW 257

Pattern Findings

332 matches across 12 categories. Click a row to expand file-level details.

Cross-Language Confusion40 hits · 228 pts
SeverityFileLineSnippet
HIGHtests/test_prices.py190 self.assertTrue(df_daily_divs.index.equals(df_intraday_divs.index))
HIGHtests/test_prices.py217 self.assertTrue(df_daily_divs.index.equals(df_intraday_divs.index))
HIGHtests/test_prices.py259 self.assertTrue(df1.index.equals(df2.index))
HIGHtests/test_prices.py274 self.assertTrue(df1.index.equals(df2.index))
HIGHtests/test_prices.py302 self.assertTrue(df1.index.equals(df2.index))
HIGHtests/test_prices.py317 self.assertTrue(df1.index.equals(df2.index))
HIGHtests/test_prices.py335 self.assertTrue(df1.index.equals(df2.index))
HIGHtests/test_prices.py350 self.assertTrue(df1.index.equals(df2.index))
HIGHtests/test_prices.py479 # Regression for #2670: when Yahoo returns {"chart": null},
HIGHtests/test_ticker.py811 self.assertTrue(i1.equals(i2))
HIGHtests/test_ticker.py813 self.assertTrue(i1.equals(i3))
HIGHtests/test_ticker.py817 self.assertTrue(i1.equals(i2))
HIGHtests/test_ticker.py819 self.assertTrue(i1.equals(i3))
HIGHtests/test_ticker.py823 self.assertTrue(i1.equals(i2))
HIGHtests/test_ticker.py825 self.assertTrue(i1.equals(i3))
HIGHtests/test_ticker.py829 self.assertTrue(i1.equals(i2))
HIGHtests/test_ticker.py831 self.assertTrue(i1.equals(i3))
HIGHtests/test_ticker.py835 self.assertTrue(i1.equals(i2))
HIGHtests/test_ticker.py837 self.assertTrue(i1.equals(i3))
HIGHtests/test_ticker.py841 self.assertTrue(i1.equals(i2))
HIGHtests/test_ticker.py843 self.assertTrue(i1.equals(i3))
HIGHtests/test_ticker.py848 self.assertTrue(i1.equals(i2))
HIGHtests/test_ticker.py852 self.assertTrue(i1.equals(i2))
HIGHtests/test_ticker.py856 self.assertTrue(i1.equals(i2))
HIGHtests/test_ticker.py860 self.assertTrue(i1.equals(i2))
HIGHtests/test_ticker.py865 self.assertTrue(i1.equals(i2))
HIGHtests/test_ticker.py869 self.assertTrue(i1.equals(i2))
HIGHtests/test_ticker.py873 self.assertTrue(i1.equals(i2))
HIGHtests/test_ticker.py877 self.assertTrue(i1.equals(i2))
HIGHtests/test_ticker.py881 self.assertTrue(i1.equals(i2))
HIGHtests/test_ticker.py885 self.assertTrue(i1.equals(i2))
HIGHtests/test_ticker.py593 self.assertTrue(data.equals(data2), "property not defaulting to 'pretty=True'")
HIGHtests/test_ticker.py622 self.assertTrue(data.equals(data2), "property not defaulting to 'pretty=True'")
HIGHtests/test_ticker.py650 self.assertTrue(data.equals(data2), "property not defaulting to 'pretty=True'")
HIGHtests/test_ticker.py679 self.assertTrue(data.equals(data2), "property not defaulting to 'pretty=True'")
HIGHtests/test_ticker.py708 self.assertTrue(data.equals(data2), "property not defaulting to 'pretty=True'")
HIGHtests/test_ticker.py737 self.assertTrue(data.equals(data2), "property not defaulting to 'pretty=True'")
HIGHtests/test_ticker.py766 self.assertTrue(data.equals(data2), "property not defaulting to 'pretty=True'")
HIGHtests/test_ticker.py794 self.assertTrue(data.equals(data2), "property not defaulting to 'pretty=True'")
HIGHtests/test_ticker.py946 self.assertTrue(data.equals(data_summary))
Hyper-Verbose Identifiers101 hits · 102 pts
SeverityFileLineSnippet
LOWyfinance/_http.py83def _supported_session_classes() -> tuple:
LOWyfinance/utils.py325def retrieve_financial_details(data):
LOWyfinance/utils.py355def format_annual_financial_statement(level_detail, annual_dicts, annual_order, ttm_dicts=None, ttm_order=None):
LOWyfinance/utils.py385def format_quarterly_financial_statement(_statement, level_detail, order):
LOWyfinance/utils.py1027def _generate_table_configurations(title = None) -> str:
LOWyfinance/utils.py1077def generate_list_table_from_dict_universal(data: dict, bullets: bool=True, title: str=None, concat_keys=[]) -> str:
LOWyfinance/utils.py1042def generate_list_table_from_dict(data: dict, bullets: bool=True, title: str=None) -> str:
LOWyfinance/utils.py1060# def generate_list_table_from_dict_of_dict(data: dict, bullets: bool=True, title: str=None) -> str:
LOWyfinance/base.py220 def get_recommendations_summary(self, as_dict=False):
LOWyfinance/base.py246 def get_institutional_holders(self, as_dict=False):
LOWyfinance/base.py274 def get_insider_roster_holders(self, as_dict=False):
LOWyfinance/base.py300 def get_analyst_price_targets(self) -> dict:
LOWyfinance/base.py628 def _get_earnings_dates_using_scrape(self, limit = 12, offset = 0) -> Optional[pd.DataFrame]:
LOWyfinance/base.py723 def _get_earnings_dates_using_screener(self, limit=12) -> Optional[pd.DataFrame]:
LOWyfinance/data.py252 def _get_cookie_and_crumb_basic(self, timeout):
LOWyfinance/calendars.py295 def _get_most_active_operands(
LOWyfinance/calendars.py334 def _get_startdatetime_operators(self, start=None, end=None) -> CalendarQuery:
LOWyfinance/calendars.py472 def get_economic_events_calendar(
LOWyfinance/scrapers/holders.py110 def _parse_institution_ownership(self, data):
LOWyfinance/scrapers/holders.py134 def _parse_major_direct_holders(self, data):
LOWyfinance/scrapers/holders.py146 def _parse_major_holders_breakdown(self, data):
LOWyfinance/scrapers/holders.py155 def _parse_insider_transactions(self, data):
LOWyfinance/scrapers/holders.py209 def _parse_net_share_purchase_activity(self, data):
LOWyfinance/scrapers/fundamentals.py57 def get_balance_sheet_time_series(self, freq="yearly") -> pd.DataFrame:
LOWyfinance/scrapers/fundamentals.py63 def get_cash_flow_time_series(self, freq="yearly") -> pd.DataFrame:
LOWyfinance/scrapers/fundamentals.py111 def _get_financials_time_series(self, timescale, keys: list) -> pd.DataFrame:
LOWyfinance/scrapers/quote.py287 def regular_market_previous_close(self):
LOWyfinance/scrapers/quote.py411 def three_month_average_volume(self):
LOWyfinance/scrapers/quote.py672 def _fetch_valuation_measures(self):
LOWyfinance/scrapers/history.py665 def _reconstruct_intervals_batch(self, df, interval, prepost, tag=-1):
LOWyfinance/scrapers/history.py2659 def _fix_prices_sudden_change(self, df, interval, tz_exchange, change, correct_volume=False, correct_dividend=False)
LOWyfinance/scrapers/history.py2934 def _calc_volume_zscore_weighted(volume, dt, block):
LOWyfinance/domain/industry.py88 def _parse_top_performing_companies(self, top_performing_companies: Dict) -> Optional[_pd.DataFrame]:
LOWyfinance/domain/industry.py110 def _parse_top_growth_companies(self, top_growth_companies: Dict) -> Optional[_pd.DataFrame]:
LOWtests/test_download_concurrency.py22 def test_concurrent_downloads_keep_results_separate(self):
LOWtests/test_download_concurrency.py37 def test_concurrent_downloads_do_not_raise(self):
LOWtests/test_download_concurrency.py43 def test_download_does_not_use_module_globals(self):
LOWtests/test_ticker_locale.py16 def test_default_locale_is_en_us(self):
LOWtests/test_ticker_locale.py20 def test_default_returns_english(self):
LOWtests/test_ticker_locale.py45 def test_locale_us_listing_not_translated(self):
LOWtests/test_utils.py25 def test_mixed_timezones_to_datetime_fails(self):
LOWtests/test_utils.py31 def test_mixed_timezones_to_datetime(self):
LOWtests/test_utils.py45 def test_is_valid_period_format_valid(self):
LOWtests/test_utils.py51 def test_is_valid_period_format_invalid(self):
LOWtests/test_utils.py58 def test_is_valid_period_format_edge_cases(self):
LOWtests/test_utils.py107 def test_same_month_different_year(self):
LOWtests/test_utils.py131 def test_nonstandard_quarters(self):
LOWtests/test_screener.py15 def test_set_large_size_in_body(self, mock_post):
LOWtests/test_sector_region.py7 def test_default_region_is_us(self):
LOWtests/test_sector_region.py11 def test_region_is_normalized(self):
LOWtests/test_sector_region.py16 def test_us_and_gb_top_companies_differ(self):
LOWtests/test_sector_region.py25 def test_industry_region_propagates(self):
LOWtests/test_calendars.py13 def test_get_earnings_calendar(self):
LOWtests/test_calendars.py27 def test_get_earnings_calendar_init_params(self):
LOWtests/test_calendars.py35 def test_get_ipo_info_calendar(self):
LOWtests/test_calendars.py41 def test_get_economic_events_calendar(self):
LOWtests/test_prices.py35 def test_download_multi_large_interval(self):
LOWtests/test_prices.py48 def test_download_multi_small_interval(self):
LOWtests/test_prices.py53 def test_download_with_invalid_ticker(self):
LOWtests/test_prices.py400 def test_prune_post_intraday_us(self):
41 more matches not shown…
Excessive Try-Catch Wrapping56 hits · 68 pts
SeverityFileLineSnippet
LOWyfinance/multi.py212 except Exception:
LOWyfinance/multi.py293 except Exception as e:
LOWyfinance/cache.py67 except Exception:
LOWyfinance/cache.py262 except Exception:
LOWyfinance/cache.py472 except Exception:
MEDIUMyfinance/utils.py351 print(f"An error occurred while processing the key: {e}")
LOWyfinance/live.py30 except Exception as e:
LOWyfinance/live.py66 except Exception as e:
LOWyfinance/live.py86 except Exception as e:
MEDIUMyfinance/live.py91 print(f"Error in heartbeat subscription: {e}")
LOWyfinance/live.py171 except Exception as handler_exception:
MEDIUMyfinance/live.py176 print("Error in message handler:", handler_exception)
LOWyfinance/live.py187 except Exception as e:
MEDIUMyfinance/live.py192 print("Error while listening to messages: %s", e)
LOWyfinance/live.py242 except Exception as e:
LOWyfinance/live.py314 except Exception as handler_exception:
MEDIUMyfinance/live.py319 print("Error in message handler:", handler_exception)
LOWyfinance/live.py329 except Exception as e:
MEDIUMyfinance/live.py334 print("Error while listening to messages: %s", e)
MEDIUMyfinance/live.py59def _connect(self):
MEDIUMyfinance/live.py235def _connect(self):
LOWyfinance/base.py187 except Exception as e:
LOWyfinance/base.py200 except Exception as err:
LOWyfinance/base.py528 except Exception as e:
LOWyfinance/data.py145 except Exception:
LOWyfinance/data.py441 except Exception as e:
LOWyfinance/data.py490 except Exception:
LOWyfinance/data.py603 except Exception as e:
LOWyfinance/scrapers/fundamentals.py106 except Exception:
LOWyfinance/scrapers/quote.py138 except Exception:
LOWyfinance/scrapers/quote.py465 except Exception as e:
LOWyfinance/scrapers/quote.py676 except Exception as e:
LOWyfinance/scrapers/quote.py700 except Exception as e:
LOWyfinance/scrapers/funds.py196 except Exception as e:
LOWyfinance/scrapers/history.py231 except Exception:
LOWyfinance/scrapers/history.py244 except Exception:
LOWyfinance/scrapers/history.py499 except Exception as e:
LOWyfinance/scrapers/history.py1082 except Exception:
LOWyfinance/domain/market.py91 except Exception as e:
LOWyfinance/domain/market.py112 except Exception as e:
LOWyfinance/domain/market.py125 except Exception as e:
MEDIUMyfinance/domain/market.py29def __init__(self, market, session=None, timeout=30):
LOWyfinance/domain/industry.py148 except Exception as e:
LOWyfinance/domain/sector.py147 except Exception as e:
LOWtests/test_ticker.py1035 except Exception as e:
LOWtests/test_ticker.py1104 except Exception:
LOWtests/test_ticker.py1235 except Exception as e:
LOWtests/test_price_repair.py337 except Exception:
LOWtests/test_price_repair.py377 except Exception:
LOWtests/test_price_repair.py421 except Exception:
LOWtests/test_price_repair.py491 except Exception:
LOWtests/test_price_repair.py641 except Exception:
LOWtests/test_price_repair.py674 except Exception:
LOWtests/test_price_repair.py689 except Exception:
LOWtests/test_multi.py41 except Exception as e:
MEDIUMtests/test_multi.py36def do_download(tickers, key):
Decorative Section Separators18 hits · 66 pts
SeverityFileLineSnippet
MEDIUMyfinance/cache.py15# --------------
MEDIUMyfinance/cache.py17# --------------
MEDIUMyfinance/cache.py210# --------------
MEDIUMyfinance/cache.py212# --------------
MEDIUMyfinance/cache.py420# --------------
MEDIUMyfinance/cache.py422# --------------
MEDIUMyfinance/cache.py621# --------------
MEDIUMyfinance/cache.py623# --------------
MEDIUMyfinance/ticker.py107 # ------------------------
MEDIUMyfinance/base.py131 # ------------------------
MEDIUMdoc/source/reference/examples/live_async.py9 # =======================
MEDIUMdoc/source/reference/examples/live_async.py11 # =======================
MEDIUMdoc/source/reference/examples/live_async.py16 # =======================
MEDIUMdoc/source/reference/examples/live_async.py18 # =======================
MEDIUMdoc/source/reference/examples/live_sync.py7# =======================
MEDIUMdoc/source/reference/examples/live_sync.py9# =======================
MEDIUMdoc/source/reference/examples/live_sync.py14# =======================
MEDIUMdoc/source/reference/examples/live_sync.py16# =======================
Unused Imports36 hits · 36 pts
SeverityFileLineSnippet
LOWyfinance/tickers.py22
LOWyfinance/multi.py22
LOWyfinance/__init__.py23
LOWyfinance/__init__.py24
LOWyfinance/__init__.py25
LOWyfinance/__init__.py26
LOWyfinance/__init__.py27
LOWyfinance/__init__.py28
LOWyfinance/__init__.py29
LOWyfinance/__init__.py29
LOWyfinance/__init__.py30
LOWyfinance/__init__.py31
LOWyfinance/__init__.py32
LOWyfinance/__init__.py33
LOWyfinance/__init__.py34
LOWyfinance/__init__.py34
LOWyfinance/__init__.py36
LOWyfinance/__init__.py38
LOWyfinance/__init__.py38
LOWyfinance/__init__.py38
LOWyfinance/__init__.py39
LOWyfinance/__init__.py39
LOWyfinance/utils.py22
LOWyfinance/utils.py49
LOWyfinance/ticker.py22
LOWyfinance/base.py22
LOWyfinance/calendars.py1
LOWyfinance/screener/__init__.py1
LOWyfinance/screener/__init__.py1
LOWyfinance/screener/__init__.py1
LOWyfinance/screener/__init__.py2
LOWyfinance/screener/__init__.py2
LOWyfinance/domain/__init__.py2
LOWyfinance/domain/__init__.py3
LOWyfinance/domain/industry.py1
LOWyfinance/domain/sector.py1
Deep Nesting36 hits · 34 pts
SeverityFileLineSnippet
LOWyfinance/multi.py120
LOWyfinance/multi.py226
LOWyfinance/utils.py325
LOWyfinance/utils.py473
LOWyfinance/utils.py647
LOWyfinance/utils.py668
LOWyfinance/utils.py756
LOWyfinance/utils.py904
LOWyfinance/utils.py1077
LOWyfinance/live.py75
LOWyfinance/live.py140
LOWyfinance/live.py291
LOWyfinance/base.py138
LOWyfinance/base.py172
LOWyfinance/const.py383
LOWyfinance/screener/query.py16
LOWyfinance/screener/screener.py64
LOWyfinance/scrapers/analysis.py141
LOWyfinance/scrapers/quote.py511
LOWyfinance/scrapers/quote.py527
LOWyfinance/scrapers/quote.py543
LOWyfinance/scrapers/quote.py615
LOWyfinance/scrapers/quote.py657
LOWyfinance/scrapers/history.py38
LOWyfinance/scrapers/history.py611
LOWyfinance/scrapers/history.py665
LOWyfinance/scrapers/history.py1109
LOWyfinance/scrapers/history.py1157
LOWyfinance/scrapers/history.py1574
LOWyfinance/scrapers/history.py2659
LOWtests/test_ticker.py152
LOWtests/test_ticker.py310
LOWtests/test_price_repair.py25
LOWtests/test_price_repair.py301
LOWtests/test_price_repair.py386
LOWtests/test_price_repair.py468
Cross-File Repetition6 hits · 30 pts
SeverityFileLineSnippet
HIGHyfinance/screener/query.py0valid operands, grouped by category. {valid_operand_fields_table}
HIGHyfinance/screener/query.py0valid operands, grouped by category. {valid_operand_fields_table}
HIGHyfinance/screener/query.py0valid operands, grouped by category. {valid_operand_fields_table}
HIGHyfinance/screener/query.py0most operands take number values, but some have a restricted set of valid values. {valid_values_table}
HIGHyfinance/screener/query.py0most operands take number values, but some have a restricted set of valid values. {valid_values_table}
HIGHyfinance/screener/query.py0most operands take number values, but some have a restricted set of valid values. {valid_values_table}
Over-Commented Block23 hits · 20 pts
SeverityFileLineSnippet
LOWsetup.cfg1[bdist_wheel]
LOWyfinance/tickers.py1#!/usr/bin/env python
LOWyfinance/multi.py1#!/usr/bin/env python
LOWyfinance/lookup.py1#!/usr/bin/env python
LOWyfinance/__init__.py1#!/usr/bin/env python
LOWyfinance/shared.py1#!/usr/bin/env python
LOWyfinance/utils.py1#!/usr/bin/env python
LOWyfinance/utils.py1061# """
LOWyfinance/search.py1#!/usr/bin/env python
LOWyfinance/ticker.py1#!/usr/bin/env python
LOWyfinance/base.py1#!/usr/bin/env python
LOWyfinance/scrapers/quote.py721 # p = _re.compile(r'root\.App\.main = (.*);')
LOWyfinance/scrapers/quote.py801 if 'exhibits' in f:
LOWyfinance/scrapers/history.py2901 # if not np.isnan(avg_vol_after) and avg_vol_after > 0 and v/avg_vol_after < 2.0:
LOWtests/test_ticker.py201
LOWtests/test_ticker.py361 # """
LOWtests/test_ticker.py901 # dividend date is not available for tested ticker GOOGL
LOWtests/test_ticker.py1121 # key_rename_map["currency"] = "currency"
LOWtests/test_ticker.py1141
LOWtests/test_ticker.py1161 # custom_tolerances["fifty_day_average"] = 1e-2
LOWtests/test_ticker.py1181
LOWtests/context.py41# class CachedLimiterSession(CacheMixin, LimiterMixin, Session):
LOW.github/FUNDING.yml1# # These are supported funding model platforms
Redundant / Tautological Comments11 hits · 16 pts
SeverityFileLineSnippet
LOWyfinance/utils.py315 if 'children' in node: # Check if the node has children
LOWyfinance/utils.py319 for key in data['template']: # Loop through the data
LOWyfinance/utils.py648 # Check if second date dt2 in interval starting at dt1
LOWyfinance/scrapers/history.py1668 # Check if dividend is 100x market movement.
LOWyfinance/scrapers/history.py1850 # Check if the present div-adjustment is too big/small, or missing
LOWyfinance/scrapers/history.py1868 # Check if adjustment too small
LOWyfinance/scrapers/history.py2013 # Check if the present div-adjustment contradicts price action
LOWyfinance/scrapers/history.py2275 # Check if div_too_big AND adj-too-small-for-prices
LOWyfinance/scrapers/history.py2830 # Set threshold to halfway between split ratio and largest expected normal price change
LOWtests/test_search.py25 # Check if the fuzzy search retrieves relevant results despite the typo
LOWdoc/source/reference/examples/auth.py9# Check if the cookies worked
Verbosity Indicators3 hits · 7 pts
SeverityFileLineSnippet
LOWyfinance/scrapers/fundamentals.py115 # Step 2: construct url:
LOWyfinance/scrapers/fundamentals.py123 # Step 3: fetch and reshape data
LOWyfinance/scrapers/fundamentals.py132 # Step 1: get columns and index:
Self-Referential Comments1 hit · 3 pts
SeverityFileLineSnippet
MEDIUMyfinance/base.py668 # Define the URL
AI Slop Vocabulary1 hit · 2 pts
SeverityFileLineSnippet
LOWyfinance/data.py114 # Can't simply use a non-caching session to fetch cookie & crumb,