# YahFin v1.0 (Yahoo Finance Python Wrapper - Unofficial)
The Ultimate Yahoo Finance Python module you'll ever need.
> I was using the other yahoo finance library but it was fetching some of the data through web scrapping which was slow and some of its features didn't work at all.
## Try
> Try it before using it: https://share.streamlit.io/theonlyanil/yahfin-interactive/main/streamlit.py
### Features:
- Live Price Data
- Historical Price Data
- Multi Symbol Data
- Options Data
- Company Profile
- Shareholding Info
- Fundamental Statements
- Balance Sheets
- P&L
- Cash Flows
- (Yearly and Quarterly upto 4 years/qtrs)
## Quick Guide
### Importing into python file
```
# one way
from yahfin import yahfin as yf
# other way
import yahfin.yahfin as yf
```
### The Symbol Object
```
tsla = yf.Symbol('TSLA')
multiSymbols = yf.Symbol('TSLA, AAPL, MSFT, FB, ZOOM, GOOG')
```
### Quick Examples - Single Symbol
```
from yahfin import yahfin as yf
tsla = yf.Symbol('tsla')
# Get Company Profile -
tsla.profile()
# Get Company's Key Managerial Personnel Info
tsla.profile('kmp')
# Live Price Data
tsla.livePriceData()
# Historical Prices
tsla.history() # defaults: period=max, interval=1d
tsla.history(start='2021-01-01', end='2021-01-05')
tsla.history(period='1y')
tsla.history(period='5d', interval='1m')
#valid periods: 1d,5d,1mo,3mo,6mo,1y,2y,5y,10y,ytd,max
#valid intervals: 1m,2m,5m,15m,30m,60m,90m,1h,1d,5d,1wk,1mo,3mo
# Options Data
tsla.options('calls')
tsla.options('puts')
tsla.options('dates')
tsla.options('strikes')
tsla.options('quotes')
# Analysis Data
tsla.analysis()
# Shareholding Data
tsla.shareholding()
```
### Multi Symbol Data
```
from yahfin import yahfin as yf
multiSymbols = yf.Symbol('TSLA, AAPL, GOOG, FB, RELIANCE.NS')
# All data at once
m = multiSymbols.multi()
# dataPoints of all symbols
prices = m['regularMarketPrice']
marketCaps = m['marketCap']
# Individual Data
aapl_price = prices['AAPL']
# Note: The best thing is that it also works with single symbol.
```
### Fundamental Data
```
from yahfin import yahfin as yf
tsla = yf.Symbol('tsla')
# Balance Sheets
tsla.balanceSheets()
tsla.balanceSheetsQtr()
# Profile and Loss Statements
tsla.incomeStatements()
tsla.incomeStatementsQtr()
# Cash Flow Statements
tsla.cashFlows()
tsla.cashFlowsQtr()
```
### Requirements
- Python >= 3.x.x
- requests
- Pandas
Raw data
{
"_id": null,
"home_page": "https://github.com/theonlyanil/yahfin",
"name": "yahfin",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7.7",
"maintainer_email": "",
"keywords": "",
"author": "Anil Sardiwal",
"author_email": "theonlyanil@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/17/be/a12d17054ea025dce587f4bd5a489802ca2572cda6ced5bd96c3f9ce91f8/yahfin-1.0.tar.gz",
"platform": null,
"description": "# YahFin v1.0 (Yahoo Finance Python Wrapper - Unofficial)\n\nThe Ultimate Yahoo Finance Python module you'll ever need.\n> I was using the other yahoo finance library but it was fetching some of the data through web scrapping which was slow and some of its features didn't work at all.\n\n## Try\n> Try it before using it: https://share.streamlit.io/theonlyanil/yahfin-interactive/main/streamlit.py\n\n### Features:\n- Live Price Data\n- Historical Price Data\n- Multi Symbol Data\n- Options Data\n- Company Profile\n- Shareholding Info\n- Fundamental Statements\n - Balance Sheets\n - P&L\n - Cash Flows\n - (Yearly and Quarterly upto 4 years/qtrs)\n\n## Quick Guide\n\n### Importing into python file\n```\n # one way\n from yahfin import yahfin as yf\n\n # other way\n import yahfin.yahfin as yf\n```\n\n### The Symbol Object\n```\n tsla = yf.Symbol('TSLA')\n multiSymbols = yf.Symbol('TSLA, AAPL, MSFT, FB, ZOOM, GOOG')\n```\n\n### Quick Examples - Single Symbol\n```\n from yahfin import yahfin as yf\n\n tsla = yf.Symbol('tsla')\n\n # Get Company Profile -\n tsla.profile()\n\n # Get Company's Key Managerial Personnel Info\n tsla.profile('kmp')\n\n # Live Price Data\n tsla.livePriceData()\n\n # Historical Prices\n tsla.history() # defaults: period=max, interval=1d\n tsla.history(start='2021-01-01', end='2021-01-05')\n tsla.history(period='1y')\n tsla.history(period='5d', interval='1m')\n\n #valid periods: 1d,5d,1mo,3mo,6mo,1y,2y,5y,10y,ytd,max\n #valid intervals: 1m,2m,5m,15m,30m,60m,90m,1h,1d,5d,1wk,1mo,3mo\n\n # Options Data\n tsla.options('calls')\n tsla.options('puts')\n tsla.options('dates')\n tsla.options('strikes')\n tsla.options('quotes')\n\n # Analysis Data\n tsla.analysis()\n\n # Shareholding Data\n tsla.shareholding()\n\n```\n\n### Multi Symbol Data\n```\n from yahfin import yahfin as yf\n\n multiSymbols = yf.Symbol('TSLA, AAPL, GOOG, FB, RELIANCE.NS')\n\n # All data at once\n m = multiSymbols.multi()\n\n # dataPoints of all symbols\n prices = m['regularMarketPrice']\n marketCaps = m['marketCap']\n\n # Individual Data\n aapl_price = prices['AAPL']\n\n # Note: The best thing is that it also works with single symbol.\n\n```\n\n### Fundamental Data\n```\n from yahfin import yahfin as yf\n\n tsla = yf.Symbol('tsla')\n\n # Balance Sheets\n tsla.balanceSheets()\n tsla.balanceSheetsQtr()\n\n # Profile and Loss Statements\n tsla.incomeStatements()\n tsla.incomeStatementsQtr()\n\n # Cash Flow Statements\n tsla.cashFlows()\n tsla.cashFlowsQtr()\n```\n\n### Requirements\n - Python >= 3.x.x\n - requests\n - Pandas\n",
"bugtrack_url": null,
"license": "",
"summary": "Yahoo Finance Python Wrapper (Unofficial)",
"version": "1.0",
"project_urls": {
"Homepage": "https://github.com/theonlyanil/yahfin"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b9c7f0bad5ab34e1f0badcdf2fb0bdc74c6e7ab1514587e0c6882fd8fa6db08b",
"md5": "ec561b4a5555b39ca522b403c4b9373b",
"sha256": "1f24b3c61d3809a74c72e68a7332219f2153da1cc4f7d01d12750be394bb4f1e"
},
"downloads": -1,
"filename": "yahfin-1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ec561b4a5555b39ca522b403c4b9373b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7.7",
"size": 22260,
"upload_time": "2023-09-01T10:30:10",
"upload_time_iso_8601": "2023-09-01T10:30:10.239379Z",
"url": "https://files.pythonhosted.org/packages/b9/c7/f0bad5ab34e1f0badcdf2fb0bdc74c6e7ab1514587e0c6882fd8fa6db08b/yahfin-1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "17bea12d17054ea025dce587f4bd5a489802ca2572cda6ced5bd96c3f9ce91f8",
"md5": "5b997eb34733abb515115f0f281807bf",
"sha256": "1bbe84df97d9c775809589e2c1e0daf449b1a420ab5c84bcb31efc88415cfed1"
},
"downloads": -1,
"filename": "yahfin-1.0.tar.gz",
"has_sig": false,
"md5_digest": "5b997eb34733abb515115f0f281807bf",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7.7",
"size": 21805,
"upload_time": "2023-09-01T10:30:15",
"upload_time_iso_8601": "2023-09-01T10:30:15.452265Z",
"url": "https://files.pythonhosted.org/packages/17/be/a12d17054ea025dce587f4bd5a489802ca2572cda6ced5bd96c3f9ce91f8/yahfin-1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-01 10:30:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "theonlyanil",
"github_project": "yahfin",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "yahfin"
}