A tool to scrape and download publicly available stock information. Currently supports Yahoo Finance data.
Project description
Finance Scrapers
A pypi package to scrape stock information from different finance sites. Currently supports Yahoo Finance.
Installation
To install, Download the PyPi package or,
pip install finance-scrapers
To upgrade to the latest version,
pip install --upgrade finance-scrapers
Usage
Scrape stock information:
from finance_scrapers import YahooFinance
# the tickers of the stocks you want to scrape
tickers = ['schb', 'googl', 'nflx']
# run the scraper
scraper = YahooFinance(tickers)
scraper.run()
all_stock_info = scraper.all_stock_info
Scrape stock information and download to a file:
from finance_scrapers import YahooFinance
# the tickers of the stocks you want to scrape
tickers = ['schb', 'googl', 'nflx']
# run the scraper
scraper = YahooFinance(tickers)
scraper.run()
# download data
Downloader.download_csv(data=scraper.all_stock_info, file_path='../samples/data.csv')
Downloader.download_excel(data=scraper.all_stock_info, file_path='../samples/data.xlsx')
Downloader.download_json(data=scraper.all_stock_info, file_path='../samples/data.json')
Downloader.download_md(data=scraper.all_stock_info, file_path='../samples/data.md')
Examples of these downloads can be found here
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
finance_scrapers-2.0.0.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for finance_scrapers-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fe9921fb15e06b01a0c9dc96c948aadc122bee402402d12c6b6134732c46979 |
|
MD5 | 38595ee4dc5af58b20bb48843a17dec0 |
|
BLAKE2b-256 | 496b678e26d4b8ac4431176f4db77bc43aa3fe5ccfc69b0af3385bc9ccf99c32 |