Education statistics
The uk_open_data.education module loads the Department for Education's
figures from Explore education statistics,
through its statistics API.
They cover England: pupil absence and attendance, attainment, special
educational needs, children in need, destinations after school and more, by
council and other areas.
Not every release on Explore education statistics is in the API. On 30 November 2026 it offered 25 publications.
Finding a data set
DfE groups its figures into publications, such as "Pupil absence in schools in England", and each publication into data sets. List the publications, then a publication's data sets:
from uk_open_data.education import list_data_sets, list_publications
publications = list_publications()
publications[["id", "title"]]
data_sets = list_data_sets("cbbd299f-8297-44bc-92ac-558bcf51f8ad") # pupil absence
data_sets[["id", "title", "geographic_levels", "last_period"]]
list_publications() gives each publication's id, title, summary and
last_published. list_data_sets(publication) gives each data set's id and
title, and what its newest version offers:
| Column | What it holds |
|---|---|
geographic_levels |
The levels of area it has figures for, such as ["Local authority", "National", "Regional"] |
first_period, last_period |
The first and last time periods, such as "2006/07" and "2024/25" |
filters |
The ways its figures are broken down, such as ["Absence type", "School type"] |
indicators |
The figures it holds, such as ["Count of pupil enrolments", "Percentage of pupil enrolments"] |
Both are pandas or polars tables, whichever you have.
describe_data_set()
list_data_sets names filters and indicators as DfE labels them, and
load_education names its columns as DfE's own files do. describe_data_set
gives both, so you can tell which column each will become before you load it:
from uk_open_data.education import describe_data_set
describe_data_set("019d209c-08dc-74b6-9edb-52d521406fcf")
| kind | column | label | id |
|---|---|---|---|
| filter | absence_type |
Absence type | daL0Z |
| filter | phase_type_grouping |
School type | OS5CL |
| indicator | enrolment_count |
Count of pupil enrolments | emgou |
| indicator | enrolment_percent |
Percentage of pupil enrolments | TuAuP |
It reads the data set's newest version, as load_education does.
load_education takes an indicator by its column, its label or its id.
load_education()
from uk_open_data.education import load_education
absence = load_education("019d209c-08dc-74b6-9edb-52d521406fcf")
absence[["geography_name", "absence_type", "enrolment_percent"]]
It loads one time period of a data set, for every area at one level. It returns one row per area and combination of filters:
| Column | What it holds |
|---|---|
geography_code |
The area's code, as DfE gives it, which joins to boundaries and statistics |
geography_name |
The area's name, as DfE gives it |
level |
The level's code, such as LA |
time_period |
The time period, such as "2024/25" |
| One column per filter | The filter's option for the row, by name, such as "Persistent absence" |
| One column per indicator | The figure, as a number |
Filters and indicators have DfE's own column names, the headers of its CSV
files, such as absence_type and enrolment_percent. list_data_sets shows
their longer names, such as "Absence type" and "Percentage of pupil
enrolments".
Choose what to load with:
level: the level of the areas, by its code or its name. The default is"LA", the local authorities. Others include"NAT"for England,"REG"for regions,"LAD"for local authority districts and"PCON"for parliamentary constituencies, where a data set has them.time_period: named aslist_data_setsnames it, such as"2023/24"or"2026 Week 45". The default is the latest, thelast_periodthatlist_data_setsshows. If a name fits periods of more than one kind, such as an academic and a financial year, choose one as period|code, such as"2024/2025|AY"; the error says which there are.indicators: a name, id or column name, or a list of them, such as["enrolment_count", "enrolment_percent"]. The default is every one.
If the data set does not offer the level, time period or indicator you asked
for, or a name fits more than one, or you give an empty list of indicators,
the loader fails with a ValueError that lists what it does offer.
Each call asks the API afresh, and reads every page of the answer. Nothing is
held in memory. A row whose area has no code in the data set's own description
is kept, with geography_code missing, and the loader logs a warning saying
how many there are.
Local authorities
DfE's "local authority" is the upper-tier council, which runs schools and
children's services: unitary authorities, metropolitan and London boroughs,
and county councils (codes starting E10). There are 153 of them. A county is
made of several district councils, which
local_authority_lookup("county")
lists.
The loader keeps DfE's codes as they are. In the persistent absence data set
for 2024/25, 151 of the 153 match today's councils. Barnsley and Sheffield
still have the codes they had before April 2025, E08000016 and E08000019.
Older years have the councils of their time, which
current_code brings to today's.
Figures DfE does not give
DfE marks a figure it does not give with a symbol. The loader makes each one missing (null), never zero:
| Symbol | Meaning |
|---|---|
z |
Not applicable, such as a percentage for the total row |
x, or the older : |
Not available |
c |
Held back to protect people's privacy |
low or k, or the older ~ |
Rounds to 0, but is not 0 |
u |
Of low reliability |
Any other value that is not a number is missing too, and the loader logs a warning naming the indicator and the values. An indicator none of whose values is a number, such as the reference date in the attendance data sets, keeps its text.
What is left out
- Schools and other organisations. Some data sets have a row per school,
with its URN, or per provider, institution, multi-academy trust or sponsor.
These are records rather than figures for areas, and the loader refuses
those levels with a
ValueError. Reading them needs a design of its own. - Older versions of a data set. The loader reads the newest version, and names it in every request, so the figures and their names come from the same version even if DfE publishes a new one part way through. DfE numbers each version and keeps the old ones, so an older version could be asked for if someone needs it.
- The CSV download, and queries that combine conditions. The API offers both. The loader asks for one level and one time period at a time.
The source and how to credit it
| Publisher | Department for Education |
| Coverage | England. Each publication has its own years and timetable |
| Licence | Open Government Licence v3.0, unless a data set says otherwise |
| Credit | Source: Department for Education, Explore education statistics, |
The loader fails with a ValueError naming DfE and the data set if DfE has no
data set with that id, if the API's answers lose a field it reads, or if the
data set has no published version.
list_datasets() lists it as dfe-education-statistics, and a weekly check
lists the publications and loads one data set to make sure the API still
answers.