Skip to main content

Unofficial Python Api for BSE India stock exchange

Project description

BseIndiaApi

An Unofficial Python Api for BSE India stock exchange.

Python version: >= 3.8

Install with PIP

pip install -U bse

Documentation

https://bennythadikaran.github.io/BseIndiaApi/

You might like stock-news built using BseIndiaApi. It helps to keep track of corporate announcements and actions on your portfolio.

Usage

Using with statement

from bse import BSE

with BSE(download_folder='./') as bse:
    scripCode = bse.getScripCode('tcs')  # 532540 bse scrip code

    data = bse.actions(scripcode=scripCode)

    ohlc = bse.quote(scripCode)  # Open, High, Low, LTP

or

from bse import BSE
from bse.constants import INDEX

bse = BSE(download_folder='./')

code = bse.getScripCode('tcs')  # 532540 bse scrip code

gainers = bse.gainers(by='index', name=INDEX.BSE500)

bse.exit()  # close the request session

Sample Responses

src/samples contain the sample responses from the various methods in JSON format.

The files are named after the corresponding method in src/BSE.py. Use it to understand the API response structure.

Example Folder

src/examples contains scripts that use the BSE.py.

To use the scripts download or clone the repo.

  • get_all_announcements.py: This file demonstrates how to paginate and get all announcements using BSE.announcements. It has step by step explanation of code.
  • actions.py: py actions.py infy to print the recent corporate actions. Nothing more.
  • advances.py: py advances.py to print the advance decline ratios for various bse Indexes.

You may also like my other repo: Stock-News - It uses BseIndiaApi and displays stock announcements, dividend, bonus/splits and upcoming results etc for your portfolio or watchlist stocks.

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

bse-2.0.1.tar.gz (33.1 kB view details)

Uploaded Source

Built Distribution

bse-2.0.1-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

Details for the file bse-2.0.1.tar.gz.

File metadata

  • Download URL: bse-2.0.1.tar.gz
  • Upload date:
  • Size: 33.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for bse-2.0.1.tar.gz
Algorithm Hash digest
SHA256 453333337f910058f7477c2eda0a7f0bc3f176e7ccd1828e5976803f718c3ce4
MD5 98e86720ef16abf106f7b0b85956e351
BLAKE2b-256 4f9c33e8d390ff1ed7d39eb30adf866c6111d1f786ecb7c84aed2d710e5304c9

See more details on using hashes here.

File details

Details for the file bse-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: bse-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 25.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for bse-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 87d7f0e3c441a37ee3a42805eb0f548223d2a00c7a40d03ec4b995dc27ad1f2a
MD5 0432a3be1906c947f5965ce413a5d8c6
BLAKE2b-256 cdc5f60ee44d7257ed9e4f222cc1f5757dfd35f76ba8d03e223683133a56f8d4

See more details on using hashes here.

Supported by

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