Giter Club home page Giter Club logo

bandl's Introduction

bandl is open source library, provides apis for equity stock, derivatives, commodities, and cryptocurrencies.

Demo

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() # returns 'NseData object'. can be use to get nse data.

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) #return available expiry dates
nd.get_option_chain_excel(symbol,expiry_date,filepath) #dumps option chain to file_path
# or get in pandas dateframe
bn_df = nd.get_option_chain_df(symbol, expiry_date,dayfirst=False) #returns option chain in pandas data frame.

To get stock historical data.

data_frame = nd.get_data(symbol,series="EQ",start=None,end=None,periods=None,dayfirst=False) #returns historical data in pandas data frames

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() # returns 'Nasdaq class object'.
dfs = testObj.get_data("AAPL",periods=15) # returns last 15 days data

To get Stock data from Yahoo Finance

from bandl.yfinance import Yfinance
testObj = Yfinance() # returns 'Yfinance class object'.
#if US stock, then pass is_indian=False
dfs = testObj.get_data("AAPL",is_indian=False) #by default, returns last years data
#to get indian stock data
dfs = testObj.get_data("SBIN",start="21-Jan-2020") #retruns data from 21Jan 2020 to till today

To get Crypto Currencies data from Binance

from bandl.binance import Binance
testObj = Binance() # returns 'Binance class object'.
#to get all crypto tickers
tkrs = testObj.get_tickers() #by default, returns all tickers
dfs = testObj.get_data("ETHBTC",start="21-Jan-2020") #retruns data from 21Jan 2020 to till today

To get Crypto Currencies data from Coinbase

from bandl.coinbase import Coinbase
testObj = Coinbase() # returns 'Coinbase class object'.
dfs = testObj.get_data("BTC-USD",start="21-Jan-2020",end="21-Jan-2021")#retruns data from 21Jan 2020 to 21-Jan-2021

Todo

  • Add streaming data support
  • Support for fundamental data
  • Write unit tests
  • Add more brokers

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

bandl's People

Contributors

chiranjeevg avatar stockalgo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.