Skip to main content

A simple asyncronous wrapper around the public yahoo finance API

While the yahoo finance website is clunky and basic - underlying it is a very powerful API that is primarily powered by refinitiv data. Many python packages have attempted to implement wrappers around this API, however they fall short for one of two reasons. Either they don’t expose all of the available endpoints of the API, or they are syncronous / rely on threading which is less efficient for IO bound tasks.

yfinhanced attempts to solve both of these issues by providing access to the full range of endpoints, and using pythons modern asyncronous support in asyncio and aiohttp. As a result, this package is extremely fast and feature complete.

You can find the full documentation at: https://me-64.github.io/yfinhanced

>>> from yfinhanced import YFClient
>>> yf = YFClient()
>>> await yf.connect()
>>> quote = await yf.get_quote(['AAPL', 'BTC-USD', 'BYND220401C00030000', 'GC=F', 'AZN.L'])
>>> print(quote['AAPL'])
{'language': 'en-US',
'region': 'US',
'quoteType': 'EQUITY',
'typeDisp': 'Equity',
'quoteSourceName': 'Nasdaq Real Time Price',
'triggerable': True,
'customPriceAlertConfidence': 'HIGH',
'currency': 'USD',
'exchange': 'NMS',
'shortName': 'Apple Inc.',
'longName': 'Apple Inc.',
'messageBoardId': 'finmb_24937',
'exchangeTimezoneName': 'America/New_York',
'exchangeTimezoneShortName': 'EDT',
'gmtOffSetMilliseconds': -14400000,
'market': 'us_market',
'esgPopulated': False,
'fullExchangeName': 'NasdaqGS',
'financialCurrency': 'USD',
'regularMarketOpen': 167.99,
'averageDailyVolume3Month': 93351350,
'averageDailyVolume10Day': 97387620,
'fiftyTwoWeekLowChange': 51.429993,
'fiftyTwoWeekLowChangePercent': 0.43269387,
'fiftyTwoWeekRange': '118.86 - 182.94',
'fiftyTwoWeekHighChange': -12.650009,
'fiftyTwoWeekHighChangePercent': -0.06914841,
'fiftyTwoWeekLow': 118.86,
'fiftyTwoWeekHigh': 182.94,
'dividendDate': 1644451200,
'earningsTimestamp': 1643301000,
'earningsTimestampStart': 1651003200,
'earningsTimestampEnd': 1651521600,
'trailingAnnualDividendRate': 0.865,
'trailingPE': 28.310888,
'trailingAnnualDividendYield': 0.0051238,
'epsTrailingTwelveMonths': 6.015,
'epsForward': 6.56,
'epsCurrentYear': 6.16,
'priceEpsCurrentYear': 27.64448,
'sharesOutstanding': 16319399936,
'bookValue': 4.402,
'fiftyDayAverage': 166.388,
'fiftyDayAverageChange': 3.9019928,
'fiftyDayAverageChangePercent': 0.023451166,
'twoHundredDayAverage': 154.8563,
'twoHundredDayAverageChange': 15.433701,
'twoHundredDayAverageChangePercent': 0.099664666,
'marketCap': 2779030487040,
'forwardPE': 25.958841,
'priceToBook': 38.68469,
'sourceInterval': 15,
'exchangeDataDelayedBy': 0,
'firstTradeDateMilliseconds': 345479400000,
'priceHint': 2,
'regularMarketChange': 1.469986,
'regularMarketChangePercent': 0.87074155,
'regularMarketTime': 1648046328,
'regularMarketPrice': 170.29,
'regularMarketDayHigh': 170.76,
'regularMarketDayRange': '167.65 - 170.76',
'regularMarketDayLow': 167.65,
'regularMarketVolume': 24929352,
'regularMarketPreviousClose': 168.82,
'bid': 170.08,
'ask': 170.13,
'bidSize': 12,
'askSize': 8,
'marketState': 'REGULAR',
'pageViewGrowthWeekly': -0.10239728,
'averageAnalystRating': '1.8 - Buy',
'tradeable': False,
'displayName': 'Apple'}

Release files for yfinhanced 0.1.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yfinhanced 0.1.11
File Size Uploaded
yfinhanced-0.1.11.tar.gz 15.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for yfinhanced 0.1.11
File Interpreter ABI Platform
yfinhanced-0.1.11-py3-none-any.whl Python 3 none any Details

Total release size:30.5 kB

Release files / yfinhanced-0.1.11.tar.gz

Download URL yfinhanced-0.1.11.tar.gz
Size 15.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b35f7a3a26ccc3e42c636b9a507802d9ac36162e205b8a2feb06dad19f13c68a
BLAKE2b-256 checksum
How to use checksums
ef8cccc39af800de1fdf0c645b4ff9bdec85d60d836e0a2152dfd9330bfc7b1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.2

Release files / yfinhanced-0.1.11-py3-none-any.whl

Download URL yfinhanced-0.1.11-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4db9ddbff5a4d67b1774b144d029470fbb5c539de1b004791049599d054a4d3a
BLAKE2b-256 checksum
How to use checksums
be9ebc9d754b3c45abfffdd3da1d1e25e078565397ac51d80ecb894ca6715688
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.2

Release history Release notifications | RSS feed

This release

0.1.11 This release

2 release files

0.1.10

2 release files

0.1.7

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.0.3

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page