Skip to main content

Unofficial Yahoo Finance API asynchronous client

Project description

Yafin

Unofficial Yahoo!Ⓡ finance Python API client.

  • Not affiliated with Yahoo, Inc.
  • Open source library that uses publicly available APIs.
  • Intended for research, educational purposes and personal use only.
  • Synchronous and asynchronous.
  • Not returning pandas dataframes (because why?).
  • Uses caching and utilizes singleton pattern in symbol class to save resources.
  • Minimal and build on curl-cffi
  • Approx. 2x faster, than other Yahoo finance clients. Run the tests yourself - make test-perf (All tests running synchronously, returning pandas DataFrame and http responses are mocked.)

test-perf

Installation: pip install yafin for more details, see the Documentation

Documentation and Examples: https://lukinkratas.github.io/yafin/

Quick Examples

Symbol

from yafin import Symbol

with Symbol('META') as meta:
    meta_1y_chart = meta.get_chart(interval='1d', period_range='1y')

AsyncSymbol

import asyncio
from yafin import AsyncSymbol

async def main() -> None:

    async with AsyncSymbol('META') as meta:
        meta_1y_chart = await meta.get_chart(interval='1d', period_range='1y')

if __name__ == '__main__':
    asyncio.run(main())

Symbols

from yafin import Symbols

with Symbols('META,AAPL') as meta_aapl:
    meta_aapl_1y_chart = meta_aapl.get_chart(interval='1d', period_range='1y')

For more details, see the Examples section in documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yafin-0.1.0.tar.gz (34.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yafin-0.1.0-py3-none-any.whl (35.6 kB view details)

Uploaded Python 3

File details

Details for the file yafin-0.1.0.tar.gz.

File metadata

  • Download URL: yafin-0.1.0.tar.gz
  • Upload date:
  • Size: 34.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for yafin-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bb7cad3fd4222ca7f44c3c66a1aefceeda5043d61b73714f9ccbb876eabdcbb7
MD5 3a0da84984adc775acb8688979dc086c
BLAKE2b-256 d6213fb05206a7d075ea427daa4a31e3e0d146e6db378fc24ad58a5c59f2b35d

See more details on using hashes here.

File details

Details for the file yafin-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: yafin-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 35.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for yafin-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9b624229c1e1963ba1cbcda3fbff5825c35ff443a6c29db382570c4fe8d7469d
MD5 32ab6e01c0cf85a77d96a9fb158c5243
BLAKE2b-256 990d0c701f14ba2f06ac124cf20821f6eae903d57dd4f3a1aaa9ab31089243cc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page