Skip to main content

pkpdsim: building blocks of PBPK/PD models

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

pkpdsim is a python package with the building blocks shared by physiologically based pharmacokinetic and pharmacodynamic (PBPK/PD) models in SBML. The models of pkdb_models are written in python with the factory of sbmlutils and simulated with sbmlsim; what they share lives in pkpdsim, so that the folder of a model imports nothing but itself and released packages.

Features include

  • templates and annotations - the creators and the terms of use of a model, the annotations of the compartments which recur in the models (liver, kidneys, gut, blood, urine, ...)
  • study data - the study folders of PK-DB in a checkout of pkdb_data, found through the environment variable PKDB_DATA, and the data of a model collected from them into its own folder
  • initial values - the same initial concentration or amount of a substance in every tissue of a model, which removes the distribution kinetics
  • licenses - the texts of CC BY-SA 4.0 and MIT for the COMBINE archive of a model, written byte for byte the same on every platform
  • models and their commands - the model object and the commands of a model (run, fit, report, identifiability), the tests of a model as functions and the verification of a change, also across versions of sbmlsim (pkpdsim-verify)
  • experiments and their metadata - the base class of the simulation experiments of a model (the SIds of its keys, the units of its data), the presets of the impaired organ function, the shared vocabulary of the metadata of a fit mapping and the filters which select the mappings of a fit by it
  • scans and sensitivity analyses - the timecourse of a point of a scan as sbmlsim 0.8 gave it and the table of the parameters, the distributions and the runner of the sensitivity analyses of a script
  • release of a model repository - pkpd_release makes the complete release of the repository of a model (models, simulations, fit reports, release notes, docs, Docker image, GitHub release) from its package, with --no-publish for a review before the commit
  • PBPK model library - pkpdsim.pbpk, from which the PBPK models of pkdb_models will be built: a model package writes its substances, the chemistry of its organs and its choices, and build adds the standard human physiology of ICRP 89, the standard organ with collapsing, the organ variants, routes and sinks, impaired organ function, observers (the arm vein by default) and the annotation of every element, and writes the comp and the flat SBML model (see the PBPK library)

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

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

Quickstart

from pathlib import Path

from pkpdsim.annotations import compartments
from pkpdsim.licenses import License, write_license
from pkpdsim.templates import creators

print(creators[0].givenName, creators[0].familyName)
print([resource for _, resource in compartments["li"]])

results = Path("results")
results.mkdir()
print(write_license(results, License.MIT, copyright="2026 Matthias König").name)
Matthias König
['fma/FMA:7197', 'bto/BTO:0000759', 'ncit/C12392']
mit.txt

The user guide of the documentation describes every module with a snippet which runs.

How to cite

DOI

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

König, M. (2026). pkpdsim: building blocks of physiologically based pharmacokinetic and pharmacodynamic models in SBML (Version 0.14.1) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.23873445

@software{konig_pkpdsim,
  author    = {König, Matthias},
  title     = {pkpdsim: building blocks of physiologically based pharmacokinetic and pharmacodynamic models in SBML},
  year      = {2026},
  month     = nov,
  version   = {0.14.1},
  publisher = {Zenodo},
  doi       = {10.5281/zenodo.23873445},
  url       = {https://doi.org/10.5281/zenodo.23873445},
}

Installation

pkpdsim requires python >= 3.14, simulates with sbmlsim 0.15 (sbmlsim>=0.15.0,<0.16, installed with it) and is available from pypi:

uv add pkpdsim

or with pip

pip install pkpdsim

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).

© 2026 Matthias König.

Metadata

Release files for pkpdsim 0.19.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 pkpdsim 0.19.0
File Size Uploaded Provenance Actions
pkpdsim-0.19.0.tar.gz 2.4 MB With provenance Details for pkpdsim-0.19.0.tar.gz

Built distribution (wheel)

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

Total release size: 3.1 MB

Release files / pkpdsim-0.19.0.tar.gz

Download URL pkpdsim-0.19.0.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
d9876afa19e4ba32e5d20abe2c59455726feb50125acd586e55cdf8b8f17c3b5
BLAKE2b-256 checksum
How to use checksums
82b7d5d7d10320a2010a64581cc6616b2f78be6bab0a41fc0bd94281758b95ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / pkpdsim-0.19.0-py3-none-any.whl

Download URL pkpdsim-0.19.0-py3-none-any.whl
Size 654.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c612a1f9b7b9b62b5caa11a61b68e0d63adb49ba9695363b203528a643350316
BLAKE2b-256 checksum
How to use checksums
c47d491e4a91da55a5600c1ca0d2a3ab4582ae7212305a8ad98c77b618e4c133
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Security for pkpdsim 0.19.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pkpdsim-0.19.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.19.0 This release

2 release files Full provenance

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