Coder Social home page Coder Social logo

soham874 / nsedt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pratik141/nsedt

0.0 0.0 0.0 407 KB

Library to collect NSE data in pandas dataframe

Home Page: http://nsedt.nse.pratikanand.co.in/

License: Apache License 2.0

Python 100.00%

nsedt's Introduction

NSE (national stock exchange) data

Introduction: This library serves as an api to fetch data from the NSE about stocks and indices and derivatives using python

Thank you for using Nsedt. Please feel free to send pull requests, comments, and suggestions, as well as get in touch with me if you require any additional help. I sincerely hope you will find this library useful.

For detailed doc please refer nse-doc

How to start

  1. clone the repository git clone https://github.com/pratik141/nsedt
  2. Install the requirements file after changing to cloned folder above pip install -r requirements.txt
  3. Install locally pip installl . --upgrade

Equity

Details

Name Module name Description Argument Response
companyinfo get_companyinfo Company info symbol , response_type json, panda df
marketstatus get_marketstatus marketstatus -- panda_df
price get_price price start_date, end_date, symbol, input_type json, panda df
corpinfo get_corpinfo corpinfo arg
event get_event event start_date, end_date panda df
chartdata get_chartdata chartdata symbol panda df
symbols_list get_symbols_list symbols_list -- json
asm_list get_asm_list symbols_list asm_type json

Now get_price work with start_date, end_date without datetime format it support %d-%m-%Y

step to run

from nsedt import equity as eq
from datetime import date

start_date = date(2023, 1, 1)
end_date = date(2023, 1, 10)
print(eq.get_price(start_date, end_date, symbol="TCS"))
start_date = "01-05-2023"
end_date = "03-05-2023"
print(eq.get_corpinfo(start_date, end_date, symbol="TCS"))
print(eq.get_event(start_date, end_date))
print(eq.get_event())
print(eq.get_marketstatus())
print(eq.get_marketstatus(response_type="json"))
print(eq.get_companyinfo(symbol="TCS"))
print(eq.get_companyinfo(symbol="TCS", response_type="json"))
print(eq.get_chartdata(symbol="TCS"))
print(eq.get_symbols_list()) #print the list of symbols used by NSE for equities
print(eq.get_asm_list(asm_type = "shortterm"))

Indices

Details

Name Module name Description Argument Response
price get_price price start_date, end_date, symbol panda df

step to run

from nsedt import indices as ind
from datetime import date

start_date = date(2023, 1, 1)
end_date = date(2023, 1, 10)
print(ind.get_price(start_date=start_date, end_date=end_date, symbol="NIFTY 50"))
data = ind.get_price(start_date=start_date, end_date=end_date, symbol="NIFTY")
# To change date format from '%d-%b-%Y' to '%Y-%m-%d'
data["Date"] = pd.to_datetime(data["Date"],format='%d-%b-%Y')

Derivatives

Details

Name Module name Description Argument Response
vix get_vix price start_date, end_date,columns_drop_list panda df
option chain get_option_chain get option price symbol,strikePrice,expiryDate panda df
option chain expiry date get_option_chain_expdate option chain expiry date symbol json
future price get_future_price get future price symbol, start_date, end_date, expiryDate,response_type, columns_drop_list panda df
future expiry date get_future_expdate future expiry date symbol json

step to run

from nsedt import derivatives as de
start_date = "01-09-2023"
end_date = "03-09-2023"
# date format "%d-%m-%Y"
print(de.get_vix(start_date, end_date))
print(de.get_option_chain_expdate(symbol="TCS"))
print(de.get_option_chain(symbol="TCS", strike_price=3300, expiry_date="expiryDate"))
print(de.get_future_price(symbol="TCS", start_date=start_date, end_date=end_date))
print(de.get_future_expdate(symbol="TCS"))

nsedt's People

Contributors

pratik141 avatar aaekay avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.