Skip to main content

Bharat SM Data stands for Bharat(India) Stock Market Data.

Project description

Bharat (India) Stock Market Data Collection / Fetch Library - Avinash's Fork

Bharat_SM_Data stands for Bharat(India) Stock Market Data.

This is a fork of the original project by Sampad Hegde with additional NSE Charting API v2 features.

pip install Bharat-sm-data-avinash

Logo

🆕 What's New in This Fork (v4.1.0)

NSE Charting API v2 Support

  • Dynamic Symbol Search with segment filtering
  • Support for All Instruments: Index, Equity, Futures, Options
  • Segment Filters: IDX (Index), EQ (Equity), FO (Futures & Options)
  • Multiple Timeframes: 1Min to 1Month
  • Enhanced Error Handling and input validation
  • No Mapping Files Required - everything is dynamic

Quick Example

from Bharat_sm_data.Base.NSEBase import NSEBase
from datetime import datetime, timedelta

nse = NSEBase()

# Get NIFTY 50 data with new API
df = nse.get_ohlc_from_charting_v2(
    symbol="NIFTY 50",
    timeframe="1Day",
    start_date=datetime.now() - timedelta(days=30),
    symbol_type="Index",
    segment="IDX"  # Filter to indices only
)

# Search with segment filtering
result = nse.search_charting_symbol("RELIANCE", segment="EQ")  # Equity only

# Get futures data
fo_result = nse.search_charting_symbol("NIFTY", segment="FO")  # F&O only

Original Project

This fork is based on the excellent work by Sampad Hegde:

Installation

Install This Fork

pip install Bharat-sm-data-avinash

Install Original Package

pip install Bharat-sm-data

!!! Disclaimer !!!

Disclaimer: Use Caution and Consider Legal Implications This project employs third-party private APIs and deals with stock market investing, both of which come with inherent risks and legal considerations. Users must ensure they have the appropriate permissions to use the data obtained from these APIs to avoid potential copyright issues. Additionally, stock market investing carries financial risks, and users should exercise caution, conduct thorough research, and seek professional advice before making investment decisions. The accuracy of third-party data cannot be guaranteed, and this project does not offer financial advice. Users are responsible for complying with all applicable laws and regulations, and any unauthorized or illegal use may lead to legal consequences. This package is strictly for educational purposes, and any practical applications should be done with careful consideration of the aforementioned risks. By using this project, users acknowledge and accept these risks and responsibilities, with the project developers and contributors not liable for any damages, legal issues, or financial losses resulting from its use. It is essential to exercise caution and seek legal and financial advice when necessary.

Library Description

📈 Explore the dynamic world of the Indian Stock Market with our powerful open-source stock market scraping library. Effortlessly access real-time and historical data for derivatives, equities, currencies, commodities, ETFs, and more, enabling you to make informed investment decisions, develop trading strategies, and stay ahead of market trends. Our user-friendly API facilitates seamless integration, making it a valuable tool for traders, investors, and data enthusiasts. Join Me in harnessing the power of data to unlock new opportunities in the ever-evolving landscape of the Indian financial markets. Start scraping today and gain a competitive edge in your financial ventures! 💼📊🚀

Documentation : Readthedoc

Table of Contents

Important Note:

Pass  `is_index=true` whenever calling get_ohlc function for any Indices, Future Contracts and Options Contracts

Installation

Install the package using this command

pip install Bharat-sm-data

Usage

Read the Documentation here: Readthedoc

Quick Start - NSE Charting API v2 (NEW in v4.1.0)

from Bharat_sm_data.Base.NSEBase import NSEBase
from datetime import datetime, timedelta

# Initialize
nse = NSEBase()

# Get historical data for NIFTY 50
df = nse.get_ohlc_from_charting_v2(
    symbol="NIFTY 50",
    timeframe="1Day",
    start_date=datetime.now() - timedelta(days=30),
    end_date=datetime.now(),
    symbol_type="Index",
    segment="IDX"  # Filter to indices only
)

# Search for symbols with filtering
result = nse.search_charting_symbol("RELIANCE", segment="EQ")  # Equity only

# Get futures data
result = nse.search_charting_symbol("NIFTY", segment="FO")  # F&O only
futures = [s for s in result['data'] if 'FUT' in s['symbol']]
df_futures = nse.get_ohlc_from_charting_v2(
    symbol=futures[0]['symbol'],
    timeframe="1Day",
    symbol_type="Futures",
    segment="FO"
)

Example Notebooks

Refer below example Jupyter Notebooks to get know how to use this library :

New API v2 Examples

Features

  • Some basic NSE Data:

    • Last Traded date of Exchange
    • Current Market Status (open/close) and a Nifty 50 current value.
    • Equity Meta data
    • NSE turn-over for the day
    • OHLC data
  • NEW: NSE Charting API v2 (Added in v4.1.0):

    • Dynamic symbol search with segment filtering
    • Historical OHLC data for all instrument types
    • Support for Index, Equity, Futures, and Options
    • Multiple timeframes (1Min to 1Month)
    • Segment filters: IDX (Index), EQ (Equity), FO (Futures & Options)
    • No mapping files required
    • Faster and more accurate data fetching
  • Technical Data:

    • Important NSE Reports
    • All indices data
    • Indices composites
    • OHLC of Indices & Equities
    • Trade Info of Equity
    • Corporate Disclosures
    • SME Data
    • SGB Data
    • ETF
    • Block Deals
    • VIX
  • Derivatives (Applicable for both Index and Equity options):

    • Options Expiry Dates
    • Option Chain
    • OHLC of Option contracts
    • PCR (Put Call Ratio)
    • List all Equities allowed for Derivative trading.
    • Option Trade info (Equities Only)
    • Trade Info of Futures
    • OHLC of Future Contracts
    • Currency and commodities Futures
    • Currency and commodities Future contracts OHLC
    • Option Chain with Greeks (From Sensibull)
  • Fundamentals :

    • Moneycontrol :
      • Mini Statements from Moneycontrol (some commonly used data out of annual reports of few timeframes)
        • overview
        • Income
        • Balance sheet
        • Cash flow
        • Ratios
      • Complete Statements (you get complete data of common reports of all annual/quarter reports)
        • Balance Sheet
        • P & L
        • Quarterly results (25th Percentile)
        • Half-Yearly results (50th Percentile)
        • Nine months (75th Percentile)
        • Yearly results (100th percentile)
        • Cash Flow Statement
        • Ratios
        • Capital Structure
    • Tickertape
      • Index Constituents (Tickertape)
      • Annual Report/ Quarterly Results extracted data
        • Income
        • Balance Sheet
        • Cash flow
      • Peers Comparison (Technical Bsed and Valuation Based)
      • Tickertape Scorecard
      • Share Holding Pattern
      • Mutual Fund Holdings
      • Small Case Holdings
      • Dividend History (paid out + Upcoming which is confirmed)
      • Key Ratios of Stocks and Indices
      • All ETFs under an Index
      • Tickertape Screeners
    • BSE :
      • Download Annual Reports in PDF format

License

This project is licensed under the Apache License. See the LICENSE for more details.

Acknowledgments

Contact

Fork Maintainer

Original Author

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

bharat_sm_data_avinash-4.1.0.tar.gz (41.8 kB view details)

Uploaded Source

Built Distribution

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

bharat_sm_data_avinash-4.1.0-py3-none-any.whl (42.6 kB view details)

Uploaded Python 3

File details

Details for the file bharat_sm_data_avinash-4.1.0.tar.gz.

File metadata

  • Download URL: bharat_sm_data_avinash-4.1.0.tar.gz
  • Upload date:
  • Size: 41.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for bharat_sm_data_avinash-4.1.0.tar.gz
Algorithm Hash digest
SHA256 523eed9087dd0c24b6ae675fc4eda8dc82de57a2b4890ced5a5c5dfd0af02c8f
MD5 7fb9da121a83f07bc5c6dd018d488369
BLAKE2b-256 16b03c61a7ece12e54df1277724a554254d5138acca9408497d90e1832bcb76b

See more details on using hashes here.

File details

Details for the file bharat_sm_data_avinash-4.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bharat_sm_data_avinash-4.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 04ddec4fcb62b1218fbe9eff7287bf98be6d3de412d3128c946f5c62f0f01255
MD5 a6d2e091c0d39170bcd84405eca80de3
BLAKE2b-256 37d5dedd71e02a323ab18f2421ed2efe051a56eaae757a5b64061326d8bfb5a4

See more details on using hashes here.

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