NSE XBRL Parser Documentation#


nse-xbrl-parser is a modern, high-performance asynchronous Python 3.14 library designed to discover, download, parse, and normalize all XBRL filings and taxonomies published across the National Stock Exchange of India (NSE) and Bombay Stock Exchange (BSE).


Key Highlights#

🚀 Python 3.14 Async Native

Built from the ground up for asynchronous I/O using Python 3.14 native concurrency and lxml C-bindings. Non-blocking stream and batch processing.

📚 All 58 Taxonomies

Covers every single taxonomy category published by NSE & BSE—from Ind AS Financial Results to Shareholding Patterns, Corporate Governance, and Material Announcements.

🧩 Universal Parsing Engine

Automatically resolves contexts (instant, duration), units (INR, shares, pure), and dimensional segment qualifiers without requiring hard-coded rules per document.

🎯 Strongly Typed Adapters

Provides ergonomic Pydantic models for the most common filings: FinancialResultsModel, ShareholdingPatternModel, and CorporateGovernanceModel.

🔄 Taxonomy Registry & Caching

Built-in automated registry with on-demand schema (.xsd) and label linkbase (*-lab.xml) downloading and local caching.

🌐 Built-in Client

AsyncNSEClient provides automated downloading, session handling, and direct URL-to-model extraction.


Quick Example: Auto-Detect & Parse#

Give any XML filing (file path, raw XML string, or bytes) to parse or parse_sync, and it will automatically detect the filing type and return ready-to-use typed data:

import asyncio
from nse_xbrl_parser import parse, FilingFormat

async def main():
    # 1. Parse ANY filing XML - auto-detects format!
    filing = await parse("RELIANCE_Q3_Results.xml")

    # 2. Key Metadata & Auto-Detected Type
    print("Detected Category:", filing.format)
    print("Company:", filing.company_name)
    print("Scrip Code:", filing.scrip_code)

    # 3. Access Strongly-Typed Regulatory Data
    if filing.format == FilingFormat.FINANCIAL_RESULTS:
        print(f"Revenue: ₹{filing.data.revenue_from_operations:,.2f}")
        print(f"Profit After Tax: ₹{filing.data.profit_after_tax:,.2f}")
        print(f"Basic EPS: ₹{filing.data.basic_eps:.2f}")

    # Or convert directly to Python dictionary
    summary = filing.to_dict()

asyncio.run(main())

Next Steps#