bandl is open source library, provides apis for equity stock, derivatives, commodities, and cryptocurrencies.
Installation
Use the package manager pip to install bandl.
pip install bandl
Usage
To Get Stock/Option Data form NSE
from bandl.nse_data import NseData
nd = NseData()
To get Option chain data from New NSE website
strikes = nd.get_oc_strike_prices("NIFTY")
oc_data = nd.get_option_data("NIFTY",strikes=strikes)
To get Option chain data from old website
expiry_dates = nd.get_oc_exp_dates(symbol)
nd.get_option_chain_excel(symbol,expiry_date,filepath)
bn_df = nd.get_option_chain_df(symbol, expiry_date,dayfirst=False)
To get stock historical data.
data_frame = nd.get_data(symbol,series="EQ",start=None,end=None,periods=None,dayfirst=False)
To get FII/DII data.
part_oi_df = nd.get_part_oi_df(start=None,end=None,periods=None,dayfirst=False,workers=None)
To get Stock data from Nasdaq
from bandl.nasdaq import Nasdaq
testObj = Nasdaq()
dfs = testObj.get_data("AAPL",periods=15)
To get Stock data from Yahoo Finance
from bandl.yfinance import Yfinance
testObj = Yfinance()
dfs = testObj.get_data("AAPL",is_indian=False)
dfs = testObj.get_data("SBIN",start="21-Jan-2020")
To get Crypto Currencies data from Binance
from bandl.binance import Binance
testObj = Binance()
tkrs = testObj.get_tickers()
dfs = testObj.get_data("ETHBTC",start="21-Jan-2020")
To get Crypto Currencies data from Coinbase
from bandl.coinbase import Coinbase
testObj = Coinbase()
dfs = testObj.get_data("BTC-USD",start="21-Jan-2020",end="21-Jan-2021")
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Kindly follow PEP 8 Coding Style guidelines. Refer: https://www.python.org/dev/peps/pep-0008/
Please make sure to update tests as appropriate.
License
MIT