Client API Reference#

Asynchronous client in nse_xbrl_parser.client.

AsyncNSEClient#

class nse_xbrl_parser.client.nse_client.AsyncNSEClient(cookie_string=None, cache_dir=None)[source]#

Bases: object

Asynchronous client for downloading and parsing NSE XBRL disclosures.

Parameters:
  • cookie_string (Optional[str])

  • cache_dir (Optional[Path])

DEFAULT_USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'#
__init__(cookie_string=None, cache_dir=None)[source]#
Parameters:
  • cookie_string (str | None)

  • cache_dir (Path | None)

Return type:

None

async close()[source]#

Close client session.

Return type:

None

async download_bytes(url)[source]#

Download raw bytes from URL asynchronously.

Parameters:

url (str)

Return type:

bytes

async parse_url(url)[source]#

Download XBRL instance document from URL and parse it.

Parameters:

url (str)

Return type:

XBRLInstance

async parse_url_archive(zip_url)[source]#

Download ZIP archive from URL and parse all contained XBRL filings.

Parameters:

zip_url (str)

Return type:

List[XBRLInstance]

async get_taxonomy_schema(taxonomy_id)[source]#

Fetch schema for any of the 58 NSE taxonomies.

Parameters:

taxonomy_id (int)

async get_taxonomy_labels(taxonomy_id)[source]#

Fetch label dictionary for any of the 58 NSE taxonomies.

Parameters:

taxonomy_id (int)