Dataset Viewer (First 5GB)
Auto-converted to Parquet Duplicate
id
stringlengths
10
23
title
stringlengths
1
105k
type
stringclasses
15 values
year
int64
1.42k
2.03k
number
int64
1
9,780B
text_content
stringlengths
21
2.29M
xml_content
stringlengths
2.03k
21.4M
publication_date
timestamp[s]date
1991-02-01 00:00:00
2025-09-21 00:00:00
enacted_date
timestamp[s]date
196-05-16 00:00:00
2025-09-16 00:00:00
coming_into_force_date
timestamp[s]date
1990-04-01 00:00:00
2025-09-30 00:00:00
extent
listlengths
1
5
status
stringclasses
3 values
sections
listlengths
0
3.07k
metadata
dict
url
stringlengths
40
60
checksum
stringlengths
32
32
ukpga_2025_23
Working Time Regulations (Northern Ireland) 2016
ukpga
2,025
23
Armed Forces Commissioner Act 2025 Armed Forces Commissioner Armed Forces Commissioner 1 1 After section 365A of the Armed Forces Act 2006 (referred to in this Act as “ AFA 2006 ”) insert— Armed Forces Commissioner Armed Forces Commissioner 365AA 1 There is to be an Armed Forces Commissioner. 2 The functions of the Com...
<Legislation xmlns="http://www.legislation.gov.uk/namespaces/legislation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" DocumentURI="http://www.legislation.gov.uk/ukpga/2025/23/2025-09-03" IdURI="http://www.legislation.gov.uk/id/ukpga/2025/23" NumberOfProvisions="55" RestrictStartDate="2025-09-03" xsi:schemaLoc...
2025-09-03T00:00:00
2025-09-03T00:00:00
2025-09-03T00:00:00
[ "E", "W", "S", "N.I." ]
revised
[ { "id": "section-1", "number": "http://www.legislation.gov.uk/ukpga/2025/23/section/1/2025-09-03", "title": "", "content": "1 1 After section 365A of the Armed Forces Act 2006 (referred to in this Act as “ AFA 2006 ”) insert— Armed Forces Commissioner Armed Forces Commissioner 365AA 1 There is to be...
{ "classification": "", "title": "Working Time Regulations (Northern Ireland) 2016" }
http://www.legislation.gov.uk/ukpga/2025/23/2025-09-03
0d80bfe742ca8ccfaa45f3d7988f9824
ukpga_2025_22
Legacy employment and support allowance
ukpga
2,025
22
"Universal Credit Act 2025 Universal credit Standard allowance for tax years 2026-27 to 2029-30 1 1 (...TRUNCATED)
"<Legislation xmlns=\"http://www.legislation.gov.uk/namespaces/legislation\" xmlns:xsi=\"http://www.(...TRUNCATED)
2025-09-03T00:00:00
2025-09-03T00:00:00
2025-09-03T00:00:00
[ "E", "W", "S", "N.I." ]
revised
[{"id":"section-1","number":"http://www.legislation.gov.uk/ukpga/2025/22/section/1/2025-09-03","titl(...TRUNCATED)
{ "classification": "", "title": "Legacy employment and support allowance" }
http://www.legislation.gov.uk/ukpga/2025/22/2025-09-03
2c4237bfe715b1d133d13399cb1c2033
ukpga_2025_13
Extent, commencement and short title
ukpga
2,025
13
"Steel Industry (Special Measures) Act 2025 Meaning of “steel undertaking” 1 In this Act, “ st(...TRUNCATED)
"<Legislation xmlns=\"http://www.legislation.gov.uk/namespaces/legislation\" xmlns:xsi=\"http://www.(...TRUNCATED)
2025-04-12T00:00:00
2025-04-12T00:00:00
2025-04-12T00:00:00
[ "E", "W" ]
revised
[{"id":"section-1","number":"http://www.legislation.gov.uk/ukpga/2025/13/section/1/2025-04-12","titl(...TRUNCATED)
{ "classification": "", "title": "Extent, commencement and short title" }
http://www.legislation.gov.uk/ukpga/2025/13/2025-04-12
73874da7533b027d9af46ec5eb4fa7d6
ukpga_2025_12
Short title
ukpga
2,025
12
"Non-Domestic Rating (Multipliers and Private Schools) Act 2025 Additional multipliers for England D(...TRUNCATED)
"<Legislation xmlns=\"http://www.legislation.gov.uk/namespaces/legislation\" xmlns:xsi=\"http://www.(...TRUNCATED)
2025-04-03T00:00:00
2025-04-03T00:00:00
2025-04-03T00:00:00
[ "E", "W", "S", "N.I." ]
revised
[{"id":"section-1","number":"http://www.legislation.gov.uk/ukpga/2025/12/section/1/2025-04-03","titl(...TRUNCATED)
{ "classification": "", "title": "Short title" }
http://www.legislation.gov.uk/ukpga/2025/12/2025-04-03
1d7d0285fc68895496c4324b1b2e23e0
ukpga_2025_11
Short title
ukpga
2,025
11
"National Insurance Contributions (Secondary Class 1 Contributions) Act 2025 Rate of secondary Class(...TRUNCATED)
"<Legislation xmlns=\"http://www.legislation.gov.uk/namespaces/legislation\" xmlns:xsi=\"http://www.(...TRUNCATED)
2025-04-03T00:00:00
2025-04-03T00:00:00
2025-04-03T00:00:00
[ "E", "W", "S", "N.I." ]
revised
[{"id":"section-1","number":"http://www.legislation.gov.uk/ukpga/2025/11/section/1/2025-04-03","titl(...TRUNCATED)
{ "classification": "", "title": "Short title" }
http://www.legislation.gov.uk/ukpga/2025/11/2025-04-03
6aae9c48a1db7a941478a6ddfbe266ac
ukpga_2025_9
Extent, commencement and short title
ukpga
2,025
9
"Church of Scotland (Lord High Commissioner) Act 2025 Holding of office of Lord High Commissioner by(...TRUNCATED)
"<Legislation xmlns=\"http://www.legislation.gov.uk/namespaces/legislation\" xmlns:xsi=\"http://www.(...TRUNCATED)
2025-04-03T00:00:00
2025-04-03T00:00:00
2025-04-03T00:00:00
[ "E", "W", "S", "N.I." ]
revised
[{"id":"section-1","number":"http://www.legislation.gov.uk/ukpga/2025/9/section/1/2025-04-03","title(...TRUNCATED)
{ "classification": "", "title": "Extent, commencement and short title" }
http://www.legislation.gov.uk/ukpga/2025/9/2025-04-03
fddc63a27fc7eebdca3c233f34277a45
ukpga_2025_17
Extent, commencement and short title
ukpga
2,025
17
"Sentencing Guidelines (Pre-sentence Reports) Act 2025 Sentencing guidelines about pre-sentence repo(...TRUNCATED)
"<Legislation xmlns=\"http://www.legislation.gov.uk/namespaces/legislation\" xmlns:xsi=\"http://www.(...TRUNCATED)
2025-06-20T00:00:00
2025-06-19T00:00:00
2025-06-20T00:00:00
[ "E", "W" ]
revised
[{"id":"section-1","number":"http://www.legislation.gov.uk/ukpga/2025/17/section/1/2025-06-20","titl(...TRUNCATED)
{ "classification": "", "title": "Extent, commencement and short title" }
http://www.legislation.gov.uk/ukpga/2025/17/2025-06-20
0fe0716c955fcf3e3c952bfda852268c
ukpga_2025_20
Excluded products
ukpga
2,025
20
"Product Regulation and Metrology Act 2025 Product regulation Product regulations 1 1 The Secretary (...TRUNCATED)
"<Legislation xmlns=\"http://www.legislation.gov.uk/namespaces/legislation\" xmlns:xsi=\"http://www.(...TRUNCATED)
2025-07-21T00:00:00
2025-07-21T00:00:00
2025-07-21T00:00:00
[ "E", "W", "S", "N.I." ]
revised
[{"id":"section-1","number":"http://www.legislation.gov.uk/ukpga/2025/20/section/1/2025-07-21","titl(...TRUNCATED)
{ "classification": "", "title": "Excluded products" }
http://www.legislation.gov.uk/ukpga/2025/20/2025-07-21
7c6b15c9d295d9db01b090da2f17df1c
ukpga_2025_10
Disclosure of plans not included in licensing register
ukpga
2,025
10
"Terrorism (Protection of Premises) Act 2025 Part 1 Public protection requirements Introductory Over(...TRUNCATED)
"<Legislation xmlns=\"http://www.legislation.gov.uk/namespaces/legislation\" xmlns:xsi=\"http://www.(...TRUNCATED)
2025-04-03T00:00:00
2025-04-03T00:00:00
2025-04-03T00:00:00
[ "E", "W", "S", "N.I." ]
revised
[{"id":"section-1","number":"http://www.legislation.gov.uk/ukpga/2025/10/section/1/2025-04-03","titl(...TRUNCATED)
{ "classification": "", "title": "Disclosure of plans not included in licensing register" }
http://www.legislation.gov.uk/ukpga/2025/10/2025-04-03
efe81da8f4eae0f5ffc5272e5608c15e
ukpga_2025_19
The Local Government Boundary Commission for England, 2025-26
ukpga
2,025
19
"Supply and Appropriation (Main Estimates) Act 2025 Main authorisation for use of resources for 2025(...TRUNCATED)
"<Legislation xmlns=\"http://www.legislation.gov.uk/namespaces/legislation\" xmlns:xsi=\"http://www.(...TRUNCATED)
2025-07-21T00:00:00
2025-07-21T00:00:00
2025-07-21T00:00:00
[ "E", "W", "S", "N.I." ]
revised
[{"id":"section-1","number":"http://www.legislation.gov.uk/ukpga/2025/19/section/1/2025-07-21","titl(...TRUNCATED)
{ "classification": "", "title": "The Local Government Boundary Commission for England, 2025-26" }
http://www.legislation.gov.uk/ukpga/2025/19/2025-07-21
eccf3c1e3eb7351f7250594e3cecc846
End of preview. Expand in Data Studio

UK Legislation Dataset

This directory packages scraped UK legislation into a layout that can be ingested directly with the Hugging Face datasets library. All documents live in JSON Lines format inside data/ with one piece of legislation per line. The schema captures both plain-text and XML renderings, along with document-level metadata and section breakdowns.

Repository Layout

  • data/train.jsonl – full corpus of 175,515 documents ready for load_dataset.
  • meta/ – auxiliary files that describe the scrape workflow and provenance.
  • dataset_config.json – declarative configuration that mirrors the load_dataset arguments used during training.

Data Fields

Every record is a JSON object with the following keys:

  • id (string): canonical legislation identifier, e.g. ukpga_2025_23.
  • title (string): preferred title.
  • type (string): legislation class (ukpga, uksi, etc.).
  • year (int): legislation year.
  • number (int): act or statutory instrument number within the year.
  • text_content (string): consolidated plain-text content.
  • xml_content (string): raw XML body as served by legislation.gov.uk.
  • publication_date, enacted_date, coming_into_force_date (string): ISO dates when known.
  • extent (array[string]): geographic extent codes.
  • status (string): legislation status (In Force, Prospective, etc.).
  • sections (array[object]): ordered section data with id, number, title, content fields per section.
  • metadata (object): scraped metadata such as classification and title.
  • url (string): source URL.
  • checksum (string): SHA1 checksum of the XML payload.

Loading With datasets

from datasets import load_dataset

dataset = load_dataset(
    "json",
    data_files={"train": "data/train.jsonl"},
    features={
        "id": "string",
        "title": "string",
        "type": "string",
        "year": "int32",
        "number": "int32",
        "text_content": "string",
        "xml_content": "string",
        "publication_date": "string",
        "enacted_date": "string",
        "coming_into_force_date": "string",
        "extent": ["string"],
        "status": "string",
        "sections": [{
            "id": "string",
            "number": "string",
            "title": "string",
            "content": "string",
        }],
        "metadata": {
            "classification": "string",
            "title": "string",
        },
        "url": "string",
        "checksum": "string",
    },
)

You can further split the dataset with the usual train_test_split utilities or by sharding train.jsonl into additional files.

Provenance & Licensing

The dataset originates from legislation.gov.uk. Legislative content is generally covered by the UK Open Government Licence v3.0, but confirm applicability to your downstream use-case.

Downloads last month
87