Skip to main content

Python SDK for the hosted yfin Yahoo Finance API, with yfinance-compatible data access.

Project description

yfin Python SDK

Python SDK for the hosted yfin API. The hosted API handles Yahoo Finance contracts, crumb bootstrap, caching, request coalescing, and origin budgets. The SDK adds a yfinance-compatible facade on top.

import yfin as yf

aapl = yf.Ticker("AAPL")

print(aapl.history(period="5d", interval="1d"))
print(aapl.fast_info)
print(aapl.info)
print(aapl.option_chain())
print(aapl.funds_data.top_holdings)
print(aapl.valuation)
print(yf.download(["AAPL", "MSFT"], period="5d"))

ws = yf.WebSocket(verbose=False)
ws.subscribe("BTC-USD")

Low-level REST-envelope client:

import yfin

client = yfin.Client(contact="you@example.com")
print(client.quote(["AAPL", "MSFT"]))
print(client.history("NVDA", range="5d", interval="1h"))

Set YFIN_BASE_URL to override the hosted API URL.

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

yfin-0.1.0.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

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

yfin-0.1.0-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: yfin-0.1.0.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for yfin-0.1.0.tar.gz
Algorithm Hash digest
SHA256 99ec290e2fb94427b6cf73f8bf6bfd867ba12ddb4fd09bd886dd0dc29913e142
MD5 4842781642cdd642a01c9094fabb9073
BLAKE2b-256 00c24acb8912d4a26e14d08ee3628fc0218e089d312a00b2d61fce1158867cd3

See more details on using hashes here.

Provenance

The following attestation bundles were made for yfin-0.1.0.tar.gz:

Publisher: publish-yfin-python.yml on bluedoor-ai/yfin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: yfin-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for yfin-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 17a83d669d4b0b827e703e01367caeaf6b57d9dae873417f5263afc762dada04
MD5 f561097df94b143bd6850deef1c17dc3
BLAKE2b-256 9163af80f2542d7b39e8f95dd67604bde591eb34dd444b1373ed44292e30a7b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for yfin-0.1.0-py3-none-any.whl:

Publisher: publish-yfin-python.yml on bluedoor-ai/yfin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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