A library to retrieve data from Yahoo Finance
Project description
Yahoo Finance Data for Python
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:
>>> from yahoo_finance import yahoo_data as yd
>>> profile = yd.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:
>>> from yahoo_finance import yahoo_data as yd
>>> 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)
Documentation
you can find the documentation here: python-yahoofinance.readthedocs.io
FAQs
-
Why did you make this? I felt that financial data information is often restricted.
-
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.
-
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!
-
I want to contribute to this amazing project! Fork and make a pull request!
-
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for yahoofinance-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 146e36ae64f8b3240d4801830b01fde571356d9eaa64e13ac30f722d36ca47ea |
|
MD5 | 6c48d287fcb15aa8d08d9a666d6d5323 |
|
BLAKE2b-256 | 7621bf842515ece108a16e01f1fa9bae56098805c190a178f0890aeb237a6af7 |