Skip to main content

A library to retrieve data from Yahoo Finance

Project description

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.

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

yahoofinance-0.0.2.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

yahoofinance-0.0.2-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file yahoofinance-0.0.2.tar.gz.

File metadata

  • Download URL: yahoofinance-0.0.2.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for yahoofinance-0.0.2.tar.gz
Algorithm Hash digest
SHA256 abeac2cf8c59bb887863825350941b0dcba85172010f4e2e7e8ef71738f73d6f
MD5 91d817a9a113065546b75ede6a52926e
BLAKE2b-256 eeb2e0b39708b8f3321806cd2e4a74a93302734be891f0767fb23fd9de3dab65

See more details on using hashes here.

File details

Details for the file yahoofinance-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: yahoofinance-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for yahoofinance-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dd783dee582c13e85ecab54fcb8302c5180a3573502318c0e52bb8817dfb85ed
MD5 b73e0f4a06a0bf22b2299038706d886d
BLAKE2b-256 b27ba669ed5e629a665a81f1c456b4d8bb45929913a4ddb34ec2c2eef10f9a37

See more details on using hashes here.

Supported by

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