pkpdutils: pharmacokinetic and pharmacodynamic analysis
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 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
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
- Source Code: MIT
- Documentation: CC BY-SA 4.0
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46a076b3f57024c8ae6a5edecf1cef650764cbba6ecfeae85d8ae2c14bb3599e
|
|
| MD5 |
438ea3a164bc3a28e82b87450235b388
|
|
| BLAKE2b-256 |
3e1a479e80b4b86c90c42fe8f37f88f160bd2159397d3f92d5e932b520e784e5
|
Provenance
The following attestation bundles were made for pkpdutils-1.1.0.tar.gz:
Publisher:
ci-cd.yml on matthiaskoenig/pkpdutils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pkpdutils-1.1.0.tar.gz -
Subject digest:
46a076b3f57024c8ae6a5edecf1cef650764cbba6ecfeae85d8ae2c14bb3599e - Sigstore transparency entry: 2858709099
- Sigstore integration time:
-
Permalink:
matthiaskoenig/pkpdutils@45dbb03d200bb9efb6a80b6567e59d5e96afb481 -
Branch / Tag:
refs/tags/1.1.0 - Owner: https://github.com/matthiaskoenig
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-cd.yml@45dbb03d200bb9efb6a80b6567e59d5e96afb481 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb5e55b45b0ab5c68aad00d1307b2fe9b8427ebd366c069c862266551629601c
|
|
| MD5 |
a35330e0423d54b4bc9e1f3a865b69b6
|
|
| BLAKE2b-256 |
786e61de13d67f82b853ce8a011e2112a5a9fb5d8649cbebc30317cfada1956a
|
Provenance
The following attestation bundles were made for pkpdutils-1.1.0-py3-none-any.whl:
Publisher:
ci-cd.yml on matthiaskoenig/pkpdutils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pkpdutils-1.1.0-py3-none-any.whl -
Subject digest:
bb5e55b45b0ab5c68aad00d1307b2fe9b8427ebd366c069c862266551629601c - Sigstore transparency entry: 2858709311
- Sigstore integration time:
-
Permalink:
matthiaskoenig/pkpdutils@45dbb03d200bb9efb6a80b6567e59d5e96afb481 -
Branch / Tag:
refs/tags/1.1.0 - Owner: https://github.com/matthiaskoenig
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-cd.yml@45dbb03d200bb9efb6a80b6567e59d5e96afb481 -
Trigger Event:
push
-
Statement type: