Compare commits

...

587 Commits

Author SHA1 Message Date
github-actions[bot]
b656a8ab39 Update documentation 2024-11-06 09:28:16 +00:00
ValueRaider
1e15302414 Merge pull request #2115 from ericpien/docs
Adding Sphinx Documentation
2024-11-06 09:27:21 +00:00
Eric Pien
3e647a8e29 Merge branch 'docs_markdown' into docs 2024-11-05 20:02:32 -08:00
Eric Pien
d20923551d Add Sphinx Documentation
- Initial draft of Sphinx documentation using rst
    - update docstrings
    - add deploy_doc.yml for automated deployment through GitHub Actions
2024-11-05 19:56:34 -08:00
ValueRaider
664a4b4b59 Manually restore docs/ & mkdocs.yml changes lost during rebase 2024-11-03 11:34:47 +00:00
Ran Aroussi
43f311d695 Delete CNAME 2024-11-03 11:29:14 +00:00
Ran Aroussi
2c43de5f92 Create CNAME 2024-11-03 11:29:14 +00:00
silvavn
d324fde012 Documented util.py 2024-11-03 11:29:13 +00:00
silvavn
ad2f17fffa added advanced usage 2024-11-03 11:22:16 +00:00
silvavn
977d3144c5 fixing documentation 2024-11-03 11:21:54 +00:00
ValueRaider
0bc22f82bb Merge pull request #2108 from ranaroussi/main
sync main -> dev
2024-11-02 12:38:00 +00:00
Ran Aroussi
5e942fdec4 Refactor multi.py to handle single tickers and rename columns 2024-10-25 19:02:07 +01:00
Ran Aroussi
16072e87df Bump version to 0.2.48 2024-10-25 18:59:19 +01:00
Ran Aroussi
6946f99e30 Refactor multi.py to handle single tickers and rename columns 2024-10-25 18:59:03 +01:00
Ran Aroussi
1397dcc4bc Update version.py 2024-10-25 11:34:13 +01:00
Ran Aroussi
7fee3039f4 Delete .DS_Store 2024-10-25 11:33:08 +01:00
Ran Aroussi
4beb489f82 Refactor multi.py to handle single tickers and rename columns 2024-10-25 11:31:20 +01:00
ValueRaider
0f570c4684 Merge pull request #2097 from eltociear/patch-1
docs: update README.md
2024-10-22 18:55:03 +01:00
Ikko Eltociear Ashimine
b32e57fcfe docs: update README.md
minor fix
2024-10-22 17:19:56 +09:00
ValueRaider
0ec5151ff3 Version 0.2.46 2024-10-21 18:37:53 +01:00
ValueRaider
b88a0a6bf5 Merge pull request #2094 from FX196/patch-1
Fix malformed f-string in release `0.2.45`
2024-10-21 18:36:49 +01:00
Yuhong Chen
c218848a69 Fix malformed f-string 2024-10-20 17:36:22 -07:00
ValueRaider
f19dff247e Version 0.2.45 2024-10-20 22:59:16 +01:00
ValueRaider
1de113eccd Merge pull request #2091 from ranaroussi/dev
sync dev -> main
2024-10-20 22:56:26 +01:00
ValueRaider
8daa477167 Merge pull request #2090 from ranaroussi/feature/divident-repair-improve
Feature/dividend repair improve
2024-10-20 22:55:52 +01:00
ValueRaider
3152715d45 Improve divident repair
Dividend repair tweaks:
- handle coincident split missing from dividend
- avoid 100x price changes confusing detection of div too-big/small
- improve detecting div-date-wrong
2024-10-20 21:50:08 +01:00
ValueRaider
ee657b24d5 Merge pull request #2087 from ranaroussi/fix/debug-msg
Fix IndexError in some history() debug messages
2024-10-20 16:31:33 +01:00
ValueRaider
4672715a86 Merge pull request #2066 from ericpien/screener
Implement Screener Feature
2024-10-19 22:13:46 +01:00
Eric Pien
4a70b59db9 Simplify README for Screener
- Reduce the information provided in README with the expectation of migrating to separate documentation.
2024-10-19 09:27:32 -07:00
Ran Aroussi
12e815d977 Update README.md 2024-10-17 21:51:59 +01:00
ValueRaider
e282d1b59c Fix IndexError in some history() debug messages 2024-10-12 11:48:11 +01:00
ValueRaider
7e0946ed37 Merge pull request #2080 from ranaroussi/main
sync main -> dev
2024-10-07 21:30:03 +01:00
ValueRaider
a21fc073b8 Merge pull request #2059 from marco-carvalho/patch-1
Add Pyright type checking
2024-10-07 19:50:24 +01:00
ValueRaider
a9e3cf0780 Merge pull request #2072 from algonell/main
Fix typos
2024-10-05 20:08:10 +01:00
ValueRaider
0f63ecc2bd Merge pull request #2068 from antoniouaa/fix_tickers_single
fix keyerror with single element list passed to Tickers
2024-10-03 20:09:52 +01:00
Andrew Kreimer
10800a1070 Fix typos 2024-10-03 22:01:53 +03:00
Andrew Kreimer
db39b3fca4 Fix a typo 2024-10-03 22:00:57 +03:00
Andrew Kreimer
10d6221718 Fix typos 2024-10-03 22:00:29 +03:00
ValueRaider
17f07e08ef Merge pull request #2069 from ranaroussi/main
sync main -> dev
2024-10-02 20:12:48 +01:00
ValueRaider
f82823c624 Merge pull request #2067 from ranaroussi/fix/tests-context
Fix unit tests contextual imports
2024-10-02 20:11:30 +01:00
antoniouaa
ebc4e200c1 fix keyerror with single element list passed to Tickers 2024-10-01 23:15:54 +01:00
ValueRaider
a8df88b2d2 Fix unit tests contextual imports 2024-10-01 21:24:51 +01:00
Eric Pien
048378ea20 Implement Screener
- Add a new class Screener, Query, and EquityQuery
- Refactor YfData.get() to enable YfData.post() to all of get's implementations
- Add test for the Screener
- Add new set and map to const

Screener can be used to filter yahoo finance. This can be used to get the top gainers of the day, and more customized queries that a user may want to automate.
2024-09-30 18:01:11 -07:00
ValueRaider
9e2252e451 Version 0.2.44 2024-09-30 19:57:57 +01:00
ValueRaider
4c3c228724 Merge pull request #2063 from ranaroussi/dev
sync dev -> main
2024-09-30 19:55:01 +01:00
ValueRaider
3535fb9ed7 Fix test fails in _fix_prices_sudden_change 2024-09-29 23:03:44 +01:00
ValueRaider
dd663a404a Merge pull request #2062 from ranaroussi/feature/improve-div-repair
Improve dividend repair
2024-09-29 20:32:54 +01:00
ValueRaider
ce530b0855 Improve dividend repair
Improve dividend repair:
- detect wrong date
- detect split missing from coincident dividend
- improve detecting adjust contradicting price action
- improve detecting when Close has adjustment
  (remove phantoms before, then use AdjClose -> AdjLow deltas)

Stop negative 'Adj Close' triggering a 'sudden change' repair.
2024-09-29 16:44:23 +01:00
ValueRaider
1890ff2b6d Merge pull request #2058 from ericpien/sectors
Feature Proposal: Support Sector and Industry data from Markets Tab
2024-09-22 17:53:39 +01:00
Eric Pien
3a0b6c2315 Implement Sector and Industry
Sector and Industry class to query the data available on: https://finance.yahoo.com/sectors/:
- sector / industry overview
- sector / industry top companies
- sector / industry research reports
- sector top ETFs
- sector top Mutual Funds
- industries within sector
- industry's sector
- industry's top performing companies
- industry's top growth companies
2024-09-22 08:35:12 -07:00
ValueRaider
676500854c Bug template: clarify 'bad data proof' 2024-09-21 11:56:54 +01:00
Marco Carvalho
f1d5c1d06f Update pyright.yml 2024-09-19 16:08:40 -03:00
Marco Carvalho
d65bf2d761 Update requirements.txt 2024-09-19 15:57:55 -03:00
Marco Carvalho
81deec0d6c Update pyrightconfig.json 2024-09-19 11:32:57 -03:00
Marco Carvalho
74f44a4e1e Update pyright.yml 2024-09-19 11:14:09 -03:00
Marco Carvalho
691904202b Create pyright.yml 2024-09-19 11:09:13 -03:00
Marco Carvalho
3fc54ab249 Create pyrightconfig.json 2024-09-19 11:08:56 -03:00
Marco Carvalho
d7c6f5f320 Update requirements.txt 2024-09-19 11:08:08 -03:00
ValueRaider
6b7a511765 Merge pull request #2041 from ericpien/funds
implement support for funds data
2024-09-08 12:53:20 +01:00
Eric Pien
f584b0c7d0 implementing support for funds data
- adding to scraper a new class FundsData.
- Ticker can now reference the data via ticker.funds_data when appropriate.
- Add unit tests in test_ticker.py for the funds data
2024-09-07 13:49:54 -07:00
ValueRaider
8cadad2cbb Merge pull request #2048 from ranaroussi/main
sync main -> dev
2024-09-04 21:44:28 +01:00
ValueRaider
3fe87cb132 Merge pull request #2039 from joncokisler/main
Fix typo in README.md #2038
2024-08-26 19:27:55 +01:00
Jon Cokisler
72684b1784 fix typo in README 2024-08-26 13:51:45 -04:00
ValueRaider
ed43f6fc09 Version 0.2.43 2024-08-24 21:37:58 +01:00
ValueRaider
f87a9affb3 Merge pull request #2036 from ranaroussi/fix/price-repair-currency-bug
Fix price-repair-currency, logic was inverted
2024-08-24 21:36:36 +01:00
ValueRaider
e329f267b2 Fix price-repair-currency, logic was inverted 2024-08-24 19:04:15 +01:00
ValueRaider
bd1a597a0c Version 0.2.42 2024-08-22 16:59:11 +01:00
ValueRaider
0193cec8bf Merge pull request #2034 from ranaroussi/dev
sync dev -> main
2024-08-22 16:53:14 +01:00
ValueRaider
a2b5d6bea9 Fix 2x old tests 2024-08-22 16:29:07 +01:00
ValueRaider
ce9becddbb Merge branch 'main' into dev 2024-08-22 16:12:15 +01:00
ValueRaider
7e12f2029f Merge pull request #2031 from ranaroussi/feature/price-repair-div-adjust
New: repair bad dividends and div-adjusts. Plus other repair fixes.
2024-08-22 16:03:13 +01:00
ValueRaider
a74ad474d9 Repair dividends: fine-tune logic + unit tests
Fix detecting div_adj_exceeds_prices.
Fine-tune fixing div_too_big.
Unit tests.
2024-08-22 15:47:10 +01:00
ValueRaider
2f5203d677 New: repair bad dividends and div-adjusts. Plus other repair fixes.
The new dividend repair logic looks for too big/small dividends/adjusts.
Because it analyses prices, it needs prices to be consistent - this means
for some exchanges, prices are converted to major currency e.g. pence -> £.
These exchanges are: .L, .TA, .JO
Also, multiday intervals are created by resampling adjusted 1d intervals.

Related change:
- _fix_prices_sudden_change() now fixes dividends with prices

Other repair fixes:
- add basic repair function to fix_Yahoo_returning_live_separate() to handle simple 100x price errors within same week/month
- fix _fix_prices_sudden_change() false positive on real massive price drop (clue = massive volume spike)
- price reconstruct fixes:
  - calibration: stop NaNs breaking, and detect currency unit mixup
  - fix a Pandas warning
2024-08-22 11:08:31 +01:00
ValueRaider
7c66bc374c Merge pull request #2032 from ranaroussi/revert/PR-2027-30m-resampling
Revert PR #2027, breaks with prepost=True
2024-08-22 11:08:07 +01:00
ValueRaider
a0dc25229b Update python-publish.yml to v4 for node20 2024-08-21 22:35:27 +01:00
ValueRaider
1baecc9d5b Revert PR #2027, breaks with prepost=True 2024-08-21 21:11:52 +01:00
ValueRaider
8b8db167f5 Update bug_report.yaml 2024-08-19 10:10:57 +01:00
ValueRaider
4941c619f4 Merge pull request #2023 from Fidasek009/feature/analysis
Implement Analysis (no scraping)
2024-08-16 19:25:48 +01:00
Filip Krása
9cf62894e8 Fix ruff complaining 2024-08-16 20:14:02 +02:00
Filip Krása
0c447d56d1 Update README.md with analysis attributes 2024-08-16 18:37:31 +02:00
Filip Krása
bc719627d1 Implement tests for Analysis 2024-08-16 17:40:40 +02:00
Filip Krása
408d0659e5 Implement Analysis 2024-08-16 17:37:55 +02:00
ValueRaider
67d6859384 Merge pull request #2027 from aleksfasting/fix/NSEI-quarter-offset
Solves #2026
2024-08-16 14:27:14 +01:00
Aleks Fasting
1037ec5b05 solves #2026
Solution that checks the offset of the opening time of the stock exchange (mod 30 minutes) and adds it to the quotes
2024-08-15 17:11:57 +02:00
ValueRaider
459d5f69c2 Merge pull request #2016 from mreiche/bugfix/mixed-tz-conversion
Fix datetime conversion with mixed timezones when ignore_tz is False
2024-08-12 20:29:54 +01:00
Mike Reiche
f13ff4bb4c Fix datetime conversion with mixed timezones when ignore_tz is False 2024-08-12 07:39:55 +02:00
ValueRaider
2b8716c72f Merge pull request #2021 from ericpien/address_issue_2015
Handle faulty response object when getting news.
2024-08-10 12:38:09 +01:00
Eric Pien
447ec68eff add try except for when requests.response.json() fails
- return empty set rather than raising an exception
2024-08-10 03:50:27 -07:00
ValueRaider
602fe2abe6 Merge pull request #2000 from ranaroussi/feature/prices-adjust-errors-and-logging
Prices: improve exceptions and logging
2024-08-10 11:42:43 +01:00
ValueRaider
ffe364268c Prices: improve exceptions & logging
Tidy messages sent to logging.INFO
Use logging's 'extra' argument to make YF log formatting programmatic.
Reclassify some YF price-repair log messages, so that repairs (or repair fails) are level INFO.
2024-08-10 11:40:36 +01:00
ValueRaider
cd18947284 Merge pull request #2020 from ericpien/dev
Fix minor typo
2024-08-10 11:26:03 +01:00
Eric Pien
76062dda22 fixing minor typo
%% -> %
2024-08-10 00:29:07 -07:00
ValueRaider
07329dbfd7 Merge pull request #2013 from ericpien/dev
use dict.get() to safely access key in Holders
2024-08-07 21:02:25 +01:00
ValueRaider
89e61bb118 Merge pull request #2009 from ranaroussi/feature/sec-filings
Implement fetch sec-filings
2024-08-06 22:36:34 +01:00
ThetisLake
d490fa3163 use dict.get() to safely access key
using .get() is safer than [key] and allows effective way to return non-None variable
2024-08-05 17:37:31 -07:00
ValueRaider
614906cc50 Implement fetch sec-filings 2024-08-03 15:16:45 +01:00
ValueRaider
fa3779896b Merge pull request #1995 from stevenbischoff/dev
Fix error on empty options chain
2024-07-24 22:21:52 +01:00
ValueRaider
59178f4402 Merge pull request #1998 from aaron-jencks/patch-1
Remove erroneous print statement
2024-07-22 18:47:14 +01:00
Aaron Jencks
ce6bf9378c Remove erroneous print statement 2024-07-22 11:29:31 -05:00
Steven Bischoff
d70c99ccfa Fix error on empty options chain
Signed-off-by: Steven Bischoff <61480100+stevenbischoff@users.noreply.github.com>
2024-07-19 15:12:43 -05:00
ValueRaider
2594eef3a3 Merge pull request #1994 from ranaroussi/main
main -> dev
2024-07-19 16:07:02 +01:00
ValueRaider
30abd89474 README: add new 'sustainability' attribute 2024-07-19 16:00:52 +01:00
ValueRaider
26697c25de Version 0.2.41 2024-07-19 15:57:45 +01:00
ValueRaider
3e9a77a7f7 Merge pull request #1971 from ranaroussi/dev
dev -> main
2024-07-19 15:50:08 +01:00
ValueRaider
7ca6b10a63 Fix typo in merged branch feature/price-repair-zeroes-improve 2024-07-19 10:39:28 +01:00
ValueRaider
d024dbb012 Merge pull request #1989 from ranaroussi/fix/price-repair-syntax-error-fixes
Fix: price repair syntax errors
2024-07-18 21:33:00 +01:00
ValueRaider
862ef7c78d Merge pull request #1990 from ranaroussi/feature/price-repair-zeroes-improve
Price repair zeroes: improve for 1d+ data
2024-07-18 21:32:24 +01:00
ValueRaider
d948db7344 Price repair zeroes: improve for 1d+ data
If 1d/1wk close changes without volume, tag as bad for repair.
2024-07-18 21:26:01 +01:00
ValueRaider
c894b9e595 Price repair: fix 2x syntax errors 2024-07-18 21:07:55 +01:00
ValueRaider
0681a777b8 Tests small fixes + fix another Pandas warning 2024-07-15 21:33:03 +01:00
ValueRaider
96279b932b Merge pull request #1981 from ranaroussi/fix/pandas-warnings
Prices: fix some Pandas deprecation warnings
2024-07-15 20:55:15 +01:00
ValueRaider
b0e9e917fe Merge pull request #1985 from rhwvu/main
Rebased: Adding various financials to const.py
2024-07-15 20:51:13 +01:00
R. W
d219e841b3 const.py addition 2024-07-15 15:02:43 -04:00
ValueRaider
a73e974d19 Merge pull request #1977 from ranaroussi/fix/earnings
Deprecate Ticker.earnings
2024-07-13 18:46:21 +01:00
ValueRaider
2e48495a9b Fix deprecation warnings not printing. Remove deprecated info code. 2024-07-13 18:45:35 +01:00
ValueRaider
742cc85a0c Prices: fix some Pandas deprecation warnings 2024-07-13 18:30:38 +01:00
ValueRaider
9c89308780 Merge pull request #1967 from SnowCheetos/preiod_max_fix
fixed history fetching when period='max'
2024-07-06 19:55:02 +01:00
ValueRaider
4160fec989 Clarify max period when interval=60m/1h. Tidy. 2024-07-06 19:51:14 +01:00
ValueRaider
57dac67b0e Deprecate 'Ticker.earnings' 2024-07-05 17:40:15 +01:00
SnowCheetos
b1d56ac235 directly subtracted seconds, kept 99 years impl as on main branch 2024-07-03 11:17:03 -05:00
ValueRaider
6be7cc311b Merge pull request #1970 from ranaroussi/fix/history-metadata
history metadata: Fix '1wk is invalid' & repeated calls
2024-06-28 14:01:24 +01:00
ValueRaider
a9f6c3346b history metadata: Fix '1wk is invalid' & repeated calls 2024-06-28 14:00:12 +01:00
zhihaos2
a42a5b75d6 fixed history fetching when period='max' 2024-06-25 13:37:13 -05:00
ValueRaider
2d5978e4d8 Merge pull request #1965 from vittoboa/add-loss-adjustment-expense
Add pull of "Loss Adjustment Expense" as part of Income Statement
2024-06-21 21:58:37 +01:00
vittoboa
17b4518e6a Add pull of Loss Adjustment Expense data in income statement 2024-06-20 23:53:45 +02:00
ValueRaider
2b1dd86c2b Merge pull request #1959 from MohamedAlaa201/mohamed/sustainibillity_implementation
Sustainability Fetching Implementation
2024-06-13 21:13:06 +01:00
Darksinian
ead2b894e4 Implement Sustainibility Fetching 2024-06-13 13:36:29 -04:00
ValueRaider
b27b88caff Merge pull request #1955 from lp177/patch-1 2024-06-04 13:51:06 +01:00
lp177
5d6981346e Fix 'T' is deprecated
site-packages/yfinance/scrapers/history.py:239: FutureWarning: 'T' is deprecated and will be removed in a future version, please use 'min' instead.
2024-06-01 07:57:41 +02:00
ValueRaider
19f9760599 Merge pull request #1946 from ranaroussi/main
sync main -> dev
2024-05-20 19:16:25 +01:00
ValueRaider
930b305327 Version 0.2.40 2024-05-19 17:25:01 +01:00
ValueRaider
7af213dea2 Fix unmatched quotes (0.2.39 regression) 2024-05-19 17:21:59 +01:00
ValueRaider
049337327e Version 0.2.39 2024-05-19 15:14:45 +01:00
ValueRaider
e65ca40d95 Merge pull request #1927 from ranaroussi/dev
sync dev -> main
2024-05-19 15:10:34 +01:00
ValueRaider
fe00fd5152 Ruff fixes 2024-05-19 15:09:57 +01:00
ValueRaider
cb691df586 Merge pull request #1941 from ranaroussi/main
sync main -> dev
2024-05-19 15:07:18 +01:00
ValueRaider
4bc546cb71 Update ci.yml to Node20 2024-05-19 15:05:35 +01:00
ValueRaider
f3c9f9962d Fix tests ; Fine-tune split repair ; Fix UTC warning 2024-05-19 15:01:52 +01:00
ValueRaider
da1c466550 Merge pull request #1931 from ranaroussi/feature/improve-price-repair-bad-splits
Price repair: improve 'sudden change' repair for splits & currency
2024-05-19 11:40:18 +01:00
ValueRaider
97f35b721c Price repair: improve 'sudden change' repair for splits & currency
Original logic for repairing missing split adjustment only checked latest split.
Improved logic checks ALL splits in data, because any can be missing.

Then related changes to 'sudden change detection':
- use prices median not mean, reduce sensitivity to noise.
- handle Kuwait Dinar, which sub-divides into 1000x not 100x.
2024-05-19 11:39:03 +01:00
ValueRaider
7c41434f44 Merge pull request #1930 from ranaroussi/fix/session-switching
Fix switching session from/to requests_cache
2024-05-11 21:40:41 +01:00
ValueRaider
070f13577e Merge pull request #1928 from marcofognog/dev
Add more specific error thowring base on PR 1918
2024-05-11 21:37:35 +01:00
Marcao
7628bec2a6 Adjust and fix according to feedback 2024-05-11 19:20:19 +02:00
ValueRaider
ac4efa3e3d Fix switching session from/to requests_cache
Session switch logic was not recalculating 'self._session_is_caching'.
Also removed message 'help stress-test cookie & crumb & requests_cache', clearly works now.
2024-05-11 09:33:17 +01:00
Elijah Lopez
5a683b916d Add raise missing ticker tests, replace deprecated datetime methods
- renamed test files conform with standards
- replaced utcfromtimestamp
2024-05-10 17:23:14 +02:00
Elijah Lopez
30fdc96157 Fix: PricesMissingError not being raised 2024-05-10 17:15:08 +02:00
Elijah Lopez
ee87a95b8d Rename errors from YFinance to YF 2024-05-10 17:15:08 +02:00
Elijah Lopez
685ef71d9f Add error classes for symbol delisting errors, closes #270 2024-05-10 17:15:08 +02:00
ValueRaider
098e77659c Merge pull request #1922 from ranaroussi/fix/datetime-utc-warning 2024-05-09 10:05:43 +01:00
ValueRaider
dc5c718556 Fix: datetime.datetime.utcnow() is deprecated ...
Python 3.12 deprecates datetime.datetime.utcnow().
Instead of switching to datetime.datetime.now(datetime.UTC), which won't work in Python 3.11,
just switch to Pandas.utcnow().
2024-05-02 22:45:26 +01:00
ValueRaider
84ba6d7d88 Merge pull request #1920 from ranaroussi/feature/price-repair-fx
Don't price-repair FX volume=0, is normal
2024-04-28 12:51:59 +01:00
ValueRaider
e238ac1f95 Merge pull request #1919 from ranaroussi/feature/readme-table-of-contents
Add table-of-contents to README
2024-04-28 12:51:15 +01:00
ValueRaider
efe15e1907 Add table-of-contents to README 2024-04-27 12:50:15 +01:00
ValueRaider
2dcbe34910 Don't price-repair FX volume=0, is normal 2024-04-26 21:32:39 +01:00
ValueRaider
bb47cd4182 Merge pull request #1917 from ranaroussi/main
sync main -> dev
2024-04-24 21:06:43 +01:00
ValueRaider
94e3833e90 Merge pull request #1913 from vittoboa/add_functools_wraps_to_wrapper
Fix help(yf.download) not showing the information about the function
2024-04-22 21:12:22 +01:00
vittoboa
f8e8eecf44 Add functools.wraps to log_indent_decorator's wrapper function 2024-04-22 21:08:10 +02:00
ValueRaider
a1bcb4c351 Version 0.2.38 2024-04-16 22:18:37 +01:00
ValueRaider
18089f451b Merge pull request #1908 from vittoboa/holders_404_error
Fix 404 Error for Holders
2024-04-16 22:14:33 +01:00
vittoboa
3d180fcf2c Move ticker symbol from parameter to URL 2024-04-16 22:37:07 +02:00
ValueRaider
82a3145fdf Merge pull request #1897 from ranaroussi/feature/deprecate-pdr
Deprecate 'pandas_datareader', remove a deprecated argument
2024-04-06 12:42:52 +01:00
ValueRaider
48e9075a2d Deprecate 'pandas_datareader', remove a deprecated argument.
Drop official support for 'pandas_datareader', tag pdr_override() as deprecated.
Also removed deprecated argument 'download(show_errors)'.
2024-04-06 12:42:04 +01:00
ValueRaider
88e8ddb7f5 Merge pull request #1896 from ranaroussi/feature/replace-dead-appdirs
Replace dead 'appdirs' package with 'platformdirs'
2024-04-06 12:22:37 +01:00
ValueRaider
812931ff98 Replace dead 'appdirs' package with 'platformdirs' 2024-04-06 12:19:46 +01:00
ValueRaider
1967e974c1 Merge pull request #1874 from ranaroussi/fix/price-repair-subtle-bug
Fix potential for price repair to discard price=0 rows
2024-03-04 19:46:59 +00:00
Value Raider
942a26fd37 Fix potential for price repair to discard price=0 rows 2024-03-01 22:03:03 +00:00
Value Raider
c2d568367c Version 0.2.37 2024-02-25 13:25:28 +00:00
ValueRaider
d3728d3071 Merge pull request #1869 from ranaroussi/dev
Dev
2024-02-24 23:09:34 +00:00
ValueRaider
915bb1a080 Merge pull request #1866 from ranaroussi/fix/price-repair-confusing-order
Price repair bug-fix
2024-02-24 22:58:20 +00:00
Value Raider
d55c317158 Fix bug: prices order flipping during repair, introducing potential data corruption 2024-02-19 22:17:20 +00:00
ValueRaider
ac1d09049e Merge pull request #1865 from cottrell/fix
Fix some errors.
2024-02-19 22:11:48 +00:00
David Cottrell
afb4e0d5dc Fix some errors. 2024-02-19 21:43:12 +00:00
ValueRaider
1d31e7ca01 Update issue form - more emphasis on following instructions 2024-02-11 13:47:36 +00:00
ValueRaider
683064f9ad Merge pull request #1849 from ranaroussi/refactor/price-history 2024-02-07 23:11:51 +00:00
Value Raider
cdf897f9e6 Move price history+repair logic into new file 2024-02-04 13:09:37 +00:00
ValueRaider
eab6c8dfa7 Update bug_report.yaml because people can't read 2024-02-01 21:28:38 +00:00
ValueRaider
97f93d35ed Merge pull request #1844 from power-edge/dev
adding upgrade for pandas deprecation warning, adding pyarrow>=0.17.0…
2024-01-31 21:51:05 +00:00
Nikolaus Schuetz
5aef8addab removing dev requirements (they are included by extras) 2024-01-29 17:43:12 -05:00
ValueRaider
6b8a4a5608 Merge pull request #1841 from Rogach/pr/dont-disable-global-logging
do not disable app-wide logging in quote.py (fixes #1829)
2024-01-28 16:29:43 +00:00
Platon Pronko
212a7987c3 do not disable app-wide logging in quote.py (fixes #1829) 2024-01-28 20:43:50 +05:00
Nikolaus Schuetz
58a0a57457 adding upgrade for pandas deprecation warning, adding pyarrow>=0.17.0 at minimum requirement as defined in dev requirements for pandas==1.3.0 version 2024-01-26 20:12:58 -05:00
ValueRaider
75297c0eba Merge pull request #1838 from mreiche/bugfix/remove-empty-series
Remove _empty_series leftovers
2024-01-23 19:07:16 +00:00
Mike Reiche
1dc2719368 Remove _empty_series leftovers 2024-01-23 15:32:56 +01:00
Value Raider
ab979e9141 Version 0.2.36 2024-01-21 18:10:41 +00:00
ValueRaider
b837c1ec2a Merge pull request #1834 from ranaroussi/dev
sync dev -> main
2024-01-21 18:08:04 +00:00
ValueRaider
2630c66cd1 Merge pull request #1833 from ange-daumal/json-fix
Fix JSON error handling
2024-01-19 21:56:42 +00:00
ValueRaider
7af789fe9a Merge pull request #1830 from ange-daumal/patch-1
Fix JSON error handling
2024-01-19 21:51:52 +00:00
ValueRaider
73e36688b7 Merge pull request #1827 from ranaroussi/fix/peewee-with-old-sqlite
Handle peewee with old sqlite
2024-01-19 21:51:31 +00:00
ValueRaider
f1264716fc Merge pull request #1824 from ranaroussi/fix/price-keepna-with-repair
Fix history() keepna=False with repair=True
2024-01-19 21:51:10 +00:00
Ange Daumal
06fd35121a Fix JSON access to prevent KeyError 2024-01-19 22:51:02 +01:00
Mike Reiche
91f468e4d3 Fix JSON access to prevent KeyError 2024-01-19 22:42:42 +01:00
ValueRaider
d00c1a976c Merge pull request #1831 from ranaroussi/main
sync main -> dev
2024-01-15 19:28:56 +00:00
ValueRaider
176c3d628b Update ci.yml to Node16 2024-01-15 19:27:37 +00:00
ValueRaider
8f53af1593 Merge pull request #1823 from molpcs/patch-2
Update README.md for better copy-ability
2024-01-14 12:36:17 +00:00
ValueRaider
19188d52d4 Merge pull request #1795 from amanlai/main
explicitly name the column levels
2024-01-14 10:45:04 +00:00
Value Raider
ffaf200562 Handle peewee with old sqlite 2024-01-13 23:00:59 +00:00
Value Raider
6686258e66 Fix history() keepna=False with repair=True 2024-01-13 13:19:44 +00:00
molpcs
47bc46c804 Update README.md
Wrap yfinance[optional] code snippet with quotes to avoid conflict with zsh globbing. Remains compatible with bash.
2024-01-12 11:57:58 -08:00
ValueRaider
f563e51509 Merge pull request #1822 from akshayparopkari/patch-1 2024-01-11 09:30:22 +00:00
Akshay Paropkari
c5404bcd9d Update fundamentals.py
Error in supplying timescale values resulted in misleading ValueError - 

```
ValueError: Illegal argument: timescale must be one of: ['income', 'balance-sheet', 'cash-flow']
```
2024-01-11 05:17:39 +00:00
ValueRaider
006e0a155b Merge pull request #1724 from mreiche/bugfix/data-types-2
Bugfix/data types 2
2024-01-09 20:13:41 +00:00
Mike Reiche
dbc55e5596 Remove unused List import 2024-01-09 21:08:46 +01:00
Mike Reiche
4ce63fe8ca Merge remote-tracking branch 'yfinance/dev' into bugfix/data-types-2 2024-01-09 08:51:33 +01:00
Mike Reiche
223f5337a8 Remove empty static series 2024-01-09 08:50:31 +01:00
Mike Reiche
4c34487149 Revert disabling earnings test 2024-01-09 08:50:00 +01:00
Mike Reiche
ac8a917288 Revert adding explicit requirements 2024-01-09 08:43:54 +01:00
Mike Reiche
15321bd097 Merge remote-tracking branch 'yfinance/main' into bugfix/data-types-2 2024-01-09 08:42:43 +01:00
ValueRaider
10961905b6 Merge pull request #1817 from ranaroussi/main
sync main -> dev
2024-01-07 18:39:10 +00:00
ValueRaider
acbd2a8d78 Merge pull request #1816 from ranaroussi/fix/ticker-api
0.2.34 fixes: Add new data to README, remove deprecated stuff, fix tests
2024-01-07 00:35:06 +00:00
Value Raider
61c4696c65 Add new data to README, remove deprecated stuff, fix tests, v0.2.35
Ticker.recommendations*:
- add to README
- organise their unit tests
- remove redundant recommendations_history

Remove deprecated arguments from Ticker.history

Fix 'bad symbol' behaviour & tests
Fix some prices tests

Bump version 0.2.35
2024-01-07 00:33:59 +00:00
Value Raider
a7c41afa52 Version 0.2.34 2024-01-06 17:19:51 +00:00
ValueRaider
49d8dfd544 Merge pull request #1815 from ranaroussi/dev
sync dev -> main
2024-01-06 16:18:20 +00:00
ValueRaider
477dc6e6c4 Merge pull request #1798 from ranaroussi/fix/price-repair-div-adjust
Fix price repair div adjust
2023-12-31 21:43:44 +00:00
ValueRaider
7e6ad0834c Merge pull request #1806 from puntonim/ticker-history-exc-hook
Ticker.history() to raise HTTP request excs if raise_errors args is True
2023-12-31 14:09:12 +00:00
puntonim
c94cbb64d4 Ticker.history() to raise HTTP request excs if raise_errors args is True 2023-12-31 14:57:47 +01:00
ValueRaider
c053e2cb30 Merge pull request #1807 from ranaroussi/feature/optional-reqs-min-versions
Set sensible min versions for optional 'nospam' reqs
2023-12-31 13:47:17 +00:00
Value Raider
112b297c41 Set sensible min versions for optional 'nospam' reqs
Set sensible min versions for optional 'nospam' reqs:
- requests_cache >= 1.0 , first defined DO_NOT_CACHE
2023-12-31 13:45:26 +00:00
ValueRaider
5195c3a798 Merge pull request #1810 from Tejasweee/dev
make nan as float
2023-12-31 12:56:26 +00:00
Tejasweee
c1ad2589da make nan as float 2023-12-31 09:29:19 +05:45
ValueRaider
d1a34a4da0 Merge pull request #1796 from ranaroussi/fix/cookie-cache-date
Fix invalid date entering cache DB
2023-12-30 17:32:14 +00:00
Value Raider
d44eff4065 Fix 'Unalignable' error in reconstruct_intervals 2023-12-22 20:29:04 +00:00
Value Raider
db670aefd7 Fix invalid date entering cache DB
'peewee.DateTimeField' is not ISO-compliant. If user enforces strict ISO-compliance,
then translation between DateTimeField and sqlite breaks. Fix is to manually
implement translation.
2023-12-22 12:59:50 +00:00
Manlai Amar
a3095d2a40 explicitly name the column levels 2023-12-21 00:02:53 -08:00
ValueRaider
f753e6090d Merge pull request #1793 from ranaroussi/fix/fetch-tkr-tz
Fix _get_ticker_tz() args, were being swapped. Improve its unit test
2023-12-17 18:59:06 +00:00
Value Raider
9021fe52b4 Fix _get_ticker_tz() args, were being swapped. Improve its unit test 2023-12-17 18:35:29 +00:00
ValueRaider
281cc64a4a Merge pull request #1790 from bot-unit/feature/calendar
feature calendar events
2023-12-16 13:37:19 +00:00
ValueRaider
8975689bd1 README: add cache folder location 2023-12-16 13:36:40 +00:00
Unit
24f53e935d added calendar events
added events from calendarEvents module
returning data is dict
test upgraded and passed
2023-12-16 13:35:04 +01:00
ValueRaider
a6790606ef Merge pull request #1774 from coskos-ops/fix/complementaryinfo
Fixed incorrect code for ticker complementary info retrieval
2023-12-14 17:57:26 +00:00
Filip Kostic
122269cf53 Fixed fstring error 2023-12-13 19:45:47 -05:00
ValueRaider
a914647fa4 Merge pull request #1772 from JuliaLWang8/feat/holders-insiders
Feat/Holders insider data
2023-12-13 22:13:24 +00:00
Julia L. Wang
dc957eeb0e Implementation of holders data 2023-12-13 16:57:13 -05:00
ValueRaider
f8d65d0def Merge pull request #1773 from bot-unit/feature/upgrades_downgrades
add upgrades downgrades
2023-12-13 20:59:58 +00:00
ValueRaider
f32097e157 Merge pull request #1771 from JuliaLWang8/feat/extra-dependencies
Feat/adding extra dependencies
2023-12-13 20:58:48 +00:00
Value Raider
469037be80 Tweaks to formatting and links. 2023-12-13 19:26:05 +00:00
Julia L. Wang
9648e69b7e Updated scipy and readme 2023-12-12 18:26:04 -05:00
ValueRaider
f718db6c2f Merge pull request #1776 from coskos-ops/fix/progressSTDerr 2023-12-12 23:08:28 +00:00
Filip Kostic
c8280e4001 Update utils.py 2023-12-12 17:45:26 -05:00
ValueRaider
53c29480b6 Merge pull request #1779 from VishnuAkundi/invalid_symbol_date_fix
Fix for Key Error Issue on Date column when one of the symbols is no longer valid (delisted/not available)
2023-12-12 21:16:39 +00:00
Vishnu Akundi
4a5616d5c4 Added Fix and Unit Test for Issue 2023-12-12 11:29:58 -05:00
Filip Kostic
5e0006e4b3 Removed redundant import 2023-12-11 15:07:16 -05:00
Filip Kostic
2b1a26ef0c Moved progress bar output to stderr 2023-12-10 20:51:11 -05:00
Filip Kostic
8fdf53233f Fixed issue #1305. Added test case to test for trailingPegInfo statistic retrieval 2023-12-10 17:54:08 -05:00
Unit
4175885747 add upgrades downgrades
add upgrades/downgrades (recommendations history)
return data is pandas dataframe
add test for upgrades/downgrades data
2023-12-10 22:35:53 +01:00
ValueRaider
580502941a Merge pull request #1766 from JuliaLWang8/pandas-future-proofing
Pandas future proofing
2023-12-10 20:33:46 +00:00
Julia L. Wang
1863b211cd Added extra dependencies 2023-12-10 10:36:02 -05:00
Julia L. Wang
0bcd2dc725 Removed unnecessary iloc 2023-12-09 23:08:22 -05:00
ValueRaider
c60e590bd7 Merge pull request #1768 from ranaroussi/fix/price-repair-and-tests
Minor fixes for price repair and related tests
2023-12-09 21:45:25 +00:00
ValueRaider
fce4707340 Merge pull request #1756 from marco-carvalho/ruff
Add Ruff
2023-12-09 21:33:28 +00:00
Value Raider
f7825c1c3a Minor fixes for price repair and related tests
Minor fixes for price repair and related tests:
- update out-of-date test, remove delisted ticker
- fix Numpy type mismatch error
2023-12-09 19:40:20 +00:00
Marco Carvalho
27ef2bcd1a Update ruff.yml 2023-12-09 13:18:35 +00:00
Marco Carvalho
fb2006b814 add ruff 2023-12-09 13:18:35 +00:00
Julia L. Wang
9b9158050a Pandas future proofing (tested)
Changed fillna, iloc, and added test changes
2023-12-08 04:26:04 -05:00
ValueRaider
f30e4ebd4c Merge pull request #1764 from ranaroussi/main
sync main -> dev
2023-12-07 09:40:56 +00:00
Value Raider
f08fe83290 Version 0.2.33 2023-12-06 19:49:23 +00:00
ValueRaider
ca2040f5fd Merge pull request #1759 from ranaroussi/hotfix/cookie-fallback-strategy
Fix '_set_cookie_strategy'
2023-12-06 19:47:40 +00:00
ValueRaider
1cfeddff59 Merge pull request #1760 from bot-unit/bugfixes/from_isin
fix base class init method
2023-12-06 19:47:32 +00:00
Value Raider
1ab476b14f Fix '_set_cookie_strategy', was double-toggling. + more logging 2023-12-06 19:46:01 +00:00
Unit
ae2ae7bce4 fix class init method 2023-12-05 19:19:03 +00:00
ValueRaider
1d3ef4f733 Merge pull request #1754 from bot-unit/feature/recommendations
Feature/recommendations
2023-12-02 19:43:35 +00:00
Unit
a3ac9fc72d added recommendations
added valid modules for quote summary request
added _fetch method for fetching quote summary
added fetch recommendationTrend
2023-12-02 15:46:17 +01:00
ValueRaider
03a1f03583 Create CODE_OF_CONDUCT.md 2023-11-26 13:08:54 +00:00
ValueRaider
af9a356fd5 Merge pull request #1745 from ranaroussi/main
sync main -> dev
2023-11-19 11:10:03 +00:00
Value Raider
9b6e35bdcd Version 0.2.32 2023-11-18 12:56:06 +00:00
ValueRaider
4d4e56cdc8 Merge pull request #1657 from ranaroussi/feature/cookie-and-crumb
Add cookie & crumb to requests
2023-11-18 12:54:24 +00:00
Value Raider
91efcd8f7d Final tidy before merge 2023-11-18 12:53:42 +00:00
Value Raider
63a3531edc Remove dependence on python>3.8 2023-11-16 20:29:02 +00:00
Value Raider
1b0d8357d6 Beta version 0.2.32b1 2023-11-13 20:29:51 +00:00
Value Raider
4466e57b95 Add cookie & crumb to requests
Add cookie & crumb to requests. Involves several changes:
- fetch cookie & crumb, obviously.
- two different cookie strategies - one seems to work better in USA, other better outside.
- yfinance auto-detects if one strategy fails, and switches to other strategy.
- cookie is stored in persistent cache folder, alongside timezones. Refetched after 24 hours.

To have this work well with multithreading (yfinance.download()) requires more changes:
- all threads share the same cookie, therefore the same session object. Requires thread-safety ...
- converted data class to a singleton with "SingletonMeta":
 - the first init() call initialises data.
 - but successive calls update its session object - naughty but necessary.
- thread locks to avoid deadlocks and race conditions.
2023-11-13 19:35:12 +00:00
ValueRaider
6d3d6b659c Merge pull request #1740 from mikez/main
Fix pandas FutureWarning: "Passing literal html to 'read_html' is deprecated"
2023-11-09 20:20:56 +00:00
Value Raider
b696add360 Restore 'earnings_dates' unit tests 2023-11-09 20:18:32 +00:00
Michael B.
06751a0b9c Fix pandas FutureWarning: "Passing literal html to 'read_html' is deprecated"
This addresses #1685 (`institutional_holders`) and also `get_earnings_dates()`.

Pandas issue is found here:
https://github.com/pandas-dev/pandas/issues/53767
and the change in code here:
5cedf87ccc/pandas/io/html.py (L1238)

As for legacy Python 2.7 support: `io.StringIO` seems to be supported in
the versions I tested. See https://docs.python.org/2/library/io.html
2023-11-09 17:42:22 +01:00
Mike Reiche
ba3c1b5ac6 Merge remote-tracking branch 'yfinance/dev' into bugfix/data-types-2
# Conflicts:
#	yfinance/base.py
2023-10-21 12:44:39 +02:00
ValueRaider
7432d2939c Merge pull request #1711 from rickturner2001/refactor/ticker-proxy
Refactor/ticker proxy
2023-10-18 20:08:05 +01:00
Mike Reiche
ba977a16a2 Added tests 2023-10-12 08:53:16 +02:00
Mike Reiche
9a3d60105c Minor typing fixes 2023-10-12 08:53:16 +02:00
Mike Reiche
0521428f69 Fixed typing bug when series are empty 2023-10-12 08:53:15 +02:00
Value Raider
308e58b914 Bump version to 0.2.31 2023-10-04 22:03:24 +01:00
ValueRaider
f6beadf448 Merge pull request #1716 from ranaroussi/dev
sync dev -> main
2023-10-04 22:01:43 +01:00
rickturner2001
d607c43967 refactored Ticker proxy attribute 2023-10-01 21:46:59 -04:00
rickturner2001
4c1669ad9d Refactored tests for Ticker with proxy
Ticker proxy refactor
2023-10-01 21:08:49 -04:00
Value Raider
7da64b679e Dev version 0.2.31b2 2023-10-01 22:40:15 +01:00
ValueRaider
38f8ccd40a Merge pull request #1709 from ranaroussi/feature/tz-cache-lazy-load
Feature/tz cache lazy load
2023-10-01 22:39:19 +01:00
ValueRaider
13acc3dc97 Merge pull request #1707 from rickturner2001/fix-testing
Test Fix: Check for type and expect exceptions in tests
2023-10-01 21:19:31 +01:00
Value Raider
cc1ac7bbcc Fix cache on read-only filesystem, + tests 2023-10-01 21:17:59 +01:00
rickturner2001
75449fd0ac Merge branch 'dev' into fix-testing 2023-10-01 15:08:12 -04:00
Value Raider
22e0c414c4 Rename for clarity 2023-10-01 13:04:48 +01:00
Value Raider
37d60e6efb Complete TZ cache lazy-loading
The initial singleton design pattern for database access meant that lazy-loading was broken,
due to structure of '_KV' class. So errors were blocking import.
Fix = use 'peewee' proxy database and initialise when needed.
2023-10-01 12:53:49 +01:00
Value Raider
dac9a48742 Dev version 0.2.31b1 2023-10-01 10:06:34 +01:00
rickturner2001
bd52326091 Fix testing: Fixed broken tests and refactored code 2023-09-30 18:23:03 -04:00
ValueRaider
9581b8bd45 Merge pull request #1705 from ranaroussi/fix/tz-cache-init
Fix TZ cache exception blocking import
2023-09-30 21:16:04 +01:00
Value Raider
62b2c25da8 Disable broken Ticker tests 2023-09-27 21:45:46 +01:00
Value Raider
7618dda5d0 Hopefully fix TZ cache exception blocking import
Hopefully fix TZ cache exception blocking import. Also:
- relocate cache init lock
- add test for setTzCacheLocation()
2023-09-27 21:34:59 +01:00
ValueRaider
95ef486e13 Merge pull request #1704 from ranaroussi/main
sync main -> dev
2023-09-27 20:53:42 +01:00
ValueRaider
9e59f6b61c Merge pull request #1703 from ranaroussi/fix/prices-intraday-merge-events
Fix merging pre-market events with intraday prices
2023-09-27 20:52:23 +01:00
Value Raider
716cd65fd3 Fix merging pre-market events with intraday prices 2023-09-25 22:19:24 +01:00
Value Raider
5b1605b5a1 Bump version to 0.2.30 2023-09-24 22:18:30 +01:00
ValueRaider
412cfbcd6d Merge pull request #1698 from ranaroussi/hotfix/download-database-error
Fix: OperationalError('unable to open database file')
2023-09-24 22:15:15 +01:00
Value Raider
6abee6df44 Remove unrelated change (will go in another PR) 2023-09-23 15:20:06 +01:00
Value Raider
fad21dfeac Enhance testing - use new cache folder 2023-09-23 13:41:59 +01:00
Value Raider
fc27f9c367 Refactor TZ cache 2023-09-23 13:30:58 +01:00
Value Raider
bb79b573ed Fix download() ''unable to open database file' 2023-09-23 11:40:39 +01:00
ValueRaider
127b53ee7f Merge pull request #1693 from ranaroussi/main
sync main -> dev
2023-09-22 14:52:36 +01:00
Value Raider
88525abcbd Bump version to 0.2.29 2023-09-22 12:00:47 +01:00
ValueRaider
99ef055cc4 Merge pull request #1692 from ranaroussi/dev
sync dev -> main
2023-09-22 12:00:06 +01:00
ValueRaider
0f36f7980b Merge pull request #1688 from ranaroussi/fix/price-repair
Price repair fixes
2023-09-22 11:27:38 +01:00
ValueRaider
8282af9ce4 Merge pull request #1684 from ranaroussi/fix/prices-intraday-merge-events
Fix merging events with intraday prices
2023-09-22 11:24:30 +01:00
Value Raider
5208c8cf05 Price repair improvements
Price repair improvements:
- don't attempt repair of empty prices table
- random-mixups: fix 0.01x errors, not just 100x
- stop zeroes, big-dividends, and 100x errors triggering false split errors
2023-09-22 11:21:17 +01:00
Value Raider
d3dfb4c6a8 Fix merging events with intraday prices
If Yahoo returns intraday price data with dividend or stock-split event in future, then this broke the merge.
Fix is to discard out-of-range events.
Assumes that if user requesting intraday then they aren't interested in events.
2023-09-19 19:35:03 +01:00
ValueRaider
279726afe4 Merge pull request #1687 from arduinocc04/arduinocc04-patch-2
Fix error when calling enable_debug_mode twice
2023-09-19 17:41:28 +01:00
조다니엘(Daniel Cho)
937386f3ef Fix error when calling enable_debug_mode twice 2023-09-19 10:02:28 +09:00
ValueRaider
32e569f652 Merge pull request #1675 from ranaroussi/hotfix/database-error
Replace sqlite3 with peewee for 100% thread-safety
2023-09-17 21:47:57 +01:00
ValueRaider
de59f0b2c6 Bug template - add section to describe bug 2023-09-09 18:32:32 +01:00
Value Raider
7d6d8562e8 Replace sqlite3 with peewee for 100% thread-safety 2023-09-03 16:47:36 +01:00
ValueRaider
6cae6d45b1 Merge pull request #1672 from difelice/fix-fix_yahoo_returning_live_separate-warnings
Fix pandas warning when retrieving quotes.
2023-09-01 22:07:18 +01:00
Alessandro Di Felice
ec3de0710d Fix pandas warning when retrieving quotes 2023-09-01 14:07:53 -05:00
Value Raider
0713d93867 Bump version to 0.2.28 2023-08-13 13:05:02 +01:00
Value Raider
67e81a8f9a Fix TypeError: 'FastInfo' object is not callable #1636 2023-08-13 13:01:53 +01:00
ValueRaider
b6372c0945 Merge pull request #1661 from ranaroussi/dev
sync dev -> main
2023-08-13 12:44:05 +01:00
ValueRaider
c9dd582dd8 Merge branch 'main' into dev 2023-08-13 12:40:11 +01:00
ValueRaider
677f3d5702 Merge pull request #1660 from ranaroussi/fix/price-repair-100x-and-calibration
Fix price repair: 100x & calibration
2023-08-13 12:21:55 +01:00
Value Raider
4f9b05a546 Fix price repair: 100x & calibration
Price repair fixes and improvement

Fixes:
- fix reconstruction mis-calibration with tiny DataFrames
- fix detecting last-active-trading-interval when NaNs in DataFrame
- redesign mapping 100x signals to ranges:
  - no change for signals before last-active-trading-interval
  - but for signals after last-active-trading-interval, process in reverse order

Improvements:
- increase max reconstruction depth from 1 to 2. E.g. now 1wk can be repaired with 1h (1wk->1d->1h)
2023-08-13 10:54:57 +01:00
ValueRaider
e1f94ed337 Merge pull request #1654 from ranaroussi/fix/circular-import
Fix circular import in utils.py
2023-08-05 12:56:15 +01:00
Value Raider
93a7ee6161 Fix circular import in utils.py
Commit a4d7d6 introduced a circular import into utils.py
2023-08-05 12:54:12 +01:00
Value Raider
5b0cb60cf5 Bump version to 0.2.27 2023-08-03 21:24:07 +01:00
ValueRaider
1a97c22874 Merge pull request #1635 from ranaroussi/hotfix/prices-events-merge
Fix merging 1d-prices with out-of-range divs/splits
2023-08-03 21:20:29 +01:00
ValueRaider
b0de31da63 Merge pull request #1648 from ranaroussi/hotfix/tkr-tz-already-in-cache
Fix multithread error 'tz already in cache'
2023-08-03 18:02:51 +01:00
Value Raider
cc87608824 Fix multithread error 'tz already in cache' 2023-08-02 19:29:06 +01:00
ValueRaider
6c1e26093c Merge pull request #1633 from ranaroussi/feature/price-repair-improvements
Improve price repair
2023-08-01 20:03:29 +01:00
ValueRaider
e8fdd12cb1 Merge branch 'dev' into feature/price-repair-improvements 2023-07-31 18:30:00 +01:00
Value Raider
93b6e024da Improve bad-split-repair on multiday intervals
Improve bad-split-repair on multiday intervals
Switch some repair log msgs from warning -> info
2023-07-31 18:19:42 +01:00
ValueRaider
d5282967ce Merge pull request #1606 from DanielGoldfarb/main
option_chain() return underlying data that comes with the options data
2023-07-27 15:10:13 +01:00
ValueRaider
9908c1ff48 Merge pull request #1638 from ricardoprins/dev
PEP 8 changes + minor performance improvements
2023-07-26 17:49:25 +01:00
Ricardo Prins
a4d7d6c577 PEP 8 changes + minor performance improvements 2023-07-25 21:01:46 -06:00
ValueRaider
f9080c22a5 Merge pull request #1630 from ricardoprins/dev
Adjust PEP 8 + minor improvements + f-strings in base.py
2023-07-25 16:50:01 +01:00
Ricardo Prins
32e1d479b1 Remove last _pd 2023-07-23 18:37:09 -06:00
Ricardo Prins
5729ce3cb6 Remove .formats and adjust imports 2023-07-23 18:28:30 -06:00
ValueRaider
d0b2070036 Fix merging 1d-prices with out-of-range divs/splits 2023-07-23 15:20:57 +01:00
ValueRaider
688120cab7 Merge pull request #1632 from ranaroussi/fix/history-30m-typo
Fix typo in Ticker.history(30m)
2023-07-23 13:18:35 +01:00
ValueRaider
4a1e1c4447 Merge branch 'dev' into feature/price-repair-improvements 2023-07-22 20:34:56 +01:00
ValueRaider
f99677ed1e Fix typo in Ticker.history(30m) 2023-07-22 16:52:50 +01:00
ValueRaider
6a613eb114 Improve price repair
Several improvements to price repair

Repair 100x and split errors:
- Handle stocks that recently suspended - use latest ACTIVE trading as baseline
- Improve error identification:
  - Restrict repair to no older than 1 year before oldest split
  - To reduce false positives when checking for multiday split errors,
    only analyse 'Open' and 'Close' and use average change instead of nearest-to-1
  - For weekly intervals reduce threshold to 3x standard deviation (5x was too high),
    and for monthly increase to 6x
  - For multiday intervas, if errors only detected in 1 column then assume false positive => ignore

Repair missing div-adjust:
- Fix repair of multiday intervals containing dividend

Price reconstruction:
- Move to after repairing 100x and split errors, so calibration works properly
- Fix maximum depth and reduce to 1
- Restrict calibration to 'Open' and 'Close', because 'Low' and 'High' can differ significantly between e.g. 1d and day-of-1h

Miscellaneous:
- Deprecate repair='silent', the logging module handles this
- Improve tests for 100x and split errors
- New test for 'repair missing div adjust'
2023-07-22 15:09:38 +01:00
Ricardo Prins
0503240973 Adjust PEP 8 + minor improvements + f-strings 2023-07-21 20:33:47 -06:00
ValueRaider
ae6c05fa74 Merge pull request #1628 from ricardoprins/dev
Adjust PEP 8 + minor improvement
2023-07-21 22:35:21 +01:00
Ricardo Prins
aa9a0286a1 Add missing comment to test_dailyWithEvents 2023-07-21 14:25:46 -06:00
ValueRaider
ddf0cf19cd Bump version to 0.2.26 2023-07-21 12:56:10 +01:00
Ricardo Prins
a2bde88c36 Adjust PEP 8 + minor improvement 2023-07-20 22:44:36 -06:00
ValueRaider
1bd819ac4d Merge pull request #1371 from ranaroussi/hotfix/proxy
Fix proxy arg passthrough
2023-07-21 01:01:14 +01:00
ValueRaider
1b9fc5f12f Merge pull request #1625 from ricardoprins/main
Bump requests to 2.31 and removes cryptography.
2023-07-21 00:59:46 +01:00
Ricardo Prins
274f309052 Bump requests to 2.31 and removes cryptography. 2023-07-20 17:17:44 -06:00
ValueRaider
edac283a60 Merge pull request #1623 from ranaroussi/bug-report-yaml
Fix yaml issue rendering
2023-07-19 18:21:52 +01:00
ValueRaider
781fad501f Merge branch 'main' into bug-report-yaml 2023-07-19 18:21:44 +01:00
ValueRaider
39527d24d4 Fix yaml issue template rendering 2023-07-19 18:21:04 +01:00
ValueRaider
45f1c88460 yaml issue template - escape some backticks 2023-07-19 18:09:20 +01:00
ValueRaider
7d638e1040 Merge pull request #1613 from ranaroussi/bug-report-yaml
Convert issue template to yaml
2023-07-19 18:05:40 +01:00
ValueRaider
97b13dfa8c Convert issue template to yaml + improve 2023-07-19 18:01:47 +01:00
ValueRaider
693565a85b Bump version to 0.2.25 2023-07-18 13:45:55 +01:00
ValueRaider
957051e0e8 Merge pull request #1605 from ranaroussi/dev
sync dev -> main
2023-07-18 12:02:19 +01:00
ValueRaider
bd81ebb4e9 Merge pull request #1611 from ricardoprins/main
[BUG] Fix failure when using single ISIN as a ticker (#1525)
2023-07-18 10:55:18 +01:00
ValueRaider
46f53f9957 Port proxy fix to relocated 'FastInfo' 2023-07-17 18:34:00 +01:00
ValueRaider
056b84d8fe Merge branch 'main' into hotfix/proxy 2023-07-17 18:29:04 +01:00
Ricardo Prins
835dbd9629 Fix failure when using single ISIN as a ticker 2023-07-17 08:49:39 -06:00
ValueRaider
07a4594455 Dev version 0.2.25b1 2023-07-14 21:55:29 +01:00
Daniel Goldfarb
736c03ac5b options_chain() return underlying data that comes with the options data 2023-07-14 15:17:17 -04:00
ValueRaider
adfa2e9beb Merge pull request #1604 from ranaroussi/main
sync main -> dev
2023-07-14 20:11:45 +01:00
ValueRaider
b286797e8c Bump version to 0.2.24 2023-07-14 15:52:33 +01:00
ValueRaider
b306bef350 Merge pull request #1603 from ranaroussi/hotfix/info-missing-values
Fix info[] missing values
2023-07-14 15:51:23 +01:00
ValueRaider
61c89660df Optimise info fetch, improve test 2023-07-14 15:29:55 +01:00
Value Raider
31af2ab1d5 Fix recently-fixed info[] missing data 2023-07-13 22:20:42 +01:00
Value Raider
21c380fa61 Bump version to 0.2.23 2023-07-13 20:54:56 +01:00
ValueRaider
e0000cd787 Merge pull request #1595 from signifer-geo/bug20230714
Update quote.py
2023-07-13 20:51:33 +01:00
signifer-geo
11d43eb1a1 Update quote.py
dead code deleted
2023-07-14 04:29:59 +09:00
signifer-geo
509a109f29 Update quote.py
It fixes the error: unauthorized, invalid crumb
2023-07-14 03:11:24 +09:00
ValueRaider
b0639409a3 Merge pull request #1586 from ranaroussi/improve-readme
Emphasise API on Wiki
2023-07-10 15:26:31 +01:00
ValueRaider
ed10feee9a Merge pull request #1584 from lucas03/lukas/start-date-docs
update start parameter docstring
2023-07-06 21:20:17 +01:00
ValueRaider
aba81eedc2 Emphasise API on Wiki
More emphasis that user should review the Wiki for the full API for download() and Ticker.history()
2023-07-06 21:15:41 +01:00
Lukas Vojt
d424d027ac update docstrings for start parameter
requested here
https://github.com/ranaroussi/yfinance/pull/1576#issuecomment-1616599633
2023-07-06 08:17:07 +00:00
ValueRaider
9268fcfa76 Merge pull request #1545 from SnoozeFreddo/main
fix: Readme cache-ratelimit. Limiter parenthesis was never closed
2023-06-27 13:54:08 +01:00
ValueRaider
711e1138d3 Merge pull request #1576 from lucas03/lukas/start-date
fix start date on history
2023-06-27 12:32:17 +01:00
Lukas Vojt
0789b690a4 fix: start year on history
timestamp of 1900 is older than 100 years,
so yahoo responds with error:

GDEVW: 1d data not available for startTime=-2208994789 and
endTime=1687780922. Only 100 years worth of day granularity data are
allowed to be fetched per request.

this should fix it,
something similar was proposed here:
https://github.com/ranaroussi/yfinance/pull/648

 # Please enter the commit message for
your changes. Lines starting
2023-06-26 18:43:35 +02:00
ValueRaider
6055566de8 Bump version to 0.2.22 2023-06-24 19:42:18 +01:00
ValueRaider
398a19a855 Merge pull request #1574 from ranaroussi/hotfix/sql-db-error
Fix unhandled 'sqlite3.DatabaseError'
2023-06-24 19:40:51 +01:00
ValueRaider
e771cfabb6 Fix unhandled 'sqlite3.DatabaseError'
... also move '_TzCacheException' logging from level ERROR to INFO, because users don't need to know
2023-06-24 16:57:06 +01:00
ValueRaider
5b676f803b Bump version to 0.2.21 2023-06-21 23:15:37 +01:00
ValueRaider
eb5c50d5c7 Merge pull request #1569 from ranaroussi/dev
sync dev -> main
2023-06-21 23:13:49 +01:00
ValueRaider
1cb0b215c4 Merge branch 'main' into dev 2023-06-21 23:13:12 +01:00
ValueRaider
50dcb2ce5a Merge pull request #1568 from ranaroussi/fix/financials
Fix financials tables
2023-06-21 23:07:50 +01:00
ValueRaider
1ce9ce2784 Fix financials ; Remove broken decryption & scraping 2023-06-21 14:49:16 +01:00
ValueRaider
cd4816e289 Post-merge tidy price-repair logging 2023-06-20 17:46:06 +01:00
ValueRaider
27e9ce7542 Merge pull request #1543 from ranaroussi/feature/fix-Yahoo-bad-div-split-adjustments
Price repair update: fix Yahoo messing up dividend and split adjustments
2023-06-20 17:41:16 +01:00
ValueRaider
02c1c60f3b Merge branch 'dev' into feature/fix-Yahoo-bad-div-split-adjustments 2023-06-20 17:39:19 +01:00
ValueRaider
27ea9472c1 Price repair improvements
Improve split-repair of multi-day intervals. Because split error can occur within a multi-day interval, e.g. mid-way through week, need to repair each OHLC column separately

Increase robustness of repair 'Adj Close'

Limit price-repair recursion depth to 2
2023-06-20 17:37:19 +01:00
ValueRaider
801f58790a Merge pull request #1562 from ranaroussi/fix/logging-behaviour
Fix logging behaviour
2023-06-19 23:26:14 +01:00
ValueRaider
080834e3ce Update README#logging ; remove 'info fixed' message 2023-06-19 23:25:36 +01:00
ValueRaider
4e7b2094d0 Logging: improve appearance, fix propagation
Various important changes to yfinance logging:

Remove handler from YF logger as breaks standard logging practice.

Improve 'download' log message grouping

Move custom DEBUG log formatting into 'yf.enable_debug_mode()', which if called adds the handler. The custom DEBUG log formatting is:
- 'MultiLineFormatter' improves appearance of multi-line messages in any logging mode. Adds leading indent to all lines below first, to align with the first line which is indented by %levelname%.
- Whitespace padding is added to end of %levelname% string up to 8 characters. This resolves different level strings e.g. INFO & DEBUG creating different indents. But this only automatically applies to first line of message - for multi-line messages, 'MultiLineFormatter' extracts amount of padding and applies to all other lines.
- Add leading indent proportional to function depth, because DEBUG generates a lot of messages particularly when repairing price data - same function can be called recursively. Implemented in 'IndentLoggerAdapter', a simple wrapper around the logger object.
- 'log_indent_decorator' inserts 'Entering/Exiting %function%' debug messages, helps organise.
2023-06-19 19:42:02 +01:00
ValueRaider
c72e04bf55 Merge pull request #1567 from ranaroussi/fix/future-event-merge
Fix merge future div/split into prices
2023-06-19 11:56:48 +01:00
ValueRaider
abbe4c3a2f Fix merge future div/split into prices 2023-06-19 11:41:53 +01:00
ValueRaider
9e21b85043 Merge branch 'dev' into feature/fix-Yahoo-bad-div-split-adjustments 2023-06-17 12:49:01 +01:00
ValueRaider
b44917b7f9 Improve price-repair of 1d 'Adj Close'
Main change is fixing price-repair of 1d 'Adj Close'. 1d repair uses 1h data, but 1h is never div-adjusted. For correct 1d 'Adj Close', extract div-adjustment from the good 1d data, and calculate it for any bad 1d data. A new unit test ensures correctness.

Other changes:
- bug fix in split-repair logic to handle price=0
- improve unit test coverage on price dividend
- add 1wk interval to split-repair unit test
2023-06-16 14:06:25 +01:00
ValueRaider
6f78dd6e6b Fix dumb bug 2023-06-12 17:05:37 +01:00
ValueRaider
593dc8fcee Use new split-repair logic to also fix 100x error
Stumbled upon another type of 100x price error - Yahoo may switch a symbol from e.g. cents -> $ on some recent date, so recent prices are 100x different. The new split-repair is perfect for this - set change to 100 and ignore 'Volume'.
2023-06-12 14:46:58 +01:00
ValueRaider
b94baa4cc5 Merge pull request #1552 from adityanparikh/fix/timedelta
Fix timedelta bug
2023-06-08 21:26:31 +01:00
ValueRaider
1a054135fb Merge pull request #1553 from ranaroussi/fix/events-merging
Fix prices-events merge
2023-06-08 21:18:14 +01:00
ValueRaider
4e2253a406 Fix prices-events merge
An out-of-range dividend was breaking merge with 1mo-prices, so fixed that. Also replaced the mega-loop with Numpy, much clearer now. Improved its tests.
2023-06-08 21:16:05 +01:00
Aditya Parikh
9af7ec0a4e Fix timedelta bug
Fix for exception using _pd.Timedelta function with unit='d' parameter for  Pandas v1.4.4
2023-06-08 16:15:03 -04:00
Value Raider
8624216e21 Bump version to 0.2.20 2023-06-07 16:51:17 +01:00
ValueRaider
954e71d19c Update action versions in python-publish.yml
Recent release action generated deprecated error: "Node.js 12 actions are deprecated. Please update the following actions to use Node.js 16: actions/checkout@v2, actions/setup-python@v2."

So simply increasing versions to match latest GitHub usage docs, hopefully works.
2023-06-07 16:48:11 +01:00
ValueRaider
5124059422 Bump version to 0.2.19 2023-06-07 13:28:32 +01:00
ValueRaider
d18cd6f42f Merge pull request #1549 from ranaroussi/dev
dev -> main
2023-06-07 13:23:39 +01:00
ValueRaider
c20211a06c Merge pull request #1547 from bveber/dev 2023-06-06 23:05:40 +01:00
bveber
cdfe7d0d2d add session to download 2023-06-06 01:06:18 -05:00
ValueRaider
e57647c1d7 Stock split repair: bug fixes & more testing 2023-06-03 20:49:35 +01:00
Konstantinos Ftikas
762abd8bba fix: Readme cache-ratelimit. Limiter parenthesis was never closed
The example in the docs will not work out of the box due to a syntax error.
2023-06-03 14:19:31 +02:00
ValueRaider
d1ea402792 Price repair improvement: fix stupid bug 2023-06-01 15:56:54 +01:00
ValueRaider
65f65b1776 Price repair improvement: fix price Low=High errors on stock split day
Yahoo often messes up price data on stock split day - all equal or simply missing.
Impossible that price didn't move/trade on stock split day.
2023-05-31 21:51:04 +01:00
ValueRaider
9388c29207 Price repair improvement: fix stock split adjustment missing from pre-split data 2023-05-31 21:41:05 +01:00
ValueRaider
9f91f4b180 Price repair improvement: fix missing dividend adjustment 2023-05-31 21:40:16 +01:00
ValueRaider
cac616a24c Dev version 0.2.19b4 2023-05-25 11:09:31 +01:00
ValueRaider
72a9e45e56 Merge pull request #1541 from ranaroussi/fix/download-logging
Bugfix in `download` logging tracebacks & boost tests
2023-05-25 10:58:52 +01:00
ValueRaider
4802199ae7 Bugfix in download logging tracebacks & boost tests
New logging in `download` stores the tracebacks, but the logic was faulty, this fixes that.
Also improves error handling in `download`.
Unit tests should have detected this so improved them:
- add/improve `download` tests
- disable tests that require Yahoo decryption (because is broken)
- fix logging-related errors
- improve session use
2023-05-24 13:19:39 +01:00
ValueRaider
d9bfd29113 Delete 'Feature request' issue template - can't have nice things 2023-05-23 17:11:31 +01:00
ValueRaider
4711aab7b3 Merge pull request #1536 from ranaroussi/hotfix/tz-cache-migrate-error-again
Fix corrupt tkr-tz-csv halting code (again)
2023-05-23 16:44:35 +01:00
ValueRaider
30d20c1206 Fix corrupt tkr-tz-csv halting code (again) 2023-05-23 16:34:50 +01:00
ValueRaider
5c565c8934 bug_report.md: add instruction to post debug log
bug_report.md: add instruction to post debug log. Plus some minor edits.
2023-05-17 18:44:52 +01:00
ValueRaider
2fff97290b Merge pull request #1528 from ranaroussi/fix/tz-cache-migrate-error
Fix corrupt tkr-tz-csv halting code
2023-05-17 16:59:15 +01:00
ValueRaider
62ca5ab6be Fix corrupt tkr-tz-csv halting code 2023-05-17 15:05:38 +01:00
ValueRaider
83b177b7fb README.md - note on installing betas 2023-05-12 12:11:14 +01:00
ValueRaider
e8b99cb4e6 Dev version 0.2.19b3 2023-05-11 14:04:04 +01:00
ValueRaider
503d234020 Dev version 0.2.19b2 - add missing file 2023-05-11 14:03:38 +01:00
ValueRaider
144efd3b08 Dev version 0.2.19b2 2023-05-11 13:52:41 +01:00
ValueRaider
80fc91ffa9 Merge pull request #1523 from ranaroussi/fix/price-fixes
Price fixes
2023-05-11 13:51:03 +01:00
ValueRaider
9821197fd1 Merge pull request #1522 from ranaroussi/fix/logging-messages
Improve logging messages
2023-05-11 13:50:45 +01:00
ValueRaider
45b5cac33b Improve logging messages
Improve logging messages related to price data fetches:
- fix 'debug is deprecated' msg
- append user args to 'may be delisted' msg - interval & dates/period
- improve formatting of 'cannot reconstruct' msg
- hide errors in 'history()' while accessing 'fast_info[]'
2023-05-10 14:47:58 +01:00
ValueRaider
d755b8c7ff Fix 'history()' edge cases
Fix merging prices & events if prices empty.
If user requested price repair, ensure 'Repaired?' column always present.
2023-05-10 14:44:50 +01:00
ValueRaider
ab1042b4c9 Dev version 0.2.19b1 2023-05-04 22:14:34 +01:00
ValueRaider
8172fc02d2 Merge pull request #1514 from ranaroussi/feature/optimise-history
Optimise Ticker.history() - up to 2x faster
2023-05-04 22:08:40 +01:00
ValueRaider
836082280b Merge branch 'dev' into feature/optimise-history 2023-05-04 22:08:28 +01:00
ValueRaider
6a98c2eda6 Merge pull request #1493 from ranaroussi/feature/error-reporting
Deprecate 'debug' arg, improve 'logging' use
2023-05-04 22:06:54 +01:00
ValueRaider
46f55c8983 Add debug logging to 'history()' ; Improve logger fmt 2023-05-04 22:04:39 +01:00
ValueRaider
b025fef22c Optimise Ticker.history() - up to 2x faster
format_history_metadata() is expensive. Improvements:
- only perform full formatting if user requests metadata
- when pruning prepost data, only format 'tradingPeriods' entry of metadata

Other small optimisations to several internal prices processing methods.

Speedups:
dat.history(period='1wk', interval='1h', prepost=True)  # 2x
dat.history(period='1mo', interval='1h', prepost=True)  # 1.46x
dat.history(period='1wk', interval='1h')  # 1.15x
dat.history(period='1mo', interval='1h')  # 1.13x
dat.history(period='1y', interval='1d')  # 1.36x
dat.history(period='5y', interval='1d')  # 1.13x
2023-04-30 00:35:08 +01:00
ValueRaider
b96319dd64 Merge pull request #1504 from ranaroussi/hotfix/sql-exception
Fix timezone cache error: IntegrityError('NOT NULL constraint failed: kv.key')
2023-04-26 21:29:33 +01:00
ValueRaider
74b88dc62c Fix IntegrityError in timezone cache 2023-04-26 21:27:31 +01:00
ValueRaider
e3778465d8 Merge branch 'dev' into feature/error-reporting 2023-04-22 16:02:56 +01:00
ValueRaider
f82177ea2e Improve download() logging - group errors & tracebacks for cleaner STDOUT 2023-04-16 21:57:04 +01:00
ValueRaider
d30a2a0915 README.md: update 'News' 2023-04-16 21:29:57 +01:00
ValueRaider
142b1f3eb4 Merge pull request #1499 from ranaroussi/main
sync main -> dev
2023-04-16 19:08:50 +01:00
ValueRaider
afad7fcf0b Bump version to 0.2.18 2023-04-16 19:03:08 +01:00
ValueRaider
0baedbe4f5 Merge pull request #1498 from ranaroussi/hotfix/tz-cache-migrate-error
Fix handling Pandas parsing error during TZ-csv-cache migrate
2023-04-16 19:00:50 +01:00
ValueRaider
2c3c3dc8a9 Merge pull request #1496 from ranaroussi/hotfix/fast-info-np-not-found
Fix '_np not found', tweak 'info[] fixed' message
2023-04-16 18:59:38 +01:00
ValueRaider
8585dda77a Fix handling Pandas parsing error during TZ-csv-cache migrate 2023-04-16 15:09:28 +01:00
ValueRaider
3eb60fbd4a Fix '_np not found', tweak 'info[] fixed' message 2023-04-16 10:37:25 +01:00
ValueRaider
d3e2e71a6e Improve logging behaviour, particulary download()
- Use same logger across all files
- download():
  - write tracebacks to DEBUG
  - deprecate 'show_errors' argument
2023-04-15 17:29:07 +01:00
ValueRaider
4937c933a2 Deprecate 'debug' arg, improve 'logging' use 2023-04-15 16:47:39 +01:00
ValueRaider
045cd45893 Bump version to 0.2.17 2023-04-10 21:55:21 +01:00
ValueRaider
6d52cb6e3a Merge pull request #1488 from steven9909/fix_localize
Fix tzinfo missing attribute
2023-04-10 21:51:54 +01:00
steven9909
a24c0e1391 fix tzinfo missing attribute
tzinfo does not have a localize attribute so it is replaced with timestamp in UTC
2023-04-10 16:04:58 -04:00
ValueRaider
1e941fc86a Merge branch 'main' into dev 2023-04-09 23:45:37 +01:00
ValueRaider
0b52e8f118 Bump version to 0.2.16 2023-04-09 23:42:50 +01:00
ValueRaider
d45bed3d53 Fix 'fast_info deprecated' msg appearing at Ticker() init 2023-04-09 23:41:44 +01:00
ValueRaider
4152f7c897 Bump version to 0.2.15 2023-04-09 21:07:16 +01:00
ValueRaider
e7a3848f69 Merge pull request #1477 from ranaroussi/feature/price-repair-tweaks
Price repair: add 'Repaired?' column, and a bugfix
2023-04-09 21:01:49 +01:00
ValueRaider
fc4350e463 Merge pull request #1480 from kennykos/get_full_info
'info' fetch now gets same data as scrape
2023-04-09 21:01:34 +01:00
ValueRaider
13556afd90 README.md: reorganise & link to 'How to contribute' 2023-04-07 12:21:01 +01:00
ValueRaider
3d29ced428 Merge pull request #1474 from garrettladley/leverage-dict-and-list-comps
Leverage dict & list comprehensions in yfinance/tickers.py
2023-04-06 13:26:08 +01:00
Value Raider
6a63ce9e15 Demote 'fast_info'
Demote 'fast_info':
- inform user can revert to 'info'
- remove from README
- relocate class from base.py -> quote.py
2023-04-06 12:21:57 +01:00
garrettladley
2fe5a0a361 leveraged dict & list comps in yfinance/tickers.py 2023-04-05 18:55:47 -04:00
kennykos
63699a6aad 'info' fetch now gets same data as scrape
* Changed base url to "https://query2.finance.yahoo.com/v10/finance/quoteSummary"
* instead of just getting the quote, we now get
	* ```
	   items = ['summaryProfile', 'financialData', 'quoteType',
                    'defaultKeyStatistics', 'assetProfile', 'summaryDetail']
          ```
	which is the same as in the scrape function
2023-04-05 18:23:36 +01:00
Value Raider
a649b40dc9 Price repair: add 'Repaired?' column, and a bugfix
Price repair changes:
- if user requests price repair, add 'Repaired?' bool column showing what rows were repaired.
- fix price repair requesting <1d data beyond Yahoo's limit.
- fix logger messages
2023-04-03 21:27:04 +01:00
ValueRaider
a01edee4fa Merge pull request #1476 from ranaroussi/main
main -> dev
2023-04-03 21:20:50 +01:00
Value Raider
5367f62bd7 Bump version to 0.2.14 2023-03-25 11:39:21 +00:00
ValueRaider
27cb90c596 Merge pull request #1461 from qianyun210603/main
Add failback for decryption error in info interface
2023-03-25 11:33:27 +00:00
BookSword
6c2682654a Fetch 'info' dict via API 2023-03-24 18:04:07 +00:00
Value Raider
e89e190d11 Merge branch 'main' into dev 2023-03-21 19:05:56 +00:00
ValueRaider
a236270389 Merge pull request #1457 from ranaroussi/fix/price-fixes-various
Various fixes to price data processing
2023-03-21 18:59:13 +00:00
Value Raider
ef1205388c Bump version to 0.2.13 2023-03-21 18:56:32 +00:00
Value Raider
bb477989d4 Fix price-events merge when occurred pre-market 2023-03-21 18:52:35 +00:00
ValueRaider
478dc0a350 Merge pull request #1452 from ranaroussi/hotfix/prices-merge-events
Fix filtering events older than prices for merging
2023-03-21 18:16:29 +00:00
Value Raider
b5dca4941a Order history_metadata['tradingPeriods'] DF sensibly 2023-03-20 21:18:53 +00:00
Value Raider
6b71ba977c Various fixes to price data processing
- move drop-duplicates to before repair
- fix 'format_history_metadata()' processing 'regular' column
- fix Pandas & Numpy warnings
2023-03-20 21:10:45 +00:00
ValueRaider
195a7aa304 Merge pull request #1455 from mppics/fix/aggregate_capital_gains
Adding fix and test for aggregating Capital Gains
2023-03-18 17:24:53 +00:00
Matt Piccoli
a58d7456fe Adding fix and test for aggregating Capital Gains 2023-03-18 12:57:26 -04:00
ValueRaider
1edeaf07dc Merge pull request #1448 from ivan23kor/feature/clarify-end-argument
Clarify that interval is [start; end) in docstrings
2023-03-09 22:04:58 +00:00
Ivan Korostelev
7f04a9dcb6 Clarify that interval is [start; end) in docstrings 2023-03-09 14:27:21 -07:00
ValueRaider
7b95f554bd README: fix rate-limiting example 2023-02-21 12:24:35 +00:00
ValueRaider
6c70b866c7 Merge pull request #1423 from flaviovs/no-print
No print
2023-02-20 20:07:23 +00:00
Value Raider
bd696fb4db Beta version 0.2.13b1 2023-02-17 17:04:39 +00:00
Value Raider
d13aafa633 Replace more prints with logging, mostly in 'price repair' 2023-02-17 12:01:11 +00:00
Flávio Veloso Soares
00823f6fa6 Remove redundant logging text 2023-02-16 16:53:33 -08:00
Flávio Veloso Soares
21fdba9021 Replace warnings print() with warnings.warn(...) calls 2023-02-16 16:53:33 -08:00
Flávio Veloso Soares
972547ca8c Replace prints with logging module 2023-02-16 16:53:33 -08:00
ValueRaider
23b400f0fb Merge pull request #1421 from ranaroussi/fix/missing-price-history-errors
Improve handling missing price history
2023-02-16 14:22:10 +00:00
Value Raider
ca8c1c8cb4 Bump version to 0.2.12 2023-02-16 12:01:25 +00:00
ValueRaider
6b8b0d5c86 Merge pull request #1422 from ranaroussi/hotfix/disable-decrypt-fail-msg
Disable annoying 'backup decrypt' msg
2023-02-16 12:00:16 +00:00
Value Raider
952a04338f Disable annoying 'backup decrypt' msg 2023-02-15 16:46:55 +00:00
Value Raider
a1a385196b Improve handling missing price history
Fix fast_info[] dying if metadata incomplete/missing ; Price repair fix when no fine data available ; Fix _fix_unit_mixups() report
2023-02-14 17:31:14 +00:00
ValueRaider
62a442bd15 Update yahoo-keys.txt 2023-02-14 00:06:06 +00:00
ValueRaider
a0046439d1 Merge pull request #1400 from ranaroussi/feature/improve-performance
Optimise recent new features in `history`
2023-02-12 14:58:36 +00:00
ValueRaider
63a8476575 Merge pull request #1417 from ranaroussi/main
main -> dev
2023-02-12 14:56:19 +00:00
ValueRaider
e96f4f3cc0 Update yahoo-keys.txt 2023-02-12 09:57:25 +00:00
ValueRaider
cd5d0dfc3b Bump version to 0.2.11 2023-02-10 16:59:20 +00:00
ValueRaider
ece41cdb06 Merge pull request #1411 from sdeibel/main
Fix format_history_metadata for some symbols
2023-02-10 16:30:03 +00:00
ValueRaider
c362d54b1a Fix other metadata accesses + tests 2023-02-09 19:41:50 +00:00
Stephan Deibel
543e4fe582 Fix format_history_metadata for some symbols
Fix format_history_metadata when firstTradeDate is None, as is the case for QCSTIX and probably others.
2023-02-09 13:46:52 -05:00
ValueRaider
f8aab533ba Merge branch 'main' into hotfix/proxy 2023-02-08 13:52:34 +00:00
ValueRaider
53fca7016e Bump version to 0.2.10 2023-02-07 22:05:17 +00:00
ValueRaider
4b6529c3a5 Merge pull request #1406 from ranaroussi/dev
dev -> main
2023-02-07 22:03:20 +00:00
ValueRaider
8957147926 Merge branch 'main' into dev 2023-02-07 22:02:46 +00:00
ValueRaider
4c7392ed17 Merge pull request #1403 from ranaroussi/fix/decrypt-keys
Fix decrypt keys
2023-02-07 21:55:33 +00:00
ValueRaider
0efda4f5af Fix filtering events older than prices for merging 2023-02-07 21:45:35 +00:00
ValueRaider
508de4aefb Dev version 0.2.10b3 2023-02-07 14:09:08 +00:00
ValueRaider
3d39992280 Add resilience to price repair
When calibrating price repair, use weighted average to estimate stock split ratio, is more resilient
2023-02-07 14:07:08 +00:00
ValueRaider
b462836540 Merge pull request #1385 from ranaroussi/fix/download-tz-behaviour
Restore original download() timezone handling
2023-02-07 13:16:03 +00:00
ValueRaider
2795660c28 Add a 5th backup key 2023-02-07 13:10:03 +00:00
ValueRaider
3dc87753ea Fix _get_decryption_keys_from_yahoo_js() returning '' 2023-02-07 13:09:49 +00:00
ValueRaider
645cc19037 Merge pull request #1379 from ranaroussi/feature/improve-decrypt
Add another backup decrypt option
2023-02-06 22:24:22 +00:00
ValueRaider
86d6acccf7 Fix dumb bugs in price repair - 1 more 2023-02-05 18:17:47 +00:00
ValueRaider
0f5db35b6e Optimise Ticker._reconstruct_intervals_batch() (slightly) 2023-02-05 18:16:08 +00:00
ValueRaider
7c6742a60a Optimise Ticker._fix_unit_mixups() 2023-02-05 15:15:56 +00:00
ValueRaider
4fa32a98ed Merge pull request #1397 from Matt-Seath/dev
Catch TypeError Exception
2023-02-05 13:49:48 +00:00
ValueRaider
36ace8017d Optimise Ticker._fix_zeroes() 2023-02-05 13:46:57 +00:00
ValueRaider
5cdc78f479 Merge pull request #1398 from vidalmarco/patch-1
get_shares_full does not work with proxy
2023-02-05 10:59:33 +00:00
Marco Vidal
ba634fad0e get_shares_full does not work with proxy
Error: "Yahoo web request for share count failed" 
updated cache_get call by adding proxy parameter and by calling it by keyword
2023-02-05 09:17:22 +01:00
Matt Seath
35f4071c0b Catch TypeError Exception
Addresses recent issue where calling Ticker.info would occasionally result in a TypeError Exception at line 287.
2023-02-05 11:49:40 +10:00
ValueRaider
8a5ca71f52 Fix holders.py proxy pass-through 2023-02-05 00:06:49 +00:00
ValueRaider
ead0bce96e Optimise format_history_metadata() 2023-02-04 22:56:49 +00:00
ValueRaider
86b00091a9 Fix dumb bugs in price repair 2023-02-02 21:57:55 +00:00
ValueRaider
141ce7e471 Fix proxy + cache_get. Improve error propagation 2023-02-01 21:19:54 +00:00
ValueRaider
4eae728a06 Potential fix for proxy - enable #2 2023-02-01 19:17:18 +00:00
ValueRaider
2d6b6b26ed Potential fix for proxy - enable 2023-02-01 19:04:47 +00:00
ValueRaider
ec3dfaf305 Potential fix for proxy - revert 2023-02-01 18:10:45 +00:00
ValueRaider
e89d390824 Potential fix for proxy 2023-02-01 18:09:51 +00:00
ValueRaider
563a1a3448 Add Ticker test for proxy 2023-02-01 17:28:57 +00:00
ValueRaider
2e6d3d0e60 Fix proxy in 'history()' 2023-02-01 17:06:23 +00:00
ValueRaider
2a2928b4a0 Fix 'tradingPeriods' parsing when empty - 0.2.10b2 2023-02-01 13:31:54 +00:00
ValueRaider
d47133e5bf Dev version 0.2.10b1 2023-01-31 22:12:11 +00:00
ValueRaider
8f0c58dafa Dev version 0.2.10b0 2023-01-31 22:02:41 +00:00
ValueRaider
27a721c7dd Merge pull request #1380 from ranaroussi/fix/old-sqlite-error
Allow using sqlite3 < 3.8.2
2023-01-31 19:52:22 +00:00
ValueRaider
3e964d5319 Merge pull request #1383 from ranaroussi/fix/fast-info-prepost
Fix fast_info["previousClose"]
2023-01-31 19:51:46 +00:00
ValueRaider
84a31ae0b4 Merge pull request #1311 from ranaroussi/feature/prices-metadata-prune-prepost
Drop intraday intervals if in post-market but prepost=False
2023-01-31 19:50:00 +00:00
ValueRaider
891b533ec2 Drop intraday intervals if in prepost but prepost=False 2023-01-31 19:48:47 +00:00
ValueRaider
b9fb3e4979 Restore original download() tz handling: day/week/etc = ignore 2023-01-31 00:00:45 +00:00
ValueRaider
09342982a4 Add 'quoteType'. Improve handling tickers without trading 2023-01-30 23:53:06 +00:00
ValueRaider
da8c49011e fast_info: Fix previousClose & yearChange 2023-01-30 16:06:55 +00:00
ValueRaider
b805f0a010 Add another backup decrypt option 2023-01-29 23:09:45 +00:00
ValueRaider
5b0feb3d20 Fix tests 2023-01-29 16:53:26 +00:00
ValueRaider
ecbfc2957d bug_report: tighten language (again) 2023-01-29 13:58:02 +00:00
ValueRaider
e96248dec7 README: fix narrative ordering 2023-01-29 13:52:13 +00:00
ValueRaider
7d0045f03c README: simplify API overview with link to Wiki 2023-01-29 13:49:01 +00:00
ValueRaider
c3d7449844 Merge pull request #1289 from ranaroussi/fix/price-repair
Fix & improve price repair
2023-01-29 13:02:48 +00:00
ValueRaider
a4f11b0243 Fix price repair tests, remove unrelated changes 2023-01-29 13:01:54 +00:00
ValueRaider
1702fd0797 bug_report: tighten language 2023-01-29 00:54:27 +00:00
ValueRaider
464b3333d7 Allow using sqlite3 < 3.8.2 2023-01-29 00:34:46 +00:00
ValueRaider
685f2ec351 Merge branch 'dev' into fix/price-repair 2023-01-28 23:26:56 +00:00
ValueRaider
aad46baf28 price repair: Fix 'min_dt', add 'silent' mode 2023-01-28 23:14:28 +00:00
ValueRaider
a97db0aac6 README: add how-to for requests rate-limiting 2023-01-28 23:10:38 +00:00
ValueRaider
553bc5965a Fix proxy arg passthrough 2023-01-28 23:07:19 +00:00
ValueRaider
af5f96f97e Merge pull request #1368 from ranaroussi/fix/fast-info-camel-case
`fast_info` usability improvements
2023-01-28 22:28:42 +00:00
ValueRaider
a4bdaea888 fast_info: add camelCase, items() & values() 2023-01-28 22:27:51 +00:00
ValueRaider
ac5a9d2793 Merge pull request #1367 from ranaroussi/main
main -> dev
2023-01-27 22:09:59 +00:00
ValueRaider
b17ad32a47 Merge pull request #1366 from ranaroussi/doc/readme-explain-instability
README: comment on instability, tidy Ticker 'Quick start'
2023-01-27 18:31:32 +00:00
ValueRaider
af39855e28 README: comment on instability, tidy Ticker 'Quick start' 2023-01-27 17:36:25 +00:00
ValueRaider
ac6e047f0d Bump version to 0.2.9 2023-01-26 22:21:46 +00:00
ValueRaider
1e24337f29 Bump version to 0.2.8 2023-01-26 22:20:11 +00:00
ValueRaider
2cc82ae12f Merge pull request #1362 from ranaroussi/hotfix/fast-info-bugs
Ticker.fast_info: fix teething bugs
2023-01-26 22:03:06 +00:00
ValueRaider
d11f385049 Make fast_info JSON-serializable via toJSON() 2023-01-26 21:45:53 +00:00
ValueRaider
7377611e1f Add 'get(key, default)' to fast_info 2023-01-26 21:23:31 +00:00
ValueRaider
f3b5fb85c9 Remove exception raise from 'get_shares_full()' 2023-01-26 21:14:48 +00:00
ValueRaider
a4faef83ac 'fast_info' fixes: unusual symbols ; improve migration message ; 'regular_market_previous_close' 2023-01-26 21:02:18 +00:00
ValueRaider
e1184f745b Update yahoo-keys.txt 2023-01-26 17:06:03 +00:00
ValueRaider
fe630008e9 Bump version to 0.2.7 2023-01-26 17:03:00 +00:00
ValueRaider
b43072cf0a Merge pull request #1354 from ranaroussi/hotfix/rename-basic-info
Rename 'basic_info' -> 'fast_info'
2023-01-26 17:00:54 +00:00
ValueRaider
ad3f4cabc9 Improve 'get_shares_full()' error handling 2023-01-26 16:58:26 +00:00
ValueRaider
f70567872c Merge pull request #1353 from ranaroussi/hotfix/smart-decryption
Add decrypt key extraction from JS + GitHub backup
2023-01-26 16:44:23 +00:00
ValueRaider
a8ade72113 Rename 'basic_info' -> 'fast_info' ; Fix info tests 2023-01-26 16:36:25 +00:00
ValueRaider
1dcc8c9c8b Remove dead debug code 2023-01-26 14:57:15 +00:00
ValueRaider
dd5462b307 Add decrypt key extraction from JS + GitHub backup 2023-01-26 14:52:18 +00:00
ValueRaider
e39c03e8e3 Hardcode decrypt keys in GitHub for fix w/o PIP
`yfinance` will query this file via web request as a last resort. Avoids having to release a new PIP version just for a key update.
2023-01-26 14:20:03 +00:00
ValueRaider
9297504b84 Merge pull request #1346 from ranaroussi/main
main -> dev sync
2023-01-25 22:16:22 +00:00
ValueRaider
39c1ecc7a2 Improve price repair - reduce spam, improve data reliability
Extend 'reconstruct groups' to reduce Yahoo spam ; Extend fetch range to avoid first/last day irregularities ; Improve handling of 'max fetch days' Yahoo limit
2023-01-25 14:37:43 +00:00
ValueRaider
eb6d830e2a Fix repair volume=0 ; Tidy code 2023-01-21 23:00:30 +00:00
ValueRaider
2b0ae5a6c1 Remove 'repair_intervals' 2023-01-21 16:58:45 +00:00
ValueRaider
1636839b67 Handle request to reconstruct 1m 2023-01-20 00:13:28 +00:00
ValueRaider
65b97d024b Improve reporting 2023-01-20 00:13:02 +00:00
ValueRaider
197d2968e3 Add 'repair_intervals', rename 'repair'->'repair_prices' 2023-01-19 22:19:16 +00:00
ValueRaider
7460dbea17 If reconstructing 1d interval with 1h, always request prepost 2023-01-19 22:18:46 +00:00
ValueRaider
b49fd797fc Fix & improve price repair
Fix repair calibration & volume=0 repair ; Extend repair to sub-hour ; Avoid attempting repair of mostly-NaN days
2023-01-19 22:18:46 +00:00
ValueRaider
0ba810fda5 Improve 'history_metadata' formatting 2023-01-16 18:30:28 +00:00
526 changed files with 161927 additions and 4252 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -1,42 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
# READ BEFORE POSTING
### Are you up-to-date?
Upgrade to the latest version and confirm the issue/bug is still there.
`$ pip install yfinance --upgrade --no-cache-dir`
Confirm by running:
`import yfinance as yf ; print(yf.__version__)`
and comparing against [PIP](https://pypi.org/project/yfinance/#history).
### Does Yahoo actually have the data?
Are spelling ticker *exactly* same as Yahoo?
Visit `finance.yahoo.com` and confim they have your data. Maybe your ticker was delisted.
### Are you spamming Yahoo?
Yahoo Finance free service has limit on query rate dependent on request - roughly 500/minute for prices, 10/minute for info. Them delaying or blocking your spam is not a bug.
### Still think it's a bug?
Delete this default message and submit your bug report here, providing the following as best you can:
- Simple code that reproduces your problem
- Error message, with traceback if shown
- Info about your system:
- yfinance version
- operating system

89
.github/ISSUE_TEMPLATE/bug_report.yaml vendored Normal file
View File

@@ -0,0 +1,89 @@
name: Bug report
description: Report a bug in our project
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
# !!! IMPORTANT !!! FOLLOW THESE INSTRUCTIONS CAREFULLY !!!
### Are you up-to-date?
Upgrade to the latest version: `$ pip install yfinance --upgrade --no-cache-dir`
Confirm latest version by running: `import yfinance as yf ; print(yf.__version__)` and comparing against [PyPI](https://pypi.org/project/yfinance/#history).
### Does Yahoo actually have the data?
Are you spelling symbol *exactly* same as Yahoo?
Then visit `finance.yahoo.com` and confirm they have the data you want. Maybe your symbol was delisted, or your expectations of `yfinance` are wrong.
### Are you spamming Yahoo?
Yahoo Finance free service has rate-limiting https://github.com/ranaroussi/yfinance/discussions/1513. Once limit hit, Yahoo can delay, block, or return bad data -> not a `yfinance` bug.
### Does issue already exist?
Use the search tool. Don't duplicate existing issues.
- type: markdown
attributes:
value: |
---
## Still think it's a bug?
Provide the following as best you can:
- type: textarea
id: summary
attributes:
label: "Describe bug"
validations:
required: true
- type: textarea
id: code
attributes:
label: "Simple code that reproduces your problem"
description: "Provide a snippet of code that we can copy-paste-run. Wrap code in Python Markdown code blocks for proper formatting (```` ```python ... ``` ````)."
validations:
required: true
- type: textarea
id: debug-log
attributes:
label: "Debug log"
description: "Run code with debug logging enabled - `yf.enable_debug_mode()` - and post the full output. Context: https://github.com/ranaroussi/yfinance/tree/main#logging"
validations:
required: true
- type: textarea
id: bad-data-proof
attributes:
label: "Bad data proof"
description: "If `yfinance` returning bad data, show proof here. Best is screenshot of finance.yahoo.com"
validations:
required: false
- type: input
id: version-yfinance
attributes:
label: "`yfinance` version"
validations:
required: true
- type: input
id: version-python
attributes:
label: "Python version"
validations:
required: false
- type: input
id: os
attributes:
label: "Operating system"
validations:
required: false

View File

@@ -1,14 +0,0 @@
---
name: Feature request
about: Request a new feature
title: ''
labels: ''
assignees: ''
---
**Describe the problem**
**Describe the solution**
**Additional context**

View File

@@ -8,11 +8,11 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: pip install -r requirements.txt
- run: pip install mkdocstrings==0.14.0
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
- run: mkdocs gh-deploy --force

53
.github/workflows/deploy_doc.yml vendored Normal file
View File

@@ -0,0 +1,53 @@
name: Build and Deploy Sphinx Docs
on:
push:
branches:
- docs_markdown
jobs:
build:
runs-on: ubuntu-latest
env:
BUILD_DIR: "doc/_build/html"
DEPLOY_BRANCH: "docs_markdown"
DEPLOY_DIR: "docs"
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install Sphinx==8.0.2 pydata-sphinx-theme==0.15.4 Jinja2==3.1.4 sphinx-copybutton==0.5.2
- name: Build Sphinx documentation
run: |
sphinx-build -b html doc/source ${{ env.BUILD_DIR }} -v
- name: List generated HTML files
run: |
ls -l -R ${{ env.BUILD_DIR }}
- name: Publish to the Deploy Branch
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git checkout ${{ env.DEPLOY_BRANCH }}
mkdir -p ${{ env.DEPLOY_DIR }}
rm -rf ${{ env.DEPLOY_DIR }}/*
cp -r ${{ env.BUILD_DIR }}/* ${{ env.DEPLOY_DIR }}/
touch ${{ env.DEPLOY_DIR }}/.nojekyll
git add -f ${{ env.DEPLOY_DIR }}
git commit -m "Update documentation"
git push origin ${{ env.DEPLOY_BRANCH }}

27
.github/workflows/pyright.yml vendored Normal file
View File

@@ -0,0 +1,27 @@
name: Pyright
on:
pull_request:
branches:
- master
- main
- dev
jobs:
pyright:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyright
- name: Run Pyright
run: pyright . --level error

View File

@@ -13,9 +13,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies

13
.github/workflows/ruff.yml vendored Normal file
View File

@@ -0,0 +1,13 @@
name: Ruff
on:
pull_request:
branches:
- master
- main
- dev
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: chartboost/ruff-action@v1

9
.gitignore vendored
View File

@@ -4,11 +4,13 @@ dist
yfinance.egg-info
*.pyc
.coverage
.idea/
.vscode/
build/
*.html
*.css
*.png
test.ipynb
# Environments
.env
@@ -16,3 +18,10 @@ build/
env/
venv/
ENV/
# Documentation
/doc/build/
/doc/_build/
/doc/source/reference/api
!yfinance.css
!/doc/source/development/assets/branches.png

View File

@@ -1,6 +1,268 @@
Change Log
===========
0.2.46
------
Fix regression in 0.2.45 #2094
0.2.45
------
Features:
- Screener #2066 @ericpien
Fixes
- Tickers keyerror #2068 @antoniouaa
- IndexError in some history() debug messages #2087
- improve dividend repair #2090
Maintenance
- fix unit tests contextual imports #2067
- fix typos #2072 @algonell
- add Pyright type checking #2059 @marco-carvalho
0.2.44
------
Features:
- fetch funds #2041
- fetch sector & industry #2058
Fixes:
- improve dividend repair #2062
0.2.43
------
Fix price-repair bug introduced in 0.2.42 #2036
0.2.42
------
Features:
- fetch SEC filings #2009
- fetch analysis #2023 @Fidasek009
- price repair extended to dividends & adjust #2031
Fixes:
- fix error on empty options chain #1995 @stevenbischoff
- use dict.get() to safely access key in Holders #2013 @ericpien
- fix datetime conversion with mixed timezones when ignore_tz is False #2016 @mreiche
- handle faulty response object when getting news. #2021 @ericpien
Maintenance:
- prices: improve exceptions and logging #2000
0.2.41
------
Improvements:
- add keys to financials #1965 #1985
- fetch Sustainability #1959
- improve price-repair-zeroes #1990
Fixes (prices):
- fetching when period='max' #1967
- metadata: Fix '1wk is invalid' & repeated calls #1970
- Pandas warnings #1955 #1981
- price repair syntax errors #1989
Maintenance:
- deprecate Ticker.earnings #1977
0.2.40
------
Fix typo in 0.2.39 c7af213
0.2.39
------
Fixes:
- Fix switching session from/to requests_cache #1930
Price repair:
- Fix potential for price repair to discard price=0 rows #1874
- Don't price-repair FX volume=0, is normal #1920
- Improve 'sudden change' repair for splits & currency #1931
Information:
- Fix help(yf.download) not showing the information about the function #1913 @vittoboa
- Add more specific error throwing based on PR 1918 #1928 @elibroftw @marcofognog
Maintenance:
- Replace dead 'appdirs' package with 'platformdirs' #1896
- Deprecate 'pandas_datareader', remove a deprecated argument #1897
- Fix: datetime.datetime.utcnow() is deprecated ... #1922
0.2.38
------
Fix holders & insiders #1908
0.2.37
------
Small fixes:
- Fix Pandas warnings #1838 #1844
- Fix price repair bug, typos, refactor #1866 #1865 #1849
- Stop disabling logging #1841
0.2.36
------
Small fixes:
- Update README.md for better copy-ability #1823
- Name download() column levels #1795
- Fix history(keepna=False) when repair=True #1824
- Replace empty list with empty pd.Series #1724
- Handle peewee with old sqlite #1827
- Fix JSON error handling #1830 #1833
0.2.35
------
Internal fixes for 0.2.34
0.2.34
------
Features:
- Add Recommendations Trend Summary #1754
- Add Recommendation upgrades & downgrades #1773
- Add Insider Roster & Transactions #1772
- Moved download() progress bar to STDERR #1776
- PIP optional dependencies #1771
- Set sensible min versions for optional 'nospam' reqs #1807
Fixes
- Fix download() DatetimeIndex on invalid symbols #1779
- Fix invalid date entering cache DB #1796
- Fix Ticker.calendar fetch #1790
- Fixed adding complementary to info #1774
- Ticker.earnings_dates: fix warning "Value 'NaN' has dtype incompatible with float64" #1810
- Minor fixes for price repair and related tests #1768
- Fix price repair div adjust #1798
- Fix 'raise_errors' argument ignored in Ticker.history() #1806
Maintenance
- Fix regression: _get_ticker_tz() args were being swapped. Improve its unit test #1793
- Refactor Ticker proxy #1711
- Add Ruff linter checks #1756
- Resolve Pandas FutureWarnings #1766
0.2.33
------
Cookie fixes:
- fix backup strategy #1759
- fix Ticker(ISIN) #1760
0.2.32
------
Add cookie & crumb to requests #1657
0.2.31
------
- Fix TZ cache exception blocking import #1705 #1709
- Fix merging pre-market events with intraday prices #1703
0.2.30
------
- Fix OperationalError #1698
0.2.29
------
- Fix pandas warning when retrieving quotes. #1672
- Replace sqlite3 with peewee for 100% thread-safety #1675
- Fix merging events with intraday prices #1684
- Fix error when calling enable_debug_mode twice #1687
- Price repair fixes #1688
0.2.28
------
- Fix TypeError: 'FastInfo' object is not callable #1636
- Improve & fix price repair #1633 #1660
- option_chain() also return underlying data #1606
0.2.27
------
Bug fixes:
- fix merging 1d-prices with out-of-range divs/splits #1635
- fix multithread error 'tz already in cache' #1648
0.2.26
------
Proxy improvements
- bug fixes #1371
- security fix #1625
0.2.25
------
Fix single ISIN as ticker #1611
Fix 'Only 100 years allowed' error #1576
0.2.24
------
Fix info[] missing values #1603
0.2.23
------
Fix 'Unauthorized' error #1595
0.2.22
------
Fix unhandled 'sqlite3.DatabaseError' #1574
0.2.21
------
Fix financials tables #1568
Price repair update: fix Yahoo messing up dividend and split adjustments #1543
Fix logging behaviour #1562
Fix merge future div/split into prices #1567
0.2.20
------
Switch to `logging` module #1493 #1522 #1541
Price history:
- optimise #1514
- fixes #1523
- fix TZ-cache corruption #1528
0.2.18
------
Fix 'fast_info' error '_np not found' #1496
Fix bug in timezone cache #1498
0.2.17
------
Fix prices error with Pandas 2.0 #1488
0.2.16
------
Fix 'fast_info deprecated' msg appearing at Ticker() init
0.2.15
------
Restore missing Ticker.info keys #1480
0.2.14
------
Fix Ticker.info dict by fetching from API #1461
0.2.13
------
Price bug fixes:
- fetch big-interval with Capital Gains #1455
- merging dividends & splits with prices #1452
0.2.12
------
Disable annoying 'backup decrypt' msg
0.2.11
------
Fix history_metadata accesses for unusual symbols #1411
0.2.10
------
General
- allow using sqlite3 < 3.8.2 #1380
- add another backup decrypt option #1379
Prices
- restore original download() timezone handling #1385
- fix & improve price repair #1289 2a2928b 86d6acc
- drop intraday intervals if in post-market but prepost=False #1311
Info
- fast_info improvements:
- add camelCase keys, add dict functions values() & items() #1368
- fix fast_info["previousClose"] #1383
- catch TypeError Exception #1397
0.2.9
-----
- Fix fast_info bugs #1362
0.2.7
-----
- Fix Yahoo decryption, smarter this time #1353
- Rename basic_info -> fast_info #1354
0.2.6
-----
- Fix Ticker.basic_info lazy-loading #1342
@@ -114,7 +376,7 @@ Jumping to 0.2 for this big update. 0.1.* will continue to receive bug-fixes
- Fix timezone handling
- Fix handling of missing data
- Clean&format earnings_dates table
- Add ``.get_earnings_dates()`` to retreive earnings calendar
- Add ``.get_earnings_dates()`` to retrieve earnings calendar
- Added ``.get_earnings_history()`` to fetch earnings data
0.1.70
@@ -426,7 +688,7 @@ Jumping to 0.2 for this big update. 0.1.* will continue to receive bug-fixes
- Removed 5 second wait for every failed fetch
- Reduced TTL for Yahoo!'s cookie
- Keeps track of failed downloads and tries to re-download all failed downloads one more time before giving up
- Added progress bar (can be turned off useing ``progress=False``)
- Added progress bar (can be turned off using ``progress=False``)
0.0.7
-------

15
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,15 @@
# Code of Conduct
## Submitting a new issue
* Search through existing Issues and Discussions, in case your issue already exists and a solution is being developed.
* Ensure you read & follow the template form.
* Consider you may be the best person to investigate and fix.
## Contributing to an existing Issue
* Read the entire thread.
* Ensure your comment is contributing something new/useful. Remember you can simply react to other comments.
* Be concise:
- use the formatting options
- if replying to a big comment, instead of quoting it, link to it

298
README.md
View File

@@ -28,7 +28,6 @@ Yahoo! finance API is intended for personal use only.**
<a target="new" href="https://pypi.python.org/pypi/yfinance"><img border=0 src="https://img.shields.io/pypi/v/yfinance.svg?maxAge=60%" alt="PyPi version"></a>
<a target="new" href="https://pypi.python.org/pypi/yfinance"><img border=0 src="https://img.shields.io/pypi/status/yfinance.svg?maxAge=60" alt="PyPi status"></a>
<a target="new" href="https://pypi.python.org/pypi/yfinance"><img border=0 src="https://img.shields.io/pypi/dm/yfinance.svg?maxAge=2592000&label=installs&color=%2327B1FF" alt="PyPi downloads"></a>
<a target="new" href="https://travis-ci.com/github/ranaroussi/yfinance"><img border=0 src="https://img.shields.io/travis/ranaroussi/yfinance/main.svg?maxAge=1" alt="Travis-CI build status"></a>
<a target="new" href="https://www.codefactor.io/repository/github/ranaroussi/yfinance"><img border=0 src="https://www.codefactor.io/repository/github/ranaroussi/yfinance/badge" alt="CodeFactor"></a>
<a target="new" href="https://github.com/ranaroussi/yfinance"><img border=0 src="https://img.shields.io/github/stars/ranaroussi/yfinance.svg?style=social&label=Star&maxAge=60" alt="Star this repo"></a>
<a target="new" href="https://twitter.com/aroussi"><img border=0 src="https://img.shields.io/twitter/follow/aroussi.svg?style=social&label=Follow&maxAge=60" alt="Follow me on twitter"></a>
@@ -36,261 +35,16 @@ Yahoo! finance API is intended for personal use only.**
**yfinance** offers a threaded and Pythonic way to download market data from [Yahoo!Ⓡ finance](https://finance.yahoo.com).
→ Check out this [Blog post](https://aroussi.com/#post/python-yahoo-finance) for a detailed tutorial with code examples.
[Changelog »](https://github.com/ranaroussi/yfinance/blob/main/CHANGELOG.rst)
---
## What's new in version 0.2
- Optimised web scraping
- All 3 financials tables now match website so expect keys to change. If you really want old tables, use [`Ticker.get_[income_stmt|balance_sheet|cashflow](legacy=True, ...)`](https://github.com/ranaroussi/yfinance/blob/85783da515761a145411d742c2a8a3c1517264b0/yfinance/base.py#L968)
- price data improvements: fix bug NaN rows with dividend; new repair feature for missing or 100x prices `download(repair=True)`; new attribute `Ticker.history_metadata`
[See release notes for full list of changes](https://github.com/ranaroussi/yfinance/releases/tag/0.2.1)
## Quick Start
### The Ticker module
The `Ticker` module, which allows you to access ticker data in a more Pythonic way:
```python
import yfinance as yf
msft = yf.Ticker("MSFT")
# fast access to subset of stock info
msft.basic_info
# slow access to all stock info
msft.info
# get historical market data
hist = msft.history(period="max")
# show meta information about the history (requires history() to be called first)
msft.history_metadata
# show actions (dividends, splits, capital gains)
msft.actions
# show dividends
msft.dividends
# show splits
msft.splits
# show capital gains (for mutual funds & etfs)
msft.capital_gains
# show share count
msft.shares
msft.get_shares_full()
# show financials:
# - income statement
msft.income_stmt
msft.quarterly_income_stmt
# - balance sheet
msft.balance_sheet
msft.quarterly_balance_sheet
# - cash flow statement
msft.cashflow
msft.quarterly_cashflow
# see `Ticker.get_income_stmt()` for more options
# show major holders
msft.major_holders
# show institutional holders
msft.institutional_holders
# show mutualfund holders
msft.mutualfund_holders
# show earnings
msft.earnings
msft.quarterly_earnings
# show sustainability
msft.sustainability
# show analysts recommendations
msft.recommendations
msft.recommendations_summary
# show analysts other work
msft.analyst_price_target
msft.revenue_forecasts
msft.earnings_forecasts
msft.earnings_trend
# show next event (earnings, etc)
msft.calendar
# Show future and historic earnings dates, returns at most next 4 quarters and last 8 quarters by default.
# Note: If more are needed use msft.get_earnings_dates(limit=XX) with increased limit argument.
msft.earnings_dates
# show ISIN code - *experimental*
# ISIN = International Securities Identification Number
msft.isin
# show options expirations
msft.options
# show news
msft.news
# get option chain for specific expiration
opt = msft.option_chain('YYYY-MM-DD')
# data available via: opt.calls, opt.puts
```
If you want to use a proxy server for downloading data, use:
```python
import yfinance as yf
msft = yf.Ticker("MSFT")
msft.history(..., proxy="PROXY_SERVER")
msft.get_actions(proxy="PROXY_SERVER")
msft.get_dividends(proxy="PROXY_SERVER")
msft.get_splits(proxy="PROXY_SERVER")
msft.get_capital_gains(proxy="PROXY_SERVER")
msft.get_balance_sheet(proxy="PROXY_SERVER")
msft.get_cashflow(proxy="PROXY_SERVER")
msft.option_chain(..., proxy="PROXY_SERVER")
...
```
To use a custom `requests` session (for example to cache calls to the
API or customize the `User-agent` header), pass a `session=` argument to
the Ticker constructor.
```python
import requests_cache
session = requests_cache.CachedSession('yfinance.cache')
session.headers['User-agent'] = 'my-program/1.0'
ticker = yf.Ticker('msft', session=session)
# The scraped response will be stored in the cache
ticker.actions
```
To initialize multiple `Ticker` objects, use
```python
import yfinance as yf
tickers = yf.Tickers('msft aapl goog')
# access each ticker using (example)
tickers.tickers['MSFT'].info
tickers.tickers['AAPL'].history(period="1mo")
tickers.tickers['GOOG'].actions
```
### Fetching data for multiple tickers
```python
import yfinance as yf
data = yf.download("SPY AAPL", start="2017-01-01", end="2017-04-30")
```
I've also added some options to make life easier :)
```python
data = yf.download( # or pdr.get_data_yahoo(...
# tickers list or string as well
tickers = "SPY AAPL MSFT",
# use "period" instead of start/end
# valid periods: 1d,5d,1mo,3mo,6mo,1y,2y,5y,10y,ytd,max
# (optional, default is '1mo')
period = "ytd",
# fetch data by interval (including intraday if period < 60 days)
# valid intervals: 1m,2m,5m,15m,30m,60m,90m,1h,1d,5d,1wk,1mo,3mo
# (optional, default is '1d')
interval = "5d",
# Whether to ignore timezone when aligning ticker data from
# different timezones. Default is False.
ignore_tz = False,
# group by ticker (to access via data['SPY'])
# (optional, default is 'column')
group_by = 'ticker',
# adjust all OHLC automatically
# (optional, default is False)
auto_adjust = True,
# attempt repair of missing data or currency mixups e.g. $/cents
repair = False,
# download pre/post regular market hours data
# (optional, default is False)
prepost = True,
# use threads for mass downloading? (True/False/Integer)
# (optional, default is True)
threads = True,
# proxy URL scheme use use when downloading?
# (optional, default is None)
proxy = None
)
```
### Timezone cache store
When fetching price data, all dates are localized to stock exchange timezone.
But timezone retrieval is relatively slow, so yfinance attemps to cache them
in your users cache folder.
You can direct cache to use a different location with `set_tz_cache_location()`:
```python
import yfinance as yf
yf.set_tz_cache_location("custom/cache/location")
...
```
### Managing Multi-Level Columns
The following answer on Stack Overflow is for [How to deal with
multi-level column names downloaded with
yfinance?](https://stackoverflow.com/questions/63107801)
- `yfinance` returns a `pandas.DataFrame` with multi-level column
names, with a level for the ticker and a level for the stock price
data
- The answer discusses:
- How to correctly read the the multi-level columns after
saving the dataframe to a csv with `pandas.DataFrame.to_csv`
- How to download single or multiple tickers into a single
dataframe with single level column names and a ticker column
---
## `pandas_datareader` override
If your code uses `pandas_datareader` and you want to download data
faster, you can "hijack" `pandas_datareader.data.get_data_yahoo()`
method to use **yfinance** while making sure the returned data is in the
same format as **pandas\_datareader**'s `get_data_yahoo()`.
```python
from pandas_datareader import data as pdr
import yfinance as yf
yf.pdr_override() # <== that's all it takes :-)
# download dataframe
data = pdr.get_data_yahoo("SPY", start="2017-01-01", end="2017-04-30")
```
---
## Main Features
- `Ticker` module: Class for accessing single ticker data.
- `Tickers` module: Class for handling multiple tickers.
- `download` Efficiently download market data for multiple tickers.
- `Sector` and `Industry` modules : Classes for accessing sector and industry information.
- Market Screening: `EquityQuery` and `Screener` to build query and screen the market.
- Caching and Smart Scraping
## Documentation
The official documentation is available on [ranaroussi.github.io/yfinance](https://ranaroussi.github.io/yfinance/index.html)
## Installation
@@ -300,27 +54,21 @@ Install `yfinance` using `pip`:
$ pip install yfinance --upgrade --no-cache-dir
```
To install `yfinance` using `conda`, see
[this](https://anaconda.org/ranaroussi/yfinance).
[With Conda](https://anaconda.org/ranaroussi/yfinance).
### Requirements
To install with optional dependencies, replace `optional` with: `nospam` for [caching-requests](#smarter-scraping), `repair` for [price repair](https://github.com/ranaroussi/yfinance/wiki/Price-repair), or `nospam,repair` for both:
- [Python](https://www.python.org) \>= 2.7, 3.4+
- [Pandas](https://github.com/pydata/pandas) \>= 1.3.0
- [Numpy](http://www.numpy.org) \>= 1.16.5
- [requests](http://docs.python-requests.org/en/master) \>= 2.26
- [lxml](https://pypi.org/project/lxml) \>= 4.9.1
- [appdirs](https://pypi.org/project/appdirs) \>= 1.4.4
- [pytz](https://pypi.org/project/pytz) \>=2022.5
- [frozendict](https://pypi.org/project/frozendict) \>= 2.3.4
- [beautifulsoup4](https://pypi.org/project/beautifulsoup4) \>= 4.11.1
- [html5lib](https://pypi.org/project/html5lib) \>= 1.1
- [cryptography](https://pypi.org/project/cryptography) \>= 3.3.2
``` {.sourceCode .bash}
$ pip install "yfinance[optional]"
```
### Optional (if you want to use `pandas_datareader`)
[Required dependencies](./requirements.txt) , [all dependencies](./setup.py#L62).
- [pandas\_datareader](https://github.com/pydata/pandas-datareader)
\>= 0.4.0
The list of changes can be found in the [changelog](https://github.com/ranaroussi/yfinance/blob/main/CHANGELOG.rst)
## Developers: want to contribute?
`yfinance` relies on community to investigate bugs and contribute code. Developer guide: https://github.com/ranaroussi/yfinance/discussions/1084
---
@@ -336,12 +84,12 @@ intended for research and educational purposes. You should refer to Yahoo!'s ter
([here](https://policies.yahoo.com/us/en/yahoo/terms/product-atos/apiforydn/index.htm),
[here](https://legal.yahoo.com/us/en/yahoo/terms/otos/index.html), and
[here](https://policies.yahoo.com/us/en/yahoo/terms/index.htm)) for
detailes on your rights to use the actual data downloaded.
details on your rights to use the actual data downloaded.
---
### P.S.
Please drop me an note with any feedback you have.
Please drop me a note with any feedback you have.
**Ran Aroussi**

20
doc/Makefile Normal file
View File

@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

35
doc/make.bat Normal file
View File

@@ -0,0 +1,35 @@
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)
if "%1" == "" goto help
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd

View File

@@ -0,0 +1,4 @@
/* Hide the "Section Navigation" title */
p.bd-links__title {
display: none;
}

View File

@@ -0,0 +1,30 @@
{{ fullname | escape | underline}}
.. currentmodule:: {{ module }}
.. autoclass:: {{ objname }}
{% block attributes %}
{% if attributes %}
.. rubric:: Attributes
.. autosummary::
:toctree: attributes
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
{% block methods %}
{% if methods %}
.. rubric:: Methods
.. autosummary::
:toctree: methods
{% for item in methods %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

45
doc/source/conf.py Normal file
View File

@@ -0,0 +1,45 @@
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = 'yfinance - market data downloader'
copyright = '2017-2019 Ran Aroussi'
author = 'Ran Aroussi'
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.napoleon',
"sphinx.ext.githubpages",
"sphinx.ext.autosectionlabel",
"sphinx.ext.autosummary",
"sphinx_copybutton"]
templates_path = ['_templates']
exclude_patterns = []
autoclass_content = 'both'
autosummary_generate = True
autodoc_default_options = {
'exclude-members': '__init__'
}
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_title = 'yfinance'
html_theme = 'pydata_sphinx_theme'
html_theme_options = {
"github_url": "https://github.com/ranaroussi/yfinance",
"navbar_align": "left"
}
html_static_path = ['_static']
html_css_files = ['yfinance.css']

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@@ -0,0 +1,109 @@
********************************
Contributiong to yfinance
********************************
`yfinance` relies on the community to investigate bugs and contribute code. Heres how you can help:
Contributing
------------
1. Fork the repository on GitHub.
2. Clone your forked repository:
.. code-block:: bash
git clone https://github.com/your-username/yfinance.git
3. Create a new branch for your feature or bug fix:
.. code-block:: bash
git checkout -b feature-branch-name
4. Make your changes, commit them, and push your branch to GitHub. To keep the commit history and `network graph <https://github.com/ranaroussi/yfinance/network>`_ compact:
Use short summaries for commits
.. code-block:: shell
git commit -m "short summary" -m "full commit message"
**Squash** tiny or negligible commits with meaningful ones.
.. code-block:: shell
git rebase -i HEAD~2
git push --force-with-lease origin <branch-name>
5. Open a pull request on the `yfinance` GitHub page.
For more information, see the `Developer Guide <https://github.com/ranaroussi/yfinance/discussions/1084>`_.
Branches
---------
To support rapid development without breaking stable versions, this project uses a two-layer branch model:
.. image:: assets/branches.png
:alt: Branching Model
`Inspiration <https://miro.medium.com/max/700/1*2YagIpX6LuauC3ASpwHekg.png>`_
- **dev**: New features and some bug fixes are merged here. This branch allows collective testing, conflict resolution, and further stabilization before merging into the stable branch.
- **main**: Stable branch where PIP releases are created.
By default, branches target **main**, but most contributions should target **dev**.
**Exceptions**:
Direct merges to **main** are allowed if:
- `yfinance` is massively broken
- Part of `yfinance` is broken, and the fix is simple and isolated
Unit Tests
----------
Tests are written using Pythons `unittest` module. Here are some ways to run tests:
- **Run all price tests**:
.. code-block:: shell
python -m unittest tests.test_prices
- **Run a subset of price tests**:
.. code-block:: shell
python -m unittest tests.test_prices.TestPriceRepair
- **Run a specific test**:
.. code-block:: shell
python -m unittest tests.test_prices.TestPriceRepair.test_ticker_missing
- **Run all tests**:
.. code-block:: shell
python -m unittest discover -s tests
Rebasing
--------------
If asked to move your branch from **main** to **dev**:
1. Ensure all relevant branches are pulled.
2. Run:
.. code-block:: shell
git checkout <your-branch>
git rebase --onto dev main <branch-name>
git push --force-with-lease origin <branch-name>
Running the GitHub Version of yfinance
--------------------------------------
To download and run a GitHub version of `yfinance`, refer to `GitHub discussion <https://github.com/ranaroussi/yfinance/discussions/1080>`_

View File

@@ -0,0 +1,46 @@
*************************************
Contribution to the documentation
*************************************
.. contents:: Documentation:
:local:
About documentation
------------------------
* yfinance documentation is written in reStructuredText (rst) and built using Sphinx.
* The documentation file is in `doc/source/..`.
* Most of the notes under API References read from class and methods docstrings. These documentations, found in `doc/source/reference/api` is autogenerated by Sphinx and not included in git.
Building documentation locally
-------------------------------
To build the documentation locally, follow these steps:
1. **Install Required Dependencies**:
* Make sure `Sphinx` and any other dependencies are installed. If a `requirements.txt` file is available, you can install dependencies by running:
.. code-block:: console
pip install -r requirements.txt
2. **Build with Sphinx**:
* After dependencies are installed, use the sphinx-build command to generate HTML documentation.
* Go to `doc/` directory Run:
.. code-block:: console
make clean && make html
3. **View Documentation Locally**:
* Open `doc/build/html/index.html` in the browser to view the generated documentation.
Building documentation on main
-------------------------------
The documentation updates are built on merge to `main` branch. This is done via GitHub Actions workflow based on `/yfinance/.github/workflows/deploy_doc.yml`.
1. Reivew the changes locally and push to `dev`.
2. When `dev` gets merged to `main`, GitHub Actions workflow is automated to build documentation.

View File

@@ -0,0 +1,9 @@
Development
===============================
.. toctree::
:maxdepth: 1
contributing
documentation
reporting_bug

View File

@@ -0,0 +1,5 @@
********************************
Reporting a Bug
********************************
Open a new issue on our `GitHub <https://github.com/ranaroussi/yfinance/issues>`_.

View File

@@ -0,0 +1,9 @@
Getting Started
===============
.. toctree::
:maxdepth: 1
installation
quick_start
legal

View File

@@ -0,0 +1,17 @@
********************
Installation Guide
********************
Install `yfinance` using `pip`:
.. code-block:: bash
$ pip install yfinance --upgrade --no-cache-dir
To install with optional dependencies, replace `optional` with: `nospam` for `caching-requests <https://github.com/ranaroussi/yfinance?tab=readme-ov-file#smarter-scraping>`_, `repair` for `price repair <https://github.com/ranaroussi/yfinance/wiki/Price-repair>`_, or `nospam`, `repair` for both:
.. code-block:: bash
$ pip install "yfinance[optional]"
For required dependencies, check out the `requirements file <./requirements.txt>`_, and for all dependencies, see the `setup.py file <./setup.py#L62>`_.

View File

@@ -0,0 +1,12 @@
********************
Legal Information
********************
yfinance is distributed under the Apache Software License. See the `LICENSE.txt <../../../../LICENSE.txt>`_ file for details.
Again, yfinance is **not** affiliated, endorsed, or vetted by Yahoo, Inc. It's an open-source tool that uses Yahoo's publicly available APIs, and is intended for research and educational purposes.
Refer to Yahoo!'s terms of use:
- `API Terms <https://policies.yahoo.com/us/en/yahoo/terms/product-atos/apiforydn/index.htm>`_
- `Yahoo Terms <https://legal.yahoo.com/us/en/yahoo/terms/otos/index.html>`_

View File

@@ -0,0 +1,30 @@
********************
Quick Start
********************
The Ticker module allows you to access ticker data in a more Pythonic way:
.. code-block:: python
import yfinance as yf
msft = yf.Ticker("MSFT")
# get all stock info
msft.info
# get historical market data
hist = msft.history(period="1mo")
# show actions (dividends, splits, capital gains)
msft.actions
msft.dividends
msft.splits
To work with multiple tickers, use:
.. code-block:: python
tickers = yf.Tickers('msft aapl goog')
tickers.tickers['MSFT'].info
tickers.tickers['AAPL'].history(period="1mo")

30
doc/source/index.rst Normal file
View File

@@ -0,0 +1,30 @@
yfinance documentation
==============================================
Download Market Data from Yahoo! Finance's API
------------------------------------------------
.. admonition:: IMPORTANT LEGAL DISCLAIMER
**Yahoo!, Y!Finance, and Yahoo! finance are registered trademarks of Yahoo, Inc.**
yfinance is **not** affiliated, endorsed, or vetted by Yahoo, Inc. It's
an open-source tool that uses Yahoo's publicly available APIs, and is
intended for research and educational purposes.
**You should refer to Yahoo!'s terms of use**
(`here <https://policies.yahoo.com/us/en/yahoo/terms/product-atos/apiforydn/index.htm>`__),
(`here <https://legal.yahoo.com/us/en/yahoo/terms/otos/index.html>`__),
and (`here <https://policies.yahoo.com/us/en/yahoo/terms/index.htm>`__)
for details on your rights to use the actual data downloaded.
Remember - the Yahoo! finance API is intended for personal use only.
.. toctree::
:maxdepth: 3
:hidden:
:titlesonly:
getting_started/index
user_guide/index
reference/index
development/index

View File

@@ -0,0 +1,2 @@
import yfinance as yf
data = yf.download("SPY AAPL", period="1mo")

View File

@@ -0,0 +1,18 @@
import yfinance as yf
spy = yf.Ticker('SPY')
data = spy.funds_data
# show fund description
data.description
# show operational information
data.fund_overview
data.fund_operations
# show holdings related information
data.asset_classes
data.top_holdings
data.equity_holdings
data.bond_holdings
data.bond_ratings
data.sector_weightings

View File

@@ -0,0 +1,13 @@
import yfinance as yf
msft = yf.Ticker("MSFT")
msft.history(..., proxy="PROXY_SERVER")
msft.get_actions(proxy="PROXY_SERVER")
msft.get_dividends(proxy="PROXY_SERVER")
msft.get_splits(proxy="PROXY_SERVER")
msft.get_capital_gains(proxy="PROXY_SERVER")
msft.get_balance_sheet(proxy="PROXY_SERVER")
msft.get_cashflow(proxy="PROXY_SERVER")
msft.option_chain(..., proxy="PROXY_SERVER")
...

View File

@@ -0,0 +1,25 @@
import yfinance as yf
tech = yf.Sector('technology')
software = yf.Industry('software-infrastructure')
# Common information
tech.key
tech.name
tech.symbol
tech.ticker
tech.overview
tech.top_companies
tech.research_reports
# Sector information
tech.top_etfs
tech.top_mutual_funds
tech.industries
# Industry information
software.sector_key
software.sector_name
software.top_performing_companies
software.top_growth_companies

View File

@@ -0,0 +1,11 @@
import yfinance as yf
# Ticker to Sector and Industry
msft = yf.Ticker('MSFT')
tech = yf.Sector(msft.info.get('sectorKey'))
software = yf.Industry(msft.info.get('industryKey'))
# Sector and Industry to Ticker
tech_ticker = tech.ticker
tech_ticker.info
software_ticker = software.ticker
software_ticker.history()

View File

@@ -0,0 +1,77 @@
import yfinance as yf
msft = yf.Ticker("MSFT")
# get all stock info
msft.info
# get historical market data
hist = msft.history(period="1mo")
# show meta information about the history (requires history() to be called first)
msft.history_metadata
# show actions (dividends, splits, capital gains)
msft.actions
msft.dividends
msft.splits
msft.capital_gains # only for mutual funds & etfs
# show share count
msft.get_shares_full(start="2022-01-01", end=None)
# show financials:
msft.calendar
msft.sec_filings
# - income statement
msft.income_stmt
msft.quarterly_income_stmt
# - balance sheet
msft.balance_sheet
msft.quarterly_balance_sheet
# - cash flow statement
msft.cashflow
msft.quarterly_cashflow
# see `Ticker.get_income_stmt()` for more options
# show holders
msft.major_holders
msft.institutional_holders
msft.mutualfund_holders
msft.insider_transactions
msft.insider_purchases
msft.insider_roster_holders
msft.sustainability
# show recommendations
msft.recommendations
msft.recommendations_summary
msft.upgrades_downgrades
# show analysts data
msft.analyst_price_targets
msft.earnings_estimate
msft.revenue_estimate
msft.earnings_history
msft.eps_trend
msft.eps_revisions
msft.growth_estimates
# Show future and historic earnings dates, returns at most next 4 quarters and last 8 quarters by default.
# Note: If more are needed use msft.get_earnings_dates(limit=XX) with increased limit argument.
msft.earnings_dates
# show ISIN code - *experimental*
# ISIN = International Securities Identification Number
msft.isin
# show options expirations
msft.options
# show news
msft.news
# get option chain for specific expiration
opt = msft.option_chain('YYYY-MM-DD')
# data available via: opt.calls, opt.puts

View File

@@ -0,0 +1,8 @@
import yfinance as yf
tickers = yf.Tickers('msft aapl goog')
# access each ticker using (example)
tickers.tickers['MSFT'].info
tickers.tickers['AAPL'].history(period="1mo")
tickers.tickers['GOOG'].actions

View File

@@ -0,0 +1,33 @@
=======================
API Reference
=======================
Overview
--------
The `yfinance` package provides easy access to Yahoo! Finance's API to retrieve market data. It includes classes and functions for downloading historical market data, accessing ticker information, managing cache, and more.
Public API
==========
The following are the publicly available classes, and functions exposed by the `yfinance` package:
- :attr:`Ticker <yfinance.Ticker>`: Class for accessing single ticker data.
- :attr:`Tickers <yfinance.Tickers>`: Class for handling multiple tickers.
- :attr:`Sector <yfinance.Sector>`: Domain class for accessing sector information.
- :attr:`Industry <yfinance.Industry>`: Domain class for accessing industry information.
- :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.
.. toctree::
:maxdepth: 1
:hidden:
yfinance.ticker_tickers
yfinance.sector_industry
yfinance.functions

View File

@@ -0,0 +1,51 @@
=========================
Functions and Utilities
=========================
.. currentmodule:: yfinance
Download Market Data
~~~~~~~~~~~~~~~~~~~~~
The `download` function allows you to retrieve market data for multiple tickers at once.
.. autosummary::
:toctree: api/
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.
.. autosummary::
:toctree: api/
enable_debug_mode
Set Timezone Cache Location
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sets the cache location for timezone data.
.. autosummary::
:toctree: api/
set_tz_cache_location

View File

@@ -0,0 +1,32 @@
=======================
Sector and Industry
=======================
.. currentmodule:: yfinance
Class
------------
The `Sector` and `Industry` modules provide access to the Sector and Industry information.
.. autosummary::
:toctree: api/
:recursive:
Sector
Industry
.. seealso::
:attr:`Sector.industries <yfinance.Sector.industries>`
Map of sector and industry
Sample Code
------------
To initialize, use the relevant sector or industry key as below.
.. literalinclude:: examples/sector_industry.py
:language: python
The modules can be chained with Ticker as below.
.. literalinclude:: examples/sector_industry_ticker.py
:language: python

View File

@@ -0,0 +1,46 @@
=====================
Ticker and Tickers
=====================
.. currentmodule:: yfinance
Class
------------
The `Ticker` module, allows you to access ticker data in a Pythonic way.
.. autosummary::
:toctree: api/
Ticker
Tickers
Sample Code
------------
The `Ticker` module, allows you to access ticker data in a Pythonic way.
.. literalinclude:: examples/ticker.py
:language: python
To initialize multiple `Ticker` objects, use
.. literalinclude:: examples/tickers.py
:language: python
For tickers that are ETFs/Mutual Funds, `Ticker.funds_data` provides access to fund related data.
Funds' Top Holdings and other data with category average is returned as `pd.DataFrame`.
.. literalinclude:: examples/funds_data.py
:language: python
If you want to use a proxy server for downloading data, use:
.. literalinclude:: examples/proxy.py
:language: python
To initialize multiple `Ticker` objects, use `Tickers` module
.. literalinclude:: examples/tickers.py
:language: python

View File

@@ -0,0 +1,11 @@
User Guide
==========
.. toctree::
:maxdepth: 1
logging
proxy
smart_scraping
persistent_cache
multi_level_columns

View File

@@ -0,0 +1,11 @@
Logging in yfinance
===================
`yfinance` uses the `logging` module to handle messages. By default, only errors are logged.
If debugging, you can switch to debug mode with custom formatting using:
.. code-block:: python
import yfinance as yf
yf.enable_debug_mode()

View File

@@ -0,0 +1,13 @@
******************************
Managing Multi-Level Columns
******************************
The following answer on Stack Overflow is for `How to deal with
multi-level column names downloaded with yfinance? <https://stackoverflow.com/questions/63107801>`_
- `yfinance` returns a `pandas.DataFrame` with multi-level column names, with a level for the ticker and a level for the stock price data
The answer discusses:
- How to correctly read the the multi-level columns after saving the dataframe to a csv with `pandas.DataFrame.to_csv`
- How to download single or multiple tickers into a singledataframe with single level column names and a ticker column

View File

@@ -0,0 +1,16 @@
******************************
Persistent Cache Store
******************************
To reduce Yahoo, yfinance store some data locally: timezones to localize dates, and cookie. Cache location is:
- Windows = C:/Users/\<USER\>/AppData/Local/py-yfinance
- Linux = /home/\<USER\>/.cache/py-yfinance
- MacOS = /Users/\<USER\>/Library/Caches/py-yfinance
You can direct cache to use a different location with `set_tz_cache_location()`:
.. code-block:: python
import yfinance as yf
yf.set_tz_cache_location("custom/cache/location")

View File

@@ -0,0 +1,11 @@
*********************
Using a Proxy Server
*********************
You can download data via a proxy:
.. code-block:: python
msft = yf.Ticker("MSFT")
msft.history(..., proxy="PROXY_SERVER")

View File

@@ -0,0 +1,41 @@
******************************
Smarter Scraping with Caching
******************************
Install the `nospam` package to cache API calls and reduce spam to Yahoo:
.. code-block:: bash
pip install yfinance[nospam]
To use a custom `requests` session, pass a `session=` argument to
the Ticker constructor. This allows for caching calls to the API as well as a custom way to modify requests via the `User-agent` header.
.. code-block:: python
import requests_cache
session = requests_cache.CachedSession('yfinance.cache')
session.headers['User-agent'] = 'my-program/1.0'
ticker = yf.Ticker('MSFT', session=session)
# The scraped response will be stored in the cache
ticker.actions
Combine `requests_cache` with rate-limiting to avoid triggering Yahoo's rate-limiter/blocker that can corrupt data.
.. code-block:: python
from requests import Session
from requests_cache import CacheMixin, SQLiteCache
from requests_ratelimiter import LimiterMixin, MemoryQueueBucket
from pyrate_limiter import Duration, RequestRate, Limiter
class CachedLimiterSession(CacheMixin, LimiterMixin, Session):
pass
session = CachedLimiterSession(
limiter=Limiter(RequestRate(2, Duration.SECOND*5)), # max 2 requests per 5 seconds
bucket_class=MemoryQueueBucket,
backend=SQLiteCache("yfinance.cache"),
)

0
docs/.nojekyll Normal file
View File

BIN
docs/_images/branches.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@@ -0,0 +1,109 @@
********************************
Contributiong to yfinance
********************************
`yfinance` relies on the community to investigate bugs and contribute code. Heres how you can help:
Contributing
------------
1. Fork the repository on GitHub.
2. Clone your forked repository:
.. code-block:: bash
git clone https://github.com/your-username/yfinance.git
3. Create a new branch for your feature or bug fix:
.. code-block:: bash
git checkout -b feature-branch-name
4. Make your changes, commit them, and push your branch to GitHub. To keep the commit history and `network graph <https://github.com/ranaroussi/yfinance/network>`_ compact:
Use short summaries for commits
.. code-block:: shell
git commit -m "short summary" -m "full commit message"
**Squash** tiny or negligible commits with meaningful ones.
.. code-block:: shell
git rebase -i HEAD~2
git push --force-with-lease origin <branch-name>
5. Open a pull request on the `yfinance` GitHub page.
For more information, see the `Developer Guide <https://github.com/ranaroussi/yfinance/discussions/1084>`_.
Branches
---------
To support rapid development without breaking stable versions, this project uses a two-layer branch model:
.. image:: assets/branches.png
:alt: Branching Model
`Inspiration <https://miro.medium.com/max/700/1*2YagIpX6LuauC3ASpwHekg.png>`_
- **dev**: New features and some bug fixes are merged here. This branch allows collective testing, conflict resolution, and further stabilization before merging into the stable branch.
- **main**: Stable branch where PIP releases are created.
By default, branches target **main**, but most contributions should target **dev**.
**Exceptions**:
Direct merges to **main** are allowed if:
- `yfinance` is massively broken
- Part of `yfinance` is broken, and the fix is simple and isolated
Unit Tests
----------
Tests are written using Pythons `unittest` module. Here are some ways to run tests:
- **Run all price tests**:
.. code-block:: shell
python -m unittest tests.test_prices
- **Run a subset of price tests**:
.. code-block:: shell
python -m unittest tests.test_prices.TestPriceRepair
- **Run a specific test**:
.. code-block:: shell
python -m unittest tests.test_prices.TestPriceRepair.test_ticker_missing
- **Run all tests**:
.. code-block:: shell
python -m unittest discover -s tests
Rebasing
--------------
If asked to move your branch from **main** to **dev**:
1. Ensure all relevant branches are pulled.
2. Run:
.. code-block:: shell
git checkout <your-branch>
git rebase --onto dev main <branch-name>
git push --force-with-lease origin <branch-name>
Running the GitHub Version of yfinance
--------------------------------------
To download and run a GitHub version of `yfinance`, refer to `GitHub discussion <https://github.com/ranaroussi/yfinance/discussions/1080>`_

View File

@@ -0,0 +1,46 @@
*************************************
Contribution to the documentation
*************************************
.. contents:: Documentation:
:local:
About documentation
------------------------
* yfinance documentation is written in reStructuredText (rst) and built using Sphinx.
* The documentation file is in `doc/source/..`.
* Most of the notes under API References read from class and methods docstrings. These documentations, found in `doc/source/reference/api` is autogenerated by Sphinx and not included in git.
Building documentation locally
-------------------------------
To build the documentation locally, follow these steps:
1. **Install Required Dependencies**:
* Make sure `Sphinx` and any other dependencies are installed. If a `requirements.txt` file is available, you can install dependencies by running:
.. code-block:: console
pip install -r requirements.txt
2. **Build with Sphinx**:
* After dependencies are installed, use the sphinx-build command to generate HTML documentation.
* Go to `doc/` directory Run:
.. code-block:: console
make clean && make html
3. **View Documentation Locally**:
* Open `doc/build/html/index.html` in the browser to view the generated documentation.
Building documentation on main
-------------------------------
The documentation updates are built on merge to `main` branch. This is done via GitHub Actions workflow based on `/yfinance/.github/workflows/deploy_doc.yml`.
1. Reivew the changes locally and push to `dev`.
2. When `dev` gets merged to `main`, GitHub Actions workflow is automated to build documentation.

View File

@@ -0,0 +1,9 @@
Development
===============================
.. toctree::
:maxdepth: 1
contributing
documentation
reporting_bug

View File

@@ -0,0 +1,5 @@
********************************
Reporting a Bug
********************************
Open a new issue on our `GitHub <https://github.com/ranaroussi/yfinance/issues>`_.

View File

@@ -0,0 +1,9 @@
Getting Started
===============
.. toctree::
:maxdepth: 1
installation
quick_start
legal

View File

@@ -0,0 +1,17 @@
********************
Installation Guide
********************
Install `yfinance` using `pip`:
.. code-block:: bash
$ pip install yfinance --upgrade --no-cache-dir
To install with optional dependencies, replace `optional` with: `nospam` for `caching-requests <https://github.com/ranaroussi/yfinance?tab=readme-ov-file#smarter-scraping>`_, `repair` for `price repair <https://github.com/ranaroussi/yfinance/wiki/Price-repair>`_, or `nospam`, `repair` for both:
.. code-block:: bash
$ pip install "yfinance[optional]"
For required dependencies, check out the `requirements file <./requirements.txt>`_, and for all dependencies, see the `setup.py file <./setup.py#L62>`_.

View File

@@ -0,0 +1,12 @@
********************
Legal Information
********************
yfinance is distributed under the Apache Software License. See the `LICENSE.txt <../../../../LICENSE.txt>`_ file for details.
Again, yfinance is **not** affiliated, endorsed, or vetted by Yahoo, Inc. It's an open-source tool that uses Yahoo's publicly available APIs, and is intended for research and educational purposes.
Refer to Yahoo!'s terms of use:
- `API Terms <https://policies.yahoo.com/us/en/yahoo/terms/product-atos/apiforydn/index.htm>`_
- `Yahoo Terms <https://legal.yahoo.com/us/en/yahoo/terms/otos/index.html>`_

View File

@@ -0,0 +1,30 @@
********************
Quick Start
********************
The Ticker module allows you to access ticker data in a more Pythonic way:
.. code-block:: python
import yfinance as yf
msft = yf.Ticker("MSFT")
# get all stock info
msft.info
# get historical market data
hist = msft.history(period="1mo")
# show actions (dividends, splits, capital gains)
msft.actions
msft.dividends
msft.splits
To work with multiple tickers, use:
.. code-block:: python
tickers = yf.Tickers('msft aapl goog')
tickers.tickers['MSFT'].info
tickers.tickers['AAPL'].history(period="1mo")

View File

@@ -0,0 +1,30 @@
yfinance documentation
==============================================
Download Market Data from Yahoo! Finance's API
------------------------------------------------
.. admonition:: IMPORTANT LEGAL DISCLAIMER
**Yahoo!, Y!Finance, and Yahoo! finance are registered trademarks of Yahoo, Inc.**
yfinance is **not** affiliated, endorsed, or vetted by Yahoo, Inc. It's
an open-source tool that uses Yahoo's publicly available APIs, and is
intended for research and educational purposes.
**You should refer to Yahoo!'s terms of use**
(`here <https://policies.yahoo.com/us/en/yahoo/terms/product-atos/apiforydn/index.htm>`__),
(`here <https://legal.yahoo.com/us/en/yahoo/terms/otos/index.html>`__),
and (`here <https://policies.yahoo.com/us/en/yahoo/terms/index.htm>`__)
for details on your rights to use the actual data downloaded.
Remember - the Yahoo! finance API is intended for personal use only.
.. toctree::
:maxdepth: 3
:hidden:
:titlesonly:
getting_started/index
user_guide/index
reference/index
development/index

View File

@@ -0,0 +1,6 @@
yfinance.EquityQuery.valid\_eq\_operand\_map
============================================
.. currentmodule:: yfinance
.. autoproperty:: EquityQuery.valid_eq_operand_map

View File

@@ -0,0 +1,6 @@
yfinance.EquityQuery.valid\_operand\_fields
===========================================
.. currentmodule:: yfinance
.. autoproperty:: EquityQuery.valid_operand_fields

View File

@@ -0,0 +1,6 @@
yfinance.Industry.key
=====================
.. currentmodule:: yfinance
.. autoproperty:: Industry.key

View File

@@ -0,0 +1,6 @@
yfinance.Industry.name
======================
.. currentmodule:: yfinance
.. autoproperty:: Industry.name

View File

@@ -0,0 +1,6 @@
yfinance.Industry.overview
==========================
.. currentmodule:: yfinance
.. autoproperty:: Industry.overview

View File

@@ -0,0 +1,6 @@
yfinance.Industry.research\_reports
===================================
.. currentmodule:: yfinance
.. autoproperty:: Industry.research_reports

View File

@@ -0,0 +1,6 @@
yfinance.Industry.sector\_key
=============================
.. currentmodule:: yfinance
.. autoproperty:: Industry.sector_key

View File

@@ -0,0 +1,6 @@
yfinance.Industry.sector\_name
==============================
.. currentmodule:: yfinance
.. autoproperty:: Industry.sector_name

View File

@@ -0,0 +1,6 @@
yfinance.Industry.symbol
========================
.. currentmodule:: yfinance
.. autoproperty:: Industry.symbol

View File

@@ -0,0 +1,6 @@
yfinance.Industry.ticker
========================
.. currentmodule:: yfinance
.. autoproperty:: Industry.ticker

View File

@@ -0,0 +1,6 @@
yfinance.Industry.top\_companies
================================
.. currentmodule:: yfinance
.. autoproperty:: Industry.top_companies

View File

@@ -0,0 +1,6 @@
yfinance.Industry.top\_growth\_companies
========================================
.. currentmodule:: yfinance
.. autoproperty:: Industry.top_growth_companies

View File

@@ -0,0 +1,6 @@
yfinance.Industry.top\_performing\_companies
============================================
.. currentmodule:: yfinance
.. autoproperty:: Industry.top_performing_companies

View File

@@ -0,0 +1,6 @@
yfinance.Screener.body
======================
.. currentmodule:: yfinance
.. autoproperty:: Screener.body

View File

@@ -0,0 +1,6 @@
yfinance.Screener.predefined\_bodies
====================================
.. currentmodule:: yfinance
.. autoproperty:: Screener.predefined_bodies

View File

@@ -0,0 +1,6 @@
yfinance.Screener.response
==========================
.. currentmodule:: yfinance
.. autoproperty:: Screener.response

View File

@@ -0,0 +1,6 @@
yfinance.Sector.industries
==========================
.. currentmodule:: yfinance
.. autoproperty:: Sector.industries

View File

@@ -0,0 +1,6 @@
yfinance.Sector.key
===================
.. currentmodule:: yfinance
.. autoproperty:: Sector.key

View File

@@ -0,0 +1,6 @@
yfinance.Sector.name
====================
.. currentmodule:: yfinance
.. autoproperty:: Sector.name

View File

@@ -0,0 +1,6 @@
yfinance.Sector.overview
========================
.. currentmodule:: yfinance
.. autoproperty:: Sector.overview

View File

@@ -0,0 +1,6 @@
yfinance.Sector.research\_reports
=================================
.. currentmodule:: yfinance
.. autoproperty:: Sector.research_reports

View File

@@ -0,0 +1,6 @@
yfinance.Sector.symbol
======================
.. currentmodule:: yfinance
.. autoproperty:: Sector.symbol

View File

@@ -0,0 +1,6 @@
yfinance.Sector.ticker
======================
.. currentmodule:: yfinance
.. autoproperty:: Sector.ticker

View File

@@ -0,0 +1,6 @@
yfinance.Sector.top\_companies
==============================
.. currentmodule:: yfinance
.. autoproperty:: Sector.top_companies

View File

@@ -0,0 +1,6 @@
yfinance.Sector.top\_etfs
=========================
.. currentmodule:: yfinance
.. autoproperty:: Sector.top_etfs

View File

@@ -0,0 +1,6 @@
yfinance.Sector.top\_mutual\_funds
==================================
.. currentmodule:: yfinance
.. autoproperty:: Sector.top_mutual_funds

View File

@@ -0,0 +1,6 @@
yfinance.Ticker.actions
=======================
.. currentmodule:: yfinance
.. autoproperty:: Ticker.actions

View File

@@ -0,0 +1,6 @@
yfinance.Ticker.analyst\_price\_targets
=======================================
.. currentmodule:: yfinance
.. autoproperty:: Ticker.analyst_price_targets

View File

@@ -0,0 +1,6 @@
yfinance.Ticker.balance\_sheet
==============================
.. currentmodule:: yfinance
.. autoproperty:: Ticker.balance_sheet

View File

@@ -0,0 +1,6 @@
yfinance.Ticker.balancesheet
============================
.. currentmodule:: yfinance
.. autoproperty:: Ticker.balancesheet

View File

@@ -0,0 +1,6 @@
yfinance.Ticker.basic\_info
===========================
.. currentmodule:: yfinance
.. autoproperty:: Ticker.basic_info

View File

@@ -0,0 +1,6 @@
yfinance.Ticker.calendar
========================
.. currentmodule:: yfinance
.. autoproperty:: Ticker.calendar

View File

@@ -0,0 +1,6 @@
yfinance.Ticker.capital\_gains
==============================
.. currentmodule:: yfinance
.. autoproperty:: Ticker.capital_gains

View File

@@ -0,0 +1,6 @@
yfinance.Ticker.cash\_flow
==========================
.. currentmodule:: yfinance
.. autoproperty:: Ticker.cash_flow

View File

@@ -0,0 +1,6 @@
yfinance.Ticker.cashflow
========================
.. currentmodule:: yfinance
.. autoproperty:: Ticker.cashflow

View File

@@ -0,0 +1,6 @@
yfinance.Ticker.dividends
=========================
.. currentmodule:: yfinance
.. autoproperty:: Ticker.dividends

View File

@@ -0,0 +1,6 @@
yfinance.Ticker.earnings
========================
.. currentmodule:: yfinance
.. autoproperty:: Ticker.earnings

View File

@@ -0,0 +1,6 @@
yfinance.Ticker.earnings\_dates
===============================
.. currentmodule:: yfinance
.. autoproperty:: Ticker.earnings_dates

View File

@@ -0,0 +1,6 @@
yfinance.Ticker.earnings\_estimate
==================================
.. currentmodule:: yfinance
.. autoproperty:: Ticker.earnings_estimate

View File

@@ -0,0 +1,6 @@
yfinance.Ticker.earnings\_history
=================================
.. currentmodule:: yfinance
.. autoproperty:: Ticker.earnings_history

View File

@@ -0,0 +1,6 @@
yfinance.Ticker.eps\_revisions
==============================
.. currentmodule:: yfinance
.. autoproperty:: Ticker.eps_revisions

View File

@@ -0,0 +1,6 @@
yfinance.Ticker.eps\_trend
==========================
.. currentmodule:: yfinance
.. autoproperty:: Ticker.eps_trend

View File

@@ -0,0 +1,6 @@
yfinance.Ticker.fast\_info
==========================
.. currentmodule:: yfinance
.. autoproperty:: Ticker.fast_info

View File

@@ -0,0 +1,6 @@
yfinance.Ticker.financials
==========================
.. currentmodule:: yfinance
.. autoproperty:: Ticker.financials

Some files were not shown because too many files have changed in this diff Show More