Skip to main content

This is a simple implementation of PBPK modeling in python.

Project description

pbpk-lite

pbpk-lite is a lightweight Python package for basic physiologically based pharmacokinetic (PBPK) modeling.

It provides a simple programmatic interface for defining substance properties, patient physiology, elimination kinetics, and solving the resulting ODE system.

Features

  • Substance partition coefficient calculation using logP and fraction unbound
  • Patient blood flows and tissue volumes derived from body weight
  • Linear liver and kidney elimination pathways
  • ODE solution via scipy.integrate.solve_ivp
  • Simple plotting helper for concentration visualization

Installation

Install from PyPI:

pip install pbpk-lite

Install from source:

pip install .

Quick Start

from pbpk_lite import model

m = model()
m.set_substance(log_p=6.97, fu=0.0022448)
m.set_patient(bw=70)
m.set_elimination(cl_l=10, cl_k=0)

doses = [10]
times = [0, 24]

t, c = m.simulate(doses, times)
print(t)
print(c.shape)

Dosing Schedule

The simulate() method expects:

  • doses: array-like of administered doses
  • times: array-like of dosing times plus a final endpoint

Important: times must have exactly one more element than doses. Each dose at index i is administered at times[i], and the final value in times is the last observation or endpoint.

Example with one dose:

# one dose at time 0, observation at 24 hours
doses = [10]
times = [0, 24]

Example with two doses:

# doses at 0 and 12 hours, observation at 24 hours
doses = [10, 10]
times = [0, 12, 24]

API Summary

pbpk_lite.model

set_substance(log_p, fu)

Set the substance physicochemical properties.

  • log_p: log octanol-water partition coefficient
  • fu: fraction unbound in blood

set_patient(bw)

Set patient physiological parameters using body weight in kilograms.

set_elimination(cl_l=0, cl_k=0)

Set linear clearance from liver and kidney compartments.

simulate(doses, times)

Simulate the PBPK model and return time points t and compartment concentrations c.

License

pbpk-lite is licensed under the MIT License.

Project details


Download files

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

Source Distribution

pbpk_lite-1.0.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

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

pbpk_lite-1.0.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file pbpk_lite-1.0.0.tar.gz.

File metadata

  • Download URL: pbpk_lite-1.0.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for pbpk_lite-1.0.0.tar.gz
Algorithm Hash digest
SHA256 02a2bf54a19d7563c0bf34a54b52f880eb32aef9d06395ae7204983c5832f74e
MD5 2365696a57f49ebcaeafc14c7d656a82
BLAKE2b-256 e6ce513dda3b8b8f36ad004e19c7d10a4032b499c895f8ca3a0c77443cc1f248

See more details on using hashes here.

File details

Details for the file pbpk_lite-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pbpk_lite-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for pbpk_lite-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 70da8a640e7926c6b57d8cb7f9a70120f14daa42a1adb60b908dc30b64f91c78
MD5 78105c387b8ea2cbf4bc128b7686cb8c
BLAKE2b-256 d5bbf4242b27094e68b0dd9318c3dbc99e1fb7196d48677e1b108eb2be7c86f5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page