Skip to main content

Utilities for the analysis of financial data

Project description

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() # 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 'Binance 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

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

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

bandl-0.1.0.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

bandl-0.1.0-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

Details for the file bandl-0.1.0.tar.gz.

File metadata

  • Download URL: bandl-0.1.0.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for bandl-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0303fe662c48a20bfafcf6253fd7d6a01844b167c0c38a775f0e9a97c730c294
MD5 d90c5df3f10861892136771d032b41a6
BLAKE2b-256 1eb1f9092852ea46560d751e9e49bd38b4f2f42ab7afe147a508388199566556

See more details on using hashes here.

Provenance

File details

Details for the file bandl-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bandl-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for bandl-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1fb90f198412349635e027eb0f228a74e295fdb1c25f0391754993c1028244a5
MD5 66960f94a2e63f428885782a50430b8f
BLAKE2b-256 5f0d78ca70e59b89bf22f7f1ab2d78a906ad578aebcce37d13865e46316d7176

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page