Skip to main content

Download NSE Bhavcopy Data

Project description

bhavopy Python Package

This package provides a Python interface to download National Stock Exchange (NSE) bhavcopy data for Equities, Indices and Derivatives. The package provides functions to download daily bhavcopy data in CSV format, store the data in local storage, and update the data for any missing dates.

Basically it creates csv file for equities, indices and derivatives, If the file already exist on assigned directory, then the code attempts to figure out missing dates and update the same file. all you have to do is update the start and end date.

and all this can be done by simply providing following arguements:

pip install bhavcopy

import bhavcopy

# Place data need to be stored.

data_storage = “D:\bhav_data”

# Define working directory, where files would be saved

os.chdir(data_storage)

# Define start and end dates, and convert them into date format

start_date = datetime.date(2023, 3, 1)

end_date = datetime.date(2023, 3, 21)

# Define wait time in seconds to avoid getting blocked

wait_time = [1, 2]

# Instantiate bhavcopy class for equities, indices, and derivatives

nse = bhavcopy(“indices”, start_date, end_date, data_storage, wait_time)

nse.get_data()

nse = bhavcopy(“equities”, start_date, end_date, data_storage, wait_time)

nse.get_data()

nse = bhavcopy(“derivatives”, start_date, end_date, data_storage, wait_time)

nse.get_data()

Project details


Release history Release notifications | RSS feed

This version

3.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bhavcopy-3.0.tar.gz (4.9 kB view details)

Uploaded Source

File details

Details for the file bhavcopy-3.0.tar.gz.

File metadata

  • Download URL: bhavcopy-3.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for bhavcopy-3.0.tar.gz
Algorithm Hash digest
SHA256 1b071d97bc27baf834003d4f49d92dceeb5759a00419cfea0418b0dca99432a4
MD5 af2953c0b06e868e4a6d049e95d114e2
BLAKE2b-256 391d50e67843584df397f9344f645fbdfd365794239ea0becd3a76e7f3cbf02a

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 Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page