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.solve(doses, times)
print(t)
print(c.shape)

Dosing Schedule

The solve() 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.

solve(doses, times)

Solve 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-0.0.2.tar.gz (6.1 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-0.0.2-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pbpk_lite-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c0ad43380677df6f6223731758bd68592298ad89a8abae55fbed70889724eecc
MD5 906faa29fb69da1f3add1aec2a433e1f
BLAKE2b-256 532ac3d0fa20971216d32df3f4a82b9d250ca124e0bd02e03f107c8d17f76e20

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pbpk_lite-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d2bb329f69b772f5a55ba0a5fc562cc283b9c49d828df0c179e29909d7b55358
MD5 59cf530c1f2d43f99a899948db0cb903
BLAKE2b-256 b80c63607a0103ebef2489937fd3a1e35c993e74147c5b8d17586391637e324d

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