nse-xbrl
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. Parse an XBRL Filing Asynchronously
import asyncio
from nse_xbrl_parser import parse_file, FinancialResultsModel
async def main():
# Parse any filing XML
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())
2. 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())
3. 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.1.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 | |
|---|---|---|---|
| nse_xbrl_parser-0.1.0.tar.gz | 22.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nse_xbrl_parser-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 53.9 kB
Release files / nse_xbrl_parser-0.1.0.tar.gz
| Download URL | nse_xbrl_parser-0.1.0.tar.gz |
|---|---|
| Size | 22.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1e39e84be007567425a61f0747b2061976275fd92d7fe0792c676323f1de1d05
|
|
BLAKE2b-256 checksum How to use checksums |
66a41db66740edfb1f23939537676addcdb367e5786799d5a826f5e489c20af6
|
| 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.1.0-py3-none-any.whl
| Download URL | nse_xbrl_parser-0.1.0-py3-none-any.whl |
|---|---|
| Size | 31.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
73db37266315f7b997a2e2fb88a240f26726778dd73b71f6112d03c302b29478
|
|
BLAKE2b-256 checksum How to use checksums |
778d03ebe5b5463423dc6f1152606108b9f558a2f96fcd7da539ef321770476f
|
| 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}
|