Skip to main content

Unofficial Yahoo Finance API 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.1.tar.gz (21.5 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.1-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for yafin-0.1.1.tar.gz
Algorithm Hash digest
SHA256 34d9f86d9f1a9c796b51969a6cf6d737897fa72a17c717a269e5969964cc51c5
MD5 560e561d689ea193892e1dd43d711e24
BLAKE2b-256 5aba717b5ddba2f21a396941c9a56d60633c49842c637b069f7bc0fd287e2ef6

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for yafin-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 803486df283e7b4ce5cd1d6ed164e3658f7f407632ca9966f2f9d6f2af582e22
MD5 572ec4654594ee758e21bedb7926a28f
BLAKE2b-256 27680b3215bc1ee71d8a7c5c64a563b1467beda344122abfed43b7cad8353784

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