Skip to main content

Python PyTest Licence DOI

PFD Toolkit

Turn raw PFD reports into structured insights — fast.

PFD Toolkit is a suite of tools that replaces the manual effort involved in the collection, screening, and thematic discovery of PFD reports. It helps researchers, journalists, and public health analysts turn raw reports into actionable insights.

For more information, please consult package documentation.

Getting started

Installation

pip install pfd_toolkit

Load PFD Report Data (in seconds)

To load PFD data, just import the module, specify the category of reports and your date-range:

from pfd_toolkit import load_reports

reports = load_reports(
    start_date="2024-01-01",
    end_date="2025-05-01"
)

reports will be a pandas DataFrame. Each row is a separate report, and each column is a report section. For example:

url date coroner area receiver investigation circumstances concerns
[...] 2025-05-01 A. Hodson Birmingham and... NHS England; The Rob... On 9th December 2024... At 10.45am on 23rd November... To The Robert Jones...
[...] 2025-04-30 J. Andrews West Sussex, Br... West Sussex C... On 2 November 2024 I... They drove their car into... The inquest was told t...
[...] 2025-04-30 A. Mutch Manchester Sou... Fluxton Road Medical... On 1 October 2024 I... They were prescribed long... The inquest heard evide...
[...] 2025-04-25 J. Heath North Yorkshire... Townhead Surgery On 4th June 2024 I... On 15 March 2024, Richar... When a referral docume...
[...] 2025-04-25 M. Hassell Inner North Lo... The President Royal... On 23 August 2024, on... They were a big baby and... With the benefit of a m...

PFD Toolkit updates daily with freshly published reports. By default, load_reports() fetches the latest data each time. To reuse a locally cached copy for faster loading, set refresh to False:

reports = load_reports(refresh=False)

Key features

Beyond loading reports, PFD Toolkit lets you:

  • Screen reports: find cases relevant to your specific research question.
  • Summarise text: distill full-length reports into a custom summary.
  • Discover themes: uncover recurring topics contained within a selection of reports.
  • Categorise: assign and tabulate reports by discovered or user-defined themes.

To get started with these features, please check out the documentation.

Licence

This project is distributed under the GNU Affero General Public License v3.0 (AGPL-3.0). See the LICENCE file for the full text.

Please note:

  • You are welcome to use, modify, and share this code under the terms of the AGPL-3.0.
  • If you use this code to provide a networked service, you are required to make the complete source code available to users of that service.
  • Some project dependencies may have their own licence terms, which could affect certain types of non-research use (e.g. commercial use). Please review all relevant licences to ensure compliance.

Collaborate

We welcome feedback as well as code collaborators! Please read our collaboration page here

How to cite

If you use PFD Toolkit in your research, please cite the archived release:

Osian, S., & Pytches, J. (2025). PFD Toolkit: Unlocking Prevention of Future Death Reports for Research (Version 0.3.7) [Software]. Zenodo. https://doi.org/10.5281/zenodo.15729717

Or, in BibTeX:

@software{osian2025pfdtoolkit,
  author       = {Sam Osian and Jonathan Pytches},
  title        = {PFD Toolkit: Unlocking Prevention of Future Death Reports for Research},
  year         = {2025},
  version      = {0.3.7},
  doi          = {10.5281/zenodo.15729717},
  url          = {https://github.com/sam-osian/PFD-toolkit}
}

Release files for pfd_toolkit 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pfd_toolkit 0.4.0
File Size Uploaded
pfd_toolkit-0.4.0.tar.gz 10.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pfd_toolkit 0.4.0
File Interpreter ABI Platform
pfd_toolkit-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.6 MB

Release files / pfd_toolkit-0.4.0.tar.gz

Download URL pfd_toolkit-0.4.0.tar.gz
Size 10.6 MB
Tags Source
SHA-256 checksum
How to use checksums
19f1b526d7c56414b184d9c4fc7f2325030bc05873403f5166540b5d3d74b0b2
BLAKE2b-256 checksum
How to use checksums
b4d57ba227638f7fc4ac52403868e515044f6f31fa1558de0f224cea4665a3de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.13

Release files / pfd_toolkit-0.4.0-py3-none-any.whl

Download URL pfd_toolkit-0.4.0-py3-none-any.whl
Size 70.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb5d8fa36b2c9b78fc4da9d384f77c5db3fd8e6736d664458abf2edc640ab1cb
BLAKE2b-256 checksum
How to use checksums
918616402affe54e9ebbe59d5043c781a738b86725ebb47195c9ff2913ce7ad5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.13

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page