nse-xbrl-parser
Modern Asynchronous Python 3.14 library for parsing XBRL Filing Information across all 58 taxonomies of the National Stock Exchange of India (NSE) and Bombay Stock Exchange (BSE).
Features
- Universal XBRL 2.1 & Dimensions Parser:
- Asynchronous stream and file parsing using Python 3.14 native
asyncioandlxml. - Automatically resolves contexts (
instant,duration), entity identifiers (CIN, Scrip Code), units (INR,shares, ratios), and dimensional segments. - Zero requirement for custom parsers per filing type—parses any NSE/BSE filing format.
- Asynchronous stream and file parsing using Python 3.14 native
- Coverage of all 58 NSE & BSE Taxonomies:
- Built-in catalog indexing all 58 taxonomies from NSE XBRL Information Portal.
- Automatically downloads and caches official schemas (
.xsd), label linkbases (*-lab.xml), calculations, and presentations.
- High-Level Typed Model Adapters:
FinancialResultsModel: Regulation 33 Financial Results (Ind AS,Banking,NBFC,Insurance,Integrated Filings).ShareholdingPatternModel: Regulation 31 Shareholding Patterns with promoter & public breakdown.CorporateGovernanceModel: Regulation 27(2) Board composition & committee details.
- Async HTTP Client (
AsyncNSEClient):- Automated download and extraction of filing ZIP packages and instance XML documents.
Installation
# Using uv (recommended)
uv add nse-xbrl-parser
# Or with pip
pip install nse-xbrl-parser
Quickstart
1. Auto-Detect and Parse Any Filing (Super-Simple Facade)
Give any XML file path, string, or bytes to parse (or parse_sync). The engine automatically detects the filing format and provides direct typed models:
import asyncio
from nse_xbrl_parser import parse, FilingFormat
async def main():
# Auto-detects Financial Results, Shareholding Pattern, Corporate Governance, etc.
filing = await parse("filing.xml")
print("Detected Category:", filing.format)
print("Company:", filing.company_name)
print("Scrip Code:", filing.scrip_code)
# Typed model is immediately available via .data
if filing.format == FilingFormat.FINANCIAL_RESULTS:
print(f"Revenue: ₹{filing.data.revenue_from_operations:,.2f}")
print(f"PAT: ₹{filing.data.profit_after_tax:,.2f}")
print(f"Basic EPS: ₹{filing.data.basic_eps:.2f}")
# Or serialize entire filing to dictionary
data_dict = filing.to_dict()
asyncio.run(main())
Synchronous one-liner:
from nse_xbrl_parser import parse_sync
filing = parse_sync("filing.xml")
print(filing.format, filing.company_name, filing.data)
2. Universal Fact Lookups & Core Parser
import asyncio
from nse_xbrl_parser import parse_file, FinancialResultsModel
async def main():
# Parse into low-level universal XBRLInstance
instance = await parse_file("RELIANCE_Financial_Results.xml")
# Universal Fact Lookups
print("Company:", instance.get_fact_value("NameOfTheCompany"))
print("Scrip Code:", instance.get_fact_value("ScripCode"))
print("Revenue:", instance.get_fact_float("RevenueFromOperations"))
# Convert to Strongly-Typed Model
results = FinancialResultsModel.from_instance(instance)
print(f"PAT: ₹{results.profit_after_tax:,.2f}")
print(f"EBITDA: ₹{results.ebitda:,.2f}")
print(f"Basic EPS: ₹{results.basic_eps:.2f}")
asyncio.run(main())
3. Inspect Any of the 58 NSE/BSE Taxonomies
import asyncio
from nse_xbrl_parser import TaxonomyRegistry, AsyncTaxonomyDownloader
async def main():
registry = TaxonomyRegistry()
# Total 58 taxonomies registered
print("Total Taxonomies:", registry.count())
# Get Regulation 31 Shareholding Pattern Taxonomy (ID 4)
shp_tax = registry.get_by_id(4)
print(shp_tax.name)
print("Download URL:", shp_tax.primary_taxonomy_url)
# Download schema & label linkbase on the fly
downloader = AsyncTaxonomyDownloader()
schema, linkbase = await downloader.load_taxonomy_metadata(shp_tax)
print(f"Total concepts declared: {len(schema.elements)}")
print("Human friendly label:", linkbase.get_label("PublicShareholdingAsAPercentageOfTotalNumberOfShares"))
asyncio.run(main())
4. Parse Shareholding Patterns & Corporate Governance
from nse_xbrl_parser import parse_xbrl_sync, ShareholdingPatternModel, CorporateGovernanceModel
xml_content = open("TCS_SHP.xml", "rb").read()
instance = parse_xbrl_sync(xml_content)
shp = ShareholdingPatternModel.from_instance(instance)
print(f"Promoter Holding: {shp.promoter_holding_percentage}%")
print(f"Public Holding: {shp.public_holding_percentage}%")
Supported Taxonomies (All 58 Categories)
Regulation 13 (3)- Statement of Investor complaintsInvestor complaints- REITs / InvITsRegulation 27 (2)- Corporate GovernanceRegulation 31- Shareholding PatternReconciliation of Share Capital AuditRegulation 33- Financial Results - Ind AS & Integrated FilingRegulation 33- Financial Results - Other than BanksRegulation 33- Financial Results - REITs / InvITsRegulation 33- Financial Results - General InsuranceRegulation 33- Financial Results - Life InsuranceRegulation 33- Financial Results - BankingRegulation 33- Financial Results - NBFCRegulation 44- Voting ResultsRegulation 7(2) & 7(3)- Insider TradingRegulation 32 (1)- Statement of Deviation/VariationRegulation 24A- Secretarial Compliance ReportRegulation 60- Record Date / Book ClosureUnit Holding PatternRegulation 23 (9)- Related Party TransactionsBusiness Responsibility and Sustainability Reporting (BRSR)Credit RatingDefault History InformationInterest PaymentRedemption PaymentRegulation 50- Prior Intimation of Board MeetingRegulation 29- Prior Intimation of Board MeetingRegulation 30- Change in Directors / KMP / SMP / AuditorRegulation 30- Acquisitions / Scheme of Arrangement / RestructuringRegulation 30- Outcome of Board Meeting (Dividend, Bonus, Buyback)Regulation 30- Issuance / Forfeiture / Alteration of SecuritiesRegulation 30- Material Agreements / Joint VenturesRegulation 30- Fraud / Defaults / ArrestsRegulation 30- One Time Settlement (OTS)Regulation 30- Resolution Plan / Debt RestructuringRegulation 30- Notice of Shareholders MeetingRegulation 30- Closure of Trading WindowRegulation 39- Loss of Share Certificate / Duplicate IssueRegulation 30- Corporate Insolvency Resolution Process (CIRP)Regulation 33- Statement on Impact of Audit QualificationsInsider Trading PlanIntegrated Filing - GovernanceRegulation 30- Awarding / Bagging of OrdersISD- Buy-back from Open Market RouteISD- Buy-back through Tender Offer RouteInitial Public Offer (IPO)- In-principleADR / GDR- In-principle and Post AllotmentFCCB- In-principle and Post AllotmentPreferential Issue- In-principle and Post AllotmentQIP- In-principle and Post AllotmentRights Issue- In-principle and Post AllotmentInitial Public Offer (IPO)- Final ListingResignation of Director / KMP / SMP / Compliance OfficerRegulation 30- Resignation of Statutory AuditorRegulation 30- Forensic AuditRegulation 30- Actions initiated / taken or orders passedRegulation 30- Analyst / Investor MeetViolation of Code of Conduct(Insider Trading)Regulation 30- Para B of Part A of Schedule III
Testing
uv run pytest
Metadata
Release files for nse-xbrl-parser 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nse_xbrl_parser-0.2.0.tar.gz | 25.3 kB | Without provenance | Details for nse_xbrl_parser-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nse_xbrl_parser-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for nse_xbrl_parser-0.2.0-py3-none-any.whl |
Total release size: 61.0 kB
Release files / nse_xbrl_parser-0.2.0.tar.gz
| Download URL | nse_xbrl_parser-0.2.0.tar.gz |
|---|---|
| Size | 25.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8a422f1e375f8463cc5faae74b91227d4409ef510816064d10631b6817b2a148
|
|
BLAKE2b-256 checksum How to use checksums |
59350d2b07ff5e2a90d96e0d5159ddc506df2d7a49e69d902f93ce2b0263ae5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / nse_xbrl_parser-0.2.0-py3-none-any.whl
| Download URL | nse_xbrl_parser-0.2.0-py3-none-any.whl |
|---|---|
| Size | 35.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
72490b1c39d7311af5708ceca32fd5c06ecb5e10f1f5b91976acc564dd48049a
|
|
BLAKE2b-256 checksum How to use checksums |
8ad548011397e71481b579ddc3cc25a87a7e97397bed7ac70cdef1a9e58ca83b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for nse-xbrl-parser 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.