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

Update search #2237

Open
wants to merge 15 commits into
base: dev
Choose a base branch
from
35 changes: 0 additions & 35 deletions .github/workflows/pytest.yml.disabled

This file was deleted.

39 changes: 2 additions & 37 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,49 +1,14 @@
Change Log
===========

0.2.54
------
Hotfix user-agent #2277

0.2.53
------
Fixes:
- Fix: Failed to parse holders JSON data #2234
- Fix: Bad data in Holders #2244
- Stop CSRF-cookie-fetch fail killing yfinance #2249
- Fix Market Docs #2250
- Fix: Broken "See also" links in documentation #2253
- Fix: Interval check and error message formatting in multi.py #2256
Improve:
- Add pre- / post-stock prices (and other useful information) #2212
- Warn user when use download() without specifying auto_adjust #2230
- Refactor: Earnings Dates – Switch to API Fetching #2247
- Improve prices div repair #2260
Maintenance:
- Add GitHub Actions workflow and fix failing tests #2233

0.2.52
------
Features:
- Improve Screener & docs #2207
- Add Market summary & status #2175
- Support custom period in Ticker.history() #2192
- raise YfRateLimitError if rate limited #2108
- add more options to Search #2191
Fixes:
- remove hardcoded keys in Analysis #2194
- handle Yahoo changed Search response #2202
Maintenance:
- add optional dependencies to requirements.txt #2199

0.2.51
------
Fixes:
- earnings_dates #2169
Features:
- Screener tweaks #2168
- Search #2160
- get_news() expose count #2173
Fixes:
- earnings_dates #2169

0.2.50
------
Expand Down
3 changes: 1 addition & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
autoclass_content = 'both'
autosummary_generate = True
autodoc_default_options = {
'exclude-members': '__init__',
'members': True,
'exclude-members': '__init__'
}

# -- Options for HTML output -------------------------------------------------
Expand Down
14 changes: 5 additions & 9 deletions doc/source/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ The following are the publicly available classes, and functions exposed by the `

- :attr:`Ticker <yfinance.Ticker>`: Class for accessing single ticker data.
- :attr:`Tickers <yfinance.Tickers>`: Class for handling multiple tickers.
- :attr:`Market <yfinance.Market>`: Class for accessing market summary.
- :attr:`download <yfinance.download>`: Function to download market data for multiple tickers.
- :attr:`MarketSummary <yfinance.MarketSummary>`: Class for accessing market summary.
- :attr:`Search <yfinance.Search>`: Class for accessing search results.
- :attr:`Sector <yfinance.Sector>`: Domain class for accessing sector information.
- :attr:`Industry <yfinance.Industry>`: Domain class for accessing industry information.
- :attr:`Market <yfinance.Market>`: Class for accessing market status & summary.
- :attr:`EquityQuery <yfinance.EquityQuery>`: Class to build equity query filters.
- :attr:`FundQuery <yfinance.FundQuery>`: Class to build fund query filters.
- :attr:`screen <yfinance.screen>`: Run equity/fund queries.
- :attr:`download <yfinance.download>`: Function to download market data for multiple tickers.
- :attr:`EquityQuery <yfinance.EquityQuery>`: Class to build equity market query.
- :attr:`Screener <yfinance.Screener>`: Class to screen the market using defined query.
- :attr:`enable_debug_mode <yfinance.enable_debug_mode>`: Function to enable debug mode for logging.
- :attr:`set_tz_cache_location <yfinance.set_tz_cache_location>`: Function to set the timezone cache location.

Expand All @@ -34,13 +32,11 @@ The following are the publicly available classes, and functions exposed by the `

yfinance.ticker_tickers
yfinance.stock
yfinance.market
yfinance.financials
yfinance.analysis
yfinance.market
yfinance.marketsummary
yfinance.search
yfinance.sector_industry
yfinance.screener
yfinance.functions

yfinance.funds_data
Expand Down
19 changes: 19 additions & 0 deletions doc/source/reference/yfinance.functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,25 @@ The `download` function allows you to retrieve market data for multiple tickers

download

Query Market Data
~~~~~~~~~~~~~~~~~~~~~
The `Sector` and `Industry` modules allow you to access the sector and industry information.

.. autosummary::
:toctree: api/

EquityQuery
Screener

.. seealso::
:attr:`EquityQuery.valid_operand_fields <yfinance.EquityQuery.valid_operand_fields>`
supported operand values for query
:attr:`EquityQuery.valid_eq_operand_map <yfinance.EquityQuery.valid_eq_operand_map>`
supported `EQ query operand parameters`
:attr:`Screener.predefined_bodies <yfinance.Screener.predefined_bodies>`
supported predefined screens


Enable Debug Mode
~~~~~~~~~~~~~~~~~
Enables logging of debug information for the `yfinance` package.
Expand Down
33 changes: 4 additions & 29 deletions doc/source/reference/yfinance.market.rst
Original file line number Diff line number Diff line change
@@ -1,41 +1,16 @@
=====================
Market
Market Summary
=====================

.. currentmodule:: yfinance


Class
------------
The `Market` class, allows you to access market data in a Pythonic way.

.. autosummary::
:toctree: api/

Market

Market Sample Code
------------------

--------------------------
The `Market` class, allows you to access market summary data in a Pythonic way.
.. literalinclude:: examples/market.py
:language: python


Markets
------------
There are 8 different markets available in Yahoo Finance.

* US
* GB

\

* ASIA
* EUROPE

\

* RATES
* COMMODITIES
* CURRENCIES
* CRYPTOCURRENCIES
:language: python
27 changes: 0 additions & 27 deletions doc/source/reference/yfinance.screener.rst

This file was deleted.

2 changes: 1 addition & 1 deletion meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set name = "yfinance" %}
{% set version = "0.2.54" %}
{% set version = "0.2.51" %}

package:
name: "{{ name|lower }}"
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ pandas>=1.3.0
numpy>=1.16.5
requests>=2.31
multitasking>=0.0.7
lxml>=4.9.1
platformdirs>=2.0.0
pytz>=2022.5
frozendict>=2.3.4
beautifulsoup4>=4.11.1
html5lib>=1.1
peewee>=3.16.2
requests_cache>=1.0
requests_ratelimiter>=0.3.1
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@
packages=find_packages(exclude=['contrib', 'docs', 'tests', 'examples']),
install_requires=['pandas>=1.3.0', 'numpy>=1.16.5',
'requests>=2.31', 'multitasking>=0.0.7',
'platformdirs>=2.0.0', 'pytz>=2022.5',
'lxml>=4.9.1', 'platformdirs>=2.0.0', 'pytz>=2022.5',
'frozendict>=2.3.4', 'peewee>=3.16.2',
'beautifulsoup4>=4.11.1'],
'beautifulsoup4>=4.11.1', 'html5lib>=1.1'],
extras_require={
'nospam': ['requests_cache>=1.0', 'requests_ratelimiter>=0.3.1'],
'repair': ['scipy>=1.6.3'],
Expand Down
34 changes: 17 additions & 17 deletions tests/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
import sys
import os
import yfinance
from requests_ratelimiter import LimiterSession
from requests import Session
from requests_cache import CacheMixin, SQLiteCache
from requests_ratelimiter import LimiterMixin, MemoryQueueBucket
from pyrate_limiter import Duration, RequestRate, Limiter

_parent_dp = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
Expand All @@ -25,21 +27,19 @@
import shutil
shutil.rmtree(testing_cache_dirpath)

# Setup a session to only rate-limit
history_rate = RequestRate(1, Duration.SECOND)

# Setup a session to rate-limit and cache persistently:
class CachedLimiterSession(CacheMixin, LimiterMixin, Session):
pass
history_rate = RequestRate(1, Duration.SECOND*2)
limiter = Limiter(history_rate)
session_gbl = LimiterSession(limiter=limiter)
cache_fp = os.path.join(testing_cache_dirpath, "unittests-cache")
session_gbl = CachedLimiterSession(
limiter=limiter,
bucket_class=MemoryQueueBucket,
backend=SQLiteCache(cache_fp, expire_after=_dt.timedelta(hours=1)),
)
# Use this instead if only want rate-limiting:
# from requests_ratelimiter import LimiterSession
# session_gbl = LimiterSession(limiter=limiter)

# Use this instead if you also want caching:
# from requests_cache import CacheMixin, SQLiteCache
# from requests_ratelimiter import LimiterMixin
# from requests import Session
# from pyrate_limiter import MemoryQueueBucket
# class CachedLimiterSession(CacheMixin, LimiterMixin, Session):
# pass
# cache_fp = os.path.join(testing_cache_dirpath, "unittests-cache")
# session_gbl = CachedLimiterSession(
# limiter=limiter,
# bucket_class=MemoryQueueBucket,
# backend=SQLiteCache(cache_fp, expire_after=_dt.timedelta(hours=1)),
# )
Loading
Loading