Skip to main content

Efficient and Reliable Python Library for Scraping Real-Time and Historical Data of Stocks, Futures, Options and Indices From The NSE Exchange.

Project description

Simplest, Cleanest and Efficient Python Library to Scrape Stocks, FnO & Indices Data From The NSEIndia(New) and NiftyIndices Website.

nsemine is a Python library designed to provide a clean and straightforward interface for scraping data from the National Stock Exchange of India (NSE) and the Nifty Indices website. It aims to simplify the process of retrieving various market data, including indices, stock information, futures & options data, and general NSE-related utilities. This library is built to be efficient and user-friendly, catering to developers, traders, investors who need reliable NSE data for financial analysis, algorithmic trading, and data visualization.

Features

  • Asynchronous Data Retrieval:  Experience non-blocking, asynchronous data retrieval for optimal performance. Leverage the power of asyncio to fetch market data without delays, ensuring your applications remain responsive.

  • High-Speed Data Acquisition:  Utilize the speed and efficiency of aiohttp and requests under the hood. This library is designed for rapid data acquisition, enabling you to get the latest market insights quickly.

  • Unparalleled Data Flexibility:   nsemine empowers you with the complete data manipulation. Choose between the raw, unfiltered API response for maximum customization, OR leverage our intelligently processed data structures for streamlined analysis and immediate insights.

  • Intelligent Built-in Caching:  Minimize API requests with the intelligent built-in caching mechanism. Reduce your reliance on the NSE API and save you from getting blocked by the NSE Anti-Scraper Robots.

  • Clean and Intuitive API:  Designed for simplicity and ease of use, the library provides a clean and intuitive API, allowing developers to quickly integrate NSE data into their projects.

  • Comprehensive Data Coverage:  Access a wide range of NSE data, including indices, stocks, futures, and options, all within a single, unified library.

  • Robust Error Handling:  Built with robust error handling to ensure your applications remain stable and resilient, even in challenging network conditions.

Installation

You can install nsemine by pip or via github.

pip install nsemine

OR

pip install git+https://github.com/kbizme/nsemine.git

Why I Built This Library

Well, there are several Python libraries available for scraping NSE data, I developed this library to address specific needs that were not adequately met by the existing solutions. I have used this library in my project. You can use it in yours.

  • Custom Data Requirements:   nsemine is tailored to retrieve specific data points and formats that were essential for the project, which may not be available in other libraries.

  • Unique Data Structures: The project required data in a particular structure and format, which this library delivers directly, eliminating the need for extensive post-processing.

  • Data Availability:   nsemine is designed to access and provide data that may not be available or easily accessible through other existing NSE scraping libraries.

  • Performance and Reliability: Optimized for speed and stability, ensuring reliable data retrieval, especially for real-time and high-frequency data. It uses numpy and pandas vectorized operations for faster data pre-processing. Most of the possible errors are handled with Exceptions, thus, even if any error occurs the application will remain stable.

  • Ease of Use:   nsemine aims to provide a simple and intuitive interface, making it easy for developers to integrate NSE data into their applications. This library is designed to offer a more specialized and efficient solution for users who require precise and customized NSE data.

Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues for bug fixes, feature requests, or improvements.

Documentation

Work in progress... Meanwhile, you may explore the library. ReadTheDocs style documentation will be added upon complete library build.

Basic Usage Example: from nsemine import nse, live, historical, fno

  1. get live stock and index quotes
  • quotes = live.get_stock_live_quotes(stock_symbol='TCS')
  • index_quote = live.get_index_live_price(index='NIFTY 50')
  1. You can download stock and index historical data from the historical module.
  2. NSE related any data is available on the nse module.
  3. FNO related data functions are available on fno module [in development].

TIP: You may get all the available function in each modules, by using a dot afte the module name, like this -> live. or -> nse. [Your IDE may highlight all the available functions, all functions contains comprehensive docstring] This is a workaround while the full documentation is ready.

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

nsemine-1.4.tar.gz (26.0 kB view details)

Uploaded Source

Built Distribution

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

nsemine-1.4-py3-none-any.whl (27.5 kB view details)

Uploaded Python 3

File details

Details for the file nsemine-1.4.tar.gz.

File metadata

  • Download URL: nsemine-1.4.tar.gz
  • Upload date:
  • Size: 26.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for nsemine-1.4.tar.gz
Algorithm Hash digest
SHA256 7e27dfb75599f4662f21fe2c3eb79d2ea9332a2d78d2ef73beb6940a580830b2
MD5 1cc0150468a6a672fefbb81522c68eaa
BLAKE2b-256 90bce28f4940559a8aea6138c0f77a443577e3292547ca9520b645130d63a8f0

See more details on using hashes here.

File details

Details for the file nsemine-1.4-py3-none-any.whl.

File metadata

  • Download URL: nsemine-1.4-py3-none-any.whl
  • Upload date:
  • Size: 27.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for nsemine-1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 73bc5a33a77a3428cd12366880c3ff3ae861b04f330167ea90db296dcd1e9c09
MD5 5f222cbfa8cf588d36b8839eef486c26
BLAKE2b-256 c938a9e0e96c32ef63e7c4651f340985ddd38c59dbc4d8ea0386eb4eba5a9165

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