Skip to main content

Yahoo Finance Data for Python

Build Status

Documentation Status

Python module to get data readily available from Yahoo Finance. The data is retrieved directly from the website with no data changes.

Warning: This package is undergoing development and implementation and interfaces may change drastically without notice.

Note: There is no guarantee that the data provided in this library is correct. Use at your own risk.

Installation

You can install the library using:

pip install yahoofinance

Note: There are a few packages with a similar name, make sure you type the right package name - yahoofinance

Usage

To export the Profile data to CSV, it is simple!

If we are looking to export Apple's Asset Profile we can do the following:

>>> import yahoofinance as yf
>>> profile = yf.AssetProfile('AAPL')
>>> profile.to_csv('AAPL-profile.csv')

You can now find the profile information in a CSV file called AAPL-profile.csv.

Next steps include exporting other to a Pandas Dataframe, which would be the main reason why this project exists!

Optional Usage

We can add in a locale to choose a specific region to query from. For example, from Australia, we can query from the Australian Yahoo Finance website to get marginally faster query times. Using the Asset Profile example previously:

>>> import yahoofinance as yf
>>> profile = yd.AssetProfile('AAPL', locale=Locale.AU)
>>> profile.to_csv('AAPL-profile.csv')

Current locales include:

  • Locale.AU (Australia)
  • Locale.CA (Canada)
  • Locale.US (United States)

Example Use Case

You can find an example use case in the following Google Colab notebook: https://colab.research.google.com/drive/1n5L2NVkRZuYUi_RaC54JsJN79Dq5wnEb

Documentation

You can find the documentation here: https://python-yahoofinance.readthedocs.io

FAQs

  1. Why did you make this? I felt that financial data information is often restricted.

  2. Can you make custom data manipulation filters to make the data more tailored to my use? I do not intend to. My ethos is to enable financial data users to retrieve the data and use it their own way. I do not want to steal the data provided and make my own flavour.

  3. What happens when their website data changes and/or this project breaks? Let me know with a feature request and I'll do my best to fix it. Or even better, fork and make a pull request!

  4. I want to contribute to this amazing project! Fork and make a pull request!

  5. I like you, I want to support you financially. I don't have a support link yet (because this project just started), but if enough people are interested, I'll set one up someday.

Metadata

Release files for yahoofinance 0.0.2

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

Source distribution (sdist)

Source distribution for yahoofinance 0.0.2
File Size Uploaded Provenance Actions
yahoofinance-0.0.2.tar.gz 12.6 kB Without provenance Details for yahoofinance-0.0.2.tar.gz

Built distribution (wheel)

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

Total release size: 31.4 kB

Release files / yahoofinance-0.0.2.tar.gz

Download URL yahoofinance-0.0.2.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
abeac2cf8c59bb887863825350941b0dcba85172010f4e2e7e8ef71738f73d6f
BLAKE2b-256 checksum
How to use checksums
eeb2e0b39708b8f3321806cd2e4a74a93302734be891f0767fb23fd9de3dab65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.8

Release files / yahoofinance-0.0.2-py3-none-any.whl

Download URL yahoofinance-0.0.2-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dd783dee582c13e85ecab54fcb8302c5180a3573502318c0e52bb8817dfb85ed
BLAKE2b-256 checksum
How to use checksums
b27ba669ed5e629a665a81f1c456b4d8bb45929913a4ddb34ec2c2eef10f9a37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.8

Security for yahoofinance 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

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