bolster.data_sources.nisra.quarterly_employment_survey
NISRA Quarterly Employment Survey (QES) for Northern Ireland.
Provides quarterly employee job estimates for Northern Ireland by broad industry sector, both seasonally adjusted and unadjusted. The QES is used by the ONS as the primary source for NI estimates within UK-wide quarterly workforce statistics.
Sectors covered: - Manufacturing - Construction - Services - Other Industries - All Industries (total)
- Data Source:
Statistics page: https://www.nisra.gov.uk/statistics/work-pay-and-benefits/quarterly-employment-survey The module scrapes this page to find the latest quarterly supplementary tables, then downloads the Excel file.
Update Frequency: Quarterly (published ~2 weeks after reference quarter) Geographic Coverage: Northern Ireland Time Series: Q1 2005 to present (seasonally adjusted); Q1 2005 unadjusted
Example
>>> from bolster.data_sources.nisra import quarterly_employment_survey as qes
>>> df = qes.get_latest_qes()
>>> 'total_jobs' in df.columns
True
>>> growth = qes.get_qes_growth(df)
>>> 'total_yoy' in growth.columns
True
Attributes
Functions
Scrape the QES statistics page to find the latest supplementary tables Excel. |
|
|
Parse QES supplementary tables Excel file into long-format DataFrame. |
|
Get the latest NI Quarterly Employment Survey data. |
Validate QES DataFrame for basic integrity. |
|
|
Filter QES data to a specific year. |
|
Calculate quarter-on-quarter and year-on-year growth for total employee jobs. |
Calculate each sector's share of total employee jobs. |
Module Contents
- bolster.data_sources.nisra.quarterly_employment_survey.QES_STATS_URL = 'https://www.nisra.gov.uk/statistics/work-pay-and-benefits/quarterly-employment-survey'[source]
- bolster.data_sources.nisra.quarterly_employment_survey.QES_BASE_URL = 'https://www.nisra.gov.uk'[source]
- bolster.data_sources.nisra.quarterly_employment_survey.get_latest_qes_publication_url()[source]
Scrape the QES statistics page to find the latest supplementary tables Excel.
- Returns:
URL of the latest QES supplementary tables Excel file
- Raises:
NISRADataNotFoundError – If publication cannot be found
- Return type:
- bolster.data_sources.nisra.quarterly_employment_survey.parse_qes_file(file_path, adjusted=True)[source]
Parse QES supplementary tables Excel file into long-format DataFrame.
Reads Table 5.2 (seasonally adjusted) or Table 5.3 (unadjusted), which contain quarterly employee job counts by broad industry sector.
- Parameters:
file_path (str | pathlib.Path) – Path to downloaded QES supplementary tables Excel file
adjusted (bool) – If True, read Table 5.2 (seasonally adjusted). If False, read Table 5.3 (unadjusted).
- Returns:
date: Timestamp (first day of quarter)
year: int
quarter: int (1-4)
quarter_label: str (e.g. “Q1 2025”)
manufacturing_jobs: int
construction_jobs: int
services_jobs: int
other_jobs: int
total_jobs: int
adjusted: bool (True if seasonally adjusted)
- Return type:
DataFrame with columns
- Raises:
NISRAValidationError – If file structure is unexpected
- bolster.data_sources.nisra.quarterly_employment_survey.get_latest_qes(force_refresh=False, adjusted=True)[source]
Get the latest NI Quarterly Employment Survey data.
- Parameters:
- Returns:
date, year, quarter, quarter_label, manufacturing_jobs, construction_jobs, services_jobs, other_jobs, total_jobs, adjusted
- Return type:
DataFrame with columns
- Raises:
NISRADataNotFoundError – If latest publication cannot be found
NISRAValidationError – If file structure is unexpected
Example
>>> df = get_latest_qes() >>> 'total_jobs' in df.columns True
- bolster.data_sources.nisra.quarterly_employment_survey.validate_qes_data(df)[source]
Validate QES DataFrame for basic integrity.
- Parameters:
df (pandas.DataFrame) – DataFrame from get_latest_qes()
- Returns:
True if validation passes
- Raises:
NISRAValidationError – If validation fails
- Return type:
- bolster.data_sources.nisra.quarterly_employment_survey.get_qes_by_year(df, year)[source]
Filter QES data to a specific year.
- Parameters:
df (pandas.DataFrame) – DataFrame from get_latest_qes()
year (int) – Year to filter
- Returns:
Filtered DataFrame (up to 4 quarters)
- Return type:
Example
>>> df = get_latest_qes() >>> df_2024 = get_qes_by_year(df, 2024) >>> len(df_2024) <= 4 True
- bolster.data_sources.nisra.quarterly_employment_survey.get_qes_growth(df)[source]
Calculate quarter-on-quarter and year-on-year growth for total employee jobs.
- Parameters:
df (pandas.DataFrame) – DataFrame from get_latest_qes()
- Returns:
total_qoq: Total jobs quarter-on-quarter change (absolute)
total_yoy: Total jobs year-on-year % change
services_yoy: Services jobs year-on-year % change
manufacturing_yoy: Manufacturing jobs year-on-year % change
- Return type:
DataFrame with additional columns
Example
>>> df = get_latest_qes() >>> growth = get_qes_growth(df) >>> 'total_yoy' in growth.columns True
Calculate each sector’s share of total employee jobs.
- Parameters:
df (pandas.DataFrame) – DataFrame from get_latest_qes()
- Returns:
manufacturing_share: Manufacturing % of total
construction_share: Construction % of total
services_share: Services % of total
other_share: Other industries % of total
- Return type:
DataFrame with additional columns
Example
>>> df = get_latest_qes() >>> shares = get_sector_shares(df) >>> 'services_share' in shares.columns True