Name | pnsea JSON |
Version |
0.1.9
JSON |
| download |
home_page | https://github.com/theonlyanil/nsepy |
Summary | A Python library for accessing data from the National Stock Exchange (NSE) of India. |
upload_time | 2025-03-18 11:35:12 |
maintainer | None |
docs_url | None |
author | Anil Sardiwal |
requires_python | >=3.6 |
license | None |
keywords |
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# PNSEA - Python NSE API
## Overview
PNSEA is a Python library for fetching data from the National Stock Exchange of India (NSE). It provides easy access to stock market data, options chains, insider trading reports, mutual fund data, and more.
## Features
- Fetch real-time equity data (CMP, historical data, market status, etc.).
- Get insider trading reports, pledged data, and SAST data.
- Retrieve option chain data for stocks and indices.
- Fetch mutual fund insider data.
- Autocomplete search queries for NSE symbols.
- Endpoint tester for API debugging.
## Installation
```bash
pip install pnsea
```
## Usage
### Initialize the NSE Instance
```python
from pnsea import NSE
nse = NSE()
```
### Fetch Equity Data
```python
# Get current market price of SBIN
print(nse.equity.info("SBIN")['priceInfo']['lastPrice'])
# Fetch historical data
print(nse.equity.history("ESCORTS", "01-02-2025", "14-02-2025"))
# Get market status
print(nse.equity.market_status())
```
### Fetch Insider Trading Data
```python
# Get general insider trading data
print(nse.insider.insider_data())
# Get insider trading data with date range
print(nse.insider.insider_data(from_date="11-12-2023", to_date="14-02-2025"))
# Get insider trading data for a specific company
print(nse.insider.insider_data("SBIN"))
# Get insider trading data for a specific company with date range
print(nse.insider.insider_data("INFY", from_date="11-12-2023", to_date="14-02-2025"))
# Get pledged data for a single company
print(nse.insider.getPledgedData("ESCORTS"))
# Get SAST data for a single company
print(nse.insider.getSastData("ESCORTS"))
# Get SAST data for a single company with date range
print(nse.insider.getSastData("INFY", from_date="01-01-2024", to_date="01-02-2025"))
```
### Options Expiry Dates
```python
# All expiries from symbol
print(nse.options.expiry_dates("NIFTY"))
```
### Fetch Option Chain Data
```python
# Get option chain for NIFTY - all data
print(nse.options.option_chain("NIFTY")[0])
# Get option chain for NIFTY - by expiry date
print(nse.options.option_chain("NIFTY", expiry_date="06-Mar-2025")[0])
# Get option chain for NIFTY - by strike price
print(nse.options.option_chain("NIFTY", strike_price=22000)[0])
# Get option chain for NIFTY - by expiry date & strike price
print(nse.options.option_chain("NIFTY", expiry_date="06-Mar-2025", strike_price=22000)[0])
# Get option chain for NIFTY - All Expiries
print(nse.options.option_chain("NIFTY")[1])
# Get option chain for NIFTY - Underlying Value
print(nse.options.option_chain("NIFTY")[2])
```
### Fetch Mutual Fund Data
```python
#Get mutual fund insider data with date range
print(nse.mf.mf_insider_data(from_date="01-02-2025", to_date="02-02-2025"))
#Get mutual fund insider data by ISIN
print(nse.mf.mf_insider_data(isin="INF879O01027"))
#Get mutual fund insider data by symbol
print(nse.mf.mf_insider_data(symbol="PPFAS Mutual Fund"))
```
### Autocomplete Search
```python
# Search for NSE symbols
print(nse.autocomplete("Info"))
```
## Author
Written by Anil Sardiwal
## License
MIT License
Raw data
{
"_id": null,
"home_page": "https://github.com/theonlyanil/nsepy",
"name": "pnsea",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Anil Sardiwal",
"author_email": "theonlyanil@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/43/6b/456e30a0c842404b0babaf990413bcc4137a568d0d48450809423ab59b35/pnsea-0.1.9.tar.gz",
"platform": null,
"description": "# PNSEA - Python NSE API\n\n## Overview\nPNSEA is a Python library for fetching data from the National Stock Exchange of India (NSE). It provides easy access to stock market data, options chains, insider trading reports, mutual fund data, and more.\n\n## Features\n- Fetch real-time equity data (CMP, historical data, market status, etc.).\n- Get insider trading reports, pledged data, and SAST data.\n- Retrieve option chain data for stocks and indices.\n- Fetch mutual fund insider data.\n- Autocomplete search queries for NSE symbols.\n- Endpoint tester for API debugging.\n\n## Installation\n```bash\npip install pnsea\n```\n\n## Usage\n\n### Initialize the NSE Instance\n```python\nfrom pnsea import NSE\n\nnse = NSE()\n```\n\n### Fetch Equity Data\n```python\n# Get current market price of SBIN\nprint(nse.equity.info(\"SBIN\")['priceInfo']['lastPrice'])\n\n# Fetch historical data\nprint(nse.equity.history(\"ESCORTS\", \"01-02-2025\", \"14-02-2025\"))\n\n# Get market status\nprint(nse.equity.market_status())\n```\n\n### Fetch Insider Trading Data\n```python\n# Get general insider trading data\nprint(nse.insider.insider_data())\n\n# Get insider trading data with date range\nprint(nse.insider.insider_data(from_date=\"11-12-2023\", to_date=\"14-02-2025\"))\n\n# Get insider trading data for a specific company\nprint(nse.insider.insider_data(\"SBIN\"))\n\n# Get insider trading data for a specific company with date range\nprint(nse.insider.insider_data(\"INFY\", from_date=\"11-12-2023\", to_date=\"14-02-2025\"))\n\n# Get pledged data for a single company\nprint(nse.insider.getPledgedData(\"ESCORTS\"))\n\n# Get SAST data for a single company\nprint(nse.insider.getSastData(\"ESCORTS\"))\n\n# Get SAST data for a single company with date range\nprint(nse.insider.getSastData(\"INFY\", from_date=\"01-01-2024\", to_date=\"01-02-2025\"))\n```\n\n### Options Expiry Dates\n```python\n# All expiries from symbol\nprint(nse.options.expiry_dates(\"NIFTY\"))\n```\n\n### Fetch Option Chain Data\n```python\n# Get option chain for NIFTY - all data\nprint(nse.options.option_chain(\"NIFTY\")[0])\n\n# Get option chain for NIFTY - by expiry date\nprint(nse.options.option_chain(\"NIFTY\", expiry_date=\"06-Mar-2025\")[0])\n\n# Get option chain for NIFTY - by strike price\nprint(nse.options.option_chain(\"NIFTY\", strike_price=22000)[0])\n\n# Get option chain for NIFTY - by expiry date & strike price\nprint(nse.options.option_chain(\"NIFTY\", expiry_date=\"06-Mar-2025\", strike_price=22000)[0])\n\n# Get option chain for NIFTY - All Expiries\nprint(nse.options.option_chain(\"NIFTY\")[1])\n\n# Get option chain for NIFTY - Underlying Value\nprint(nse.options.option_chain(\"NIFTY\")[2])\n```\n\n### Fetch Mutual Fund Data\n```python\n#Get mutual fund insider data with date range\nprint(nse.mf.mf_insider_data(from_date=\"01-02-2025\", to_date=\"02-02-2025\"))\n\n#Get mutual fund insider data by ISIN\nprint(nse.mf.mf_insider_data(isin=\"INF879O01027\"))\n\n#Get mutual fund insider data by symbol\nprint(nse.mf.mf_insider_data(symbol=\"PPFAS Mutual Fund\"))\n```\n\n\n### Autocomplete Search\n```python\n# Search for NSE symbols\nprint(nse.autocomplete(\"Info\"))\n```\n\n## Author\nWritten by Anil Sardiwal\n\n## License\nMIT License\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python library for accessing data from the National Stock Exchange (NSE) of India.",
"version": "0.1.9",
"project_urls": {
"Homepage": "https://github.com/theonlyanil/nsepy"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "43c0e3872959f510cebd3d8308e08935468bf0940671eac6748993e955acd16c",
"md5": "8fc1b69d1f52d9481845bebf10e2649b",
"sha256": "7340054ca30ce6d7c833869600a4a7282096cb39fad343a24e9887a7be804936"
},
"downloads": -1,
"filename": "pnsea-0.1.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8fc1b69d1f52d9481845bebf10e2649b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 10348,
"upload_time": "2025-03-18T11:35:08",
"upload_time_iso_8601": "2025-03-18T11:35:08.887799Z",
"url": "https://files.pythonhosted.org/packages/43/c0/e3872959f510cebd3d8308e08935468bf0940671eac6748993e955acd16c/pnsea-0.1.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "436b456e30a0c842404b0babaf990413bcc4137a568d0d48450809423ab59b35",
"md5": "33278325db9ce21f60ac9d719a4621c3",
"sha256": "5f3978b5c5916a1ffdb8bc6bbd7a72a2478b90f77e1657b3ab0082747c2a886c"
},
"downloads": -1,
"filename": "pnsea-0.1.9.tar.gz",
"has_sig": false,
"md5_digest": "33278325db9ce21f60ac9d719a4621c3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 7699,
"upload_time": "2025-03-18T11:35:12",
"upload_time_iso_8601": "2025-03-18T11:35:12.078262Z",
"url": "https://files.pythonhosted.org/packages/43/6b/456e30a0c842404b0babaf990413bcc4137a568d0d48450809423ab59b35/pnsea-0.1.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-03-18 11:35:12",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "theonlyanil",
"github_project": "nsepy",
"github_not_found": true,
"lcname": "pnsea"
}