bolster.data_sources.nisra.business_register

NISRA NI Business Register (IDBR) Module.

Provides access to the annual count of VAT and/or PAYE registered businesses operating in Northern Ireland, sourced from the Inter-Departmental Business Register (IDBR). This is the only structured time-series of NI business stock.

Data Coverage:
  • By broad industry group: 2010-present

  • By legal status: 2010-present

  • By Local Government District (LGD): 2013-present

Data Source:
Publication page (year-specific):

https://www.nisra.gov.uk/publications/northern-ireland-business-activity-size-location-and-ownership-{year}

Direct file (year-specific):

https://www.nisra.gov.uk/system/files/statistics/{year}-06/IDBR-Publication-{year}.xlsx

Update Frequency:

Annual, published in June.

Example

>>> from bolster.data_sources.nisra import business_register
>>> df = business_register.get_latest_data()
>>> 'businesses' in df.columns
True

Attributes

logger

NISRA_BASE_URL

PUBLICATION_PAGE_TEMPLATE

FILE_URL_TEMPLATE

Functions

get_idbr_publication_url([year])

Find the IDBR publication Excel URL for a given (or latest) year.

get_businesses_by_industry([force_refresh])

Get annual business counts by broad industry group (Table 1.1).

get_businesses_by_legal_status([force_refresh])

Get annual business counts by legal status (Table 2.1).

get_businesses_by_lgd([force_refresh])

Get annual business counts by Local Government District (Table 3.1).

get_latest_data([force_refresh, level])

Get the latest NI Business Register (IDBR) data.

validate_data(df[, level])

Validate the IDBR DataFrame for internal consistency.

Module Contents

bolster.data_sources.nisra.business_register.logger[source]
bolster.data_sources.nisra.business_register.NISRA_BASE_URL = 'https://www.nisra.gov.uk'[source]
bolster.data_sources.nisra.business_register.PUBLICATION_PAGE_TEMPLATE = 'https://www.nisra.gov.uk/publications/northern-ireland-business-activity-size-location-and-owner...[source]
bolster.data_sources.nisra.business_register.FILE_URL_TEMPLATE = 'https://www.nisra.gov.uk/system/files/statistics/{year}-06/IDBR-Publication-{year}.xlsx'[source]
bolster.data_sources.nisra.business_register.get_idbr_publication_url(year=None)[source]

Find the IDBR publication Excel URL for a given (or latest) year.

Tries the direct, stable URL pattern first (year is incremented each publication). Falls back to scraping the year-specific publication page if the direct URL is not reachable.

Parameters:

year (int | None) – Publication year to look for. Defaults to trying the current year, then the previous year.

Returns:

Tuple of (excel_url, year).

Raises:

NISRADataNotFoundError – If no publication could be found.

Return type:

tuple[str, int]

Example

>>> url, year = get_idbr_publication_url()
>>> url.startswith('https://')
True
bolster.data_sources.nisra.business_register.get_businesses_by_industry(force_refresh=False)[source]

Get annual business counts by broad industry group (Table 1.1).

Parameters:

force_refresh (bool) – Force re-download even if cached.

Returns:

year, industry_group, businesses.

Return type:

DataFrame with columns

Get annual business counts by legal status (Table 2.1).

Parameters:

force_refresh (bool) – Force re-download even if cached.

Returns:

year, legal_status, sector, businesses.

Return type:

DataFrame with columns

bolster.data_sources.nisra.business_register.get_businesses_by_lgd(force_refresh=False)[source]

Get annual business counts by Local Government District (Table 3.1).

Parameters:

force_refresh (bool) – Force re-download even if cached.

Returns:

year, lgd, businesses.

Return type:

DataFrame with columns

bolster.data_sources.nisra.business_register.get_latest_data(force_refresh=False, level='industry')[source]

Get the latest NI Business Register (IDBR) data.

Parameters:
  • force_refresh (bool) – Force re-download even if cached.

  • level (str) – Breakdown level - ‘industry’ (default), ‘legal_status’, or ‘lgd’.

Returns:

DataFrame for the requested breakdown level. See get_businesses_by_industry(), get_businesses_by_legal_status(), and get_businesses_by_lgd() for column details.

Raises:

ValueError – If level is not one of ‘industry’, ‘legal_status’, or ‘lgd’.

Return type:

pandas.DataFrame

Example

>>> df = get_latest_data()
>>> 'businesses' in df.columns
True
bolster.data_sources.nisra.business_register.validate_data(df, level='industry')[source]

Validate the IDBR DataFrame for internal consistency.

Parameters:
  • df (pandas.DataFrame) – DataFrame as returned by get_latest_data().

  • level (str) – Validation mode matching the breakdown level - ‘industry’ (default), ‘legal_status’, or ‘lgd’.

Returns:

True if all checks pass.

Raises:
Return type:

bool

Example

>>> import pandas as pd
>>> df = pd.DataFrame({
...     "year": [2020, 2021], "industry_group": ["Retail", "Retail"],
...     "businesses": [5890.0, 6040.0],
... })
>>> validate_data(df)
True