Skip to main content

pkpdutils: pharmacokinetic and pharmacodynamic analysis

GitHub Actions CI/CD Status Documentation Version Python Versions MIT License DOI

pkpdutils is a python library for the pharmacokinetic (PK) and pharmacodynamic (PD) analysis of timecourses and parameters. It was formerly published as pkdb-analysis, the analysis toolbox of PK-DB; version 1.0.0 is a rewrite without any PK-DB dependency.

Features include

  • non-compartmental analysis - exposure, peak, terminal phase, clearance and volume parameters of concentration and effect timecourses, single dose and multiple dosing (every dosing interval, steady state, accumulation), with units
  • data formats - read event records (NONMEM, Monolix), the two PKNCA tables and the CDISC ADaM ADNCA dataset, write event records back
  • uncertainty - bootstrap and delta method propagation for group timecourses (mean ± SD), summary statistics over individuals
  • curve fitting - exponential, Bateman, Emax, dose proportionality and covariate models with standard errors, confidence intervals and model comparison
  • statistics on parameters - significance tests, geometric mean ratios, bioequivalence, classification of drug–drug interactions, meta-analysis
  • figures - timecourses, NCA diagnostics, fits, parameter distributions, forest and ratio plots

All data structures are xarray datasets with pint units, so many timecourses are analysed in one vectorized call.

The documentation is available at https://matthiaskoenig.github.io/pkpdutils.

If you have any questions or issues please open an issue.

Quickstart

A study of twelve subjects in three dose groups, from the event table it arrives in to the parameter table and the figure of the report. The table is study.csv, which the first walk-through of the Workflows builds:

import pandas as pd

from pkpdutils import Route, Timecourses, nca, summary_table
from pkpdutils.plot import plot_mean_timecourse

# [study.csv](https://raw.githubusercontent.com/matthiaskoenig/pkpdutils/develop/docs/data/study.csv):
# ID, TIME, DV, AMT, EVID and the dose group
events = pd.read_csv("study.csv")
batch = Timecourses.from_events(
    events,
    time_unit="hr",
    unit="mg/l",
    dose_unit="mg",
    route=Route.ORAL,
    covariates=["dose"],
)
result = nca(batch)
print(
    summary_table(
        result,
        "individual",
        by="dose",
        parameters=["auc_inf_obs", "cmax", "thalf", "cl_f"],
    ).to_string(index=False)
)
plot_mean_timecourse(batch, by="dose").savefig("study_curves.png", dpi=120)

The mean curve of every dose group with its standard deviation, linear and semi-logarithmic

The same steps with the table built in place, the parameters printed and four more walk-throughs (bioequivalence, drug-drug interaction, steady state, dose proportionality) are in the Workflows of the documentation; the Gallery shows a figure and a snippet for every example of the repository.

How to cite

DOI

If you use pkpdutils please cite the archived software on Zenodo:

König, M. & Grzegorzewski, J. (2026). pkpdutils: pharmacokinetic and pharmacodynamic analysis of timecourses and parameters (Version 1.0.0) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.22772056

Installation

pkpdutils requires python >= 3.13 and is available from pypi:

uv add pkpdutils

or with pip

pip install pkpdutils

See Installation for details and Development for working on the repository.

License

Funding

Matthias König is supported by the German Research Foundation (DFG) within the Research Unit Programme FOR 5151 "QuaLiPerF (Quantifying Liver Perfusion-Function Relationship in Complex Resection - A Systems Medicine Approach)" by grant number 436883643 and by grant number 465194077 (Priority Programme SPP 2311, Subproject SimLivA).

Matthias König was supported by the Federal Ministry of Education and Research (BMBF, Germany) within the research network Systems Medicine of the Liver (LiSyM, grant number 031L0054).

© 2018-2026 Matthias König & Jan Grzegorzewski.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pkpdutils-1.1.0.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pkpdutils-1.1.0-py3-none-any.whl (221.6 kB view details)

Uploaded Python 3

File details

Details for the file pkpdutils-1.1.0.tar.gz.

File metadata

  • Download URL: pkpdutils-1.1.0.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pkpdutils-1.1.0.tar.gz
Algorithm Hash digest
SHA256 46a076b3f57024c8ae6a5edecf1cef650764cbba6ecfeae85d8ae2c14bb3599e
MD5 438ea3a164bc3a28e82b87450235b388
BLAKE2b-256 3e1a479e80b4b86c90c42fe8f37f88f160bd2159397d3f92d5e932b520e784e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pkpdutils-1.1.0.tar.gz:

Publisher: ci-cd.yml on matthiaskoenig/pkpdutils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pkpdutils-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: pkpdutils-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 221.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pkpdutils-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb5e55b45b0ab5c68aad00d1307b2fe9b8427ebd366c069c862266551629601c
MD5 a35330e0423d54b4bc9e1f3a865b69b6
BLAKE2b-256 786e61de13d67f82b853ce8a011e2112a5a9fb5d8649cbebc30317cfada1956a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pkpdutils-1.1.0-py3-none-any.whl:

Publisher: ci-cd.yml on matthiaskoenig/pkpdutils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.2.0

2 files

This release

1.1.0 This release

2 files

1.0.0

2 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