marketools is a Python package for web scraping and analysis of stock market data. Project is under development. At the moment, analysis functionality is limited. You are welcomed to contribute to the project.
Data are scraped from Stooq service.
You may report issues and functionality requests here.
pip install marketoolsor
git clone https://github.com/AlbertRtk/marketools.gitImport Stock class
from marketools import StockCreate Stock instance for selected ticker, here PKN
pkn = Stock('PKN')For not Polish stocks, you need to append country code to the ticker (after a dot), e.g.,
apple = Stock('AAPL.US')Get and print OHLC (open-high-low-close) data from the last 5 days
pkn_ohlc = pkn.ohlc # returns pandas.DataFrame
print(pkn_ohlc.tail(5))Print available fundamental information
print(pkn.fundamentals)