Skip to main content

Unified market data access (V2) with pluggable providers

Project description

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

See CONTRIBUTING.md for setup, tests, Ruff, and pull request expectations.
Legacy note: PEP 8 remains the baseline; V2 code is also checked with Ruff in CI.

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.2.0.tar.gz (33.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bandl-0.2.0-py3-none-any.whl (45.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bandl-0.2.0.tar.gz
  • Upload date:
  • Size: 33.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for bandl-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ce3beda1612ac0c8e89f2bb9dee9599f72253f52cb96c89158a506cca98e649d
MD5 f42c2281b64d5ca66ed5490424c02904
BLAKE2b-256 bc4bf1ea262c476fa48006685856c7edb3f7694b4eb800d35e8edd81b00faf7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for bandl-0.2.0.tar.gz:

Publisher: publish.yml on stockalgo/bandl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: bandl-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 45.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for bandl-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e549e022d62cd20c00dbeb7042e9ea375a1b00f69522bc12ca0ac15f09c7ab6
MD5 e71934080288cea2da812768c19292ce
BLAKE2b-256 4a2039e3dcc1acc8d7590bd483d50c2e903597db7a732744d4f612f9ba1a1a90

See more details on using hashes here.

Provenance

The following attestation bundles were made for bandl-0.2.0-py3-none-any.whl:

Publisher: publish.yml on stockalgo/bandl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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