Skip to content

Commit

Permalink
Merge branch 'dev' into fix/financials-data
Browse files Browse the repository at this point in the history
  • Loading branch information
ValueRaider committed Oct 28, 2022
2 parents 9e529f3 + e3d2c5d commit e83cc74
Show file tree
Hide file tree
Showing 15 changed files with 1,144 additions and 156 deletions.
5 changes: 4 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ Before posting an issue - please upgrade to the latest version and confirm the i
Upgrade using:
`$ pip install yfinance --upgrade --no-cache-dir`

Bug still there? Delete this content and submit your bug report here...
Bug still there? Delete this content and submit your bug report here and provide the following, as best you can:

- Simple code that reproduces your problem
- The error message
17 changes: 17 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
Change Log
===========

0.1.81
------
- Fix unhandled tz-cache exception #1107

0.1.80
------
- Fix `download(ignore_tz=True)` for single ticker #1097
- Fix rare case of error "Cannot infer DST time" #1100

0.1.79
------
- Fix when Yahoo returns price=NaNs on dividend day

0.1.78
------
- Fix download() when different timezones #1085

0.1.77
------
- Fix user experience bug #1078
Expand Down
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ Yahoo! finance API is intended for personal use only.**

The `Ticker` module, which allows you to access ticker data in a more Pythonic way:

Note: yahoo finance datetimes are received as UTC.

```python
import yfinance as yf

Expand Down Expand Up @@ -199,6 +197,11 @@ data = yf.download( # or pdr.get_data_yahoo(...
# (optional, default is '1d')
interval = "1m",

# Whether to ignore timezone when aligning ticker data from
# different timezones. Default is True. False may be useful for
# minute/hourly data.
ignore_tz = False,

# group by ticker (to access via data['SPY'])
# (optional, default is 'column')
group_by = 'ticker',
Expand All @@ -207,6 +210,9 @@ data = yf.download( # or pdr.get_data_yahoo(...
# (optional, default is False)
auto_adjust = True,

# identify and attempt repair of currency unit mixups e.g. $/cents
repair = False,

# download pre/post regular market hours data
# (optional, default is False)
prepost = True,
Expand All @@ -221,6 +227,18 @@ data = yf.download( # or pdr.get_data_yahoo(...
)
```

### 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
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ requests>=2.26
multitasking>=0.0.7
lxml>=4.5.1
appdirs>=1.4.4
pytz>=2022.5
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
packages=find_packages(exclude=['contrib', 'docs', 'tests', 'examples']),
install_requires=['pandas>=0.24.0', 'numpy>=1.15',
'requests>=2.26', 'multitasking>=0.0.7',
'lxml>=4.5.1', 'appdirs>=1.4.4'],
'lxml>=4.5.1', 'appdirs>=1.4.4', 'pytz>=2022.5'],
entry_points={
'console_scripts': [
'sample=sample:main',
Expand Down
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#!/usr/bin/env python
9 changes: 9 additions & 0 deletions tests/context.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-

import sys
import os
_parent_dp = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
_src_dp = _parent_dp
sys.path.insert(0, _src_dp)

import yfinance

0 comments on commit e83cc74

Please sign in to comment.