bolster.data_sources.nisra.child_protection
NISRA Children’s Social Care — Child Protection Statistics Module.
This module provides access to Northern Ireland’s annual Children’s Social Care Statistics, focusing on the child protection chapter (referrals, investigations, registrations, and register characteristics).
- Data Coverage:
Children on the Child Protection Register (CPR) by age, sex, trust
CPR trend data from 31 March 2015 to present (annual snapshots)
Child Protection Referrals by trust and by referral source (2013/14–present)
Child Protection Investigations by type and trust (2015–present)
Category of abuse breakdowns (neglect, physical, sexual, emotional)
Registration duration on the CPR
- HSC Trusts:
Belfast, Northern, South Eastern, Southern, Western
- Data Source:
Department of Health Northern Ireland publishes annual Children’s Social Care Statistics covering the 12 months to 31 March each year. Child protection data is drawn from the Children Order Return (CPR series).
Source: https://www.health-ni.gov.uk/topics/childrens-services-statistics Article: https://www.health-ni.gov.uk/articles/child-protection-register
- Update Frequency:
Annual, typically published in October for the year ending 31 March.
Example
>>> from bolster.data_sources.nisra import child_protection as cp
>>> df = cp.get_latest_child_protection()
>>> sorted(df.columns.tolist())
['category', 'measure', 'notes', 'subcategory', 'value', 'year']
>>> # CPR trend data shows registrations back to 2015
>>> trend = df[df['measure'] == 'cpr_registrations_ni_total']
>>> 2015 in trend['year'].values
True
- Publication Details:
Frequency: Annual (year ending 31 March)
Published by: Department of Health, Community Information Branch
Latest: Children’s Social Care Statistics for Northern Ireland 2024/25
Source: https://www.health-ni.gov.uk/topics/childrens-services-statistics
Attributes
Functions
Find the latest Children's Social Care Statistics publication URL. |
|
|
Parse a Children's Social Care Statistics Excel file into long-format DataFrame. |
|
Download and parse the latest Children's Social Care Statistics. |
Validate child protection DataFrame and raise on structural issues. |
Module Contents
- bolster.data_sources.nisra.child_protection.HEALTH_NI_CHILDREN_ARTICLE = 'https://www.health-ni.gov.uk/articles/child-protection-register'[source]
- bolster.data_sources.nisra.child_protection.HEALTH_NI_BASE_URL = 'https://www.health-ni.gov.uk'[source]
- bolster.data_sources.nisra.child_protection.HSC_TRUSTS = ['Belfast', 'Northern', 'South Eastern', 'Southern', 'Western'][source]
- bolster.data_sources.nisra.child_protection.MEASURE_CPR_TOTAL = 'cpr_registrations_ni_total'[source]
- bolster.data_sources.nisra.child_protection.MEASURE_INVESTIGATIONS_TOTAL = 'investigations_ni_total'[source]
- bolster.data_sources.nisra.child_protection.get_child_protection_publication_url()[source]
Find the latest Children’s Social Care Statistics publication URL.
Scrapes the Department of Health child protection register article page to find the most recent annual publication, then extracts the Excel download link.
- Returns:
URL string for the latest Excel data file.
- Raises:
NISRAValidationError – If publication page cannot be fetched or no Excel link found.
- Return type:
Example
>>> url = get_child_protection_publication_url() >>> url.startswith("https://") True >>> url.endswith((".xlsx", ".XLSX", ".xls")) True
- bolster.data_sources.nisra.child_protection.parse_child_protection_file(file_path)[source]
Parse a Children’s Social Care Statistics Excel file into long-format DataFrame.
Extracts child protection data from the following tables: - Table 2.1: CPR snapshot (total registrations for latest year) - Table 2.2a: CPR registrations by trust, 2015–present - Table 2.5a: CPR by category of abuse, 2015–present - Table 2.9: Child protection referrals by trust, 2013/14–present - Table 2.12: Child protection investigations by trust, 2015–present
- Parameters:
file_path (str | pathlib.Path) – Path to the Excel file.
- Returns:
year (int), measure (str), category (str), subcategory (str), value (int), notes (str).
- Return type:
DataFrame with columns
- Raises:
NISRAValidationError – If the file cannot be parsed or contains no data.
- bolster.data_sources.nisra.child_protection.get_latest_child_protection(force_refresh=False)[source]
Download and parse the latest Children’s Social Care Statistics.
Fetches the most recent annual publication from the Department of Health and returns child protection data in long format.
- Parameters:
force_refresh (bool) – Force re-download even if cached (default: False).
- Returns:
year, measure, category, subcategory, value, notes.
- Return type:
DataFrame with columns
- Raises:
NISRAValidationError – If download or parsing fails.
- bolster.data_sources.nisra.child_protection.validate_child_protection_data(df)[source]
Validate child protection DataFrame and raise on structural issues.
Checks for: - Non-empty DataFrame - Required columns present - No negative values
- Parameters:
df (pandas.DataFrame) – DataFrame to validate.
- Returns:
The input DataFrame (unchanged) if validation passes.
- Raises:
NISRAValidationError – If any check fails.
- Return type: